Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QBE or SQL? 1

Status
Not open for further replies.

garyjon

IS-IT--Management
Jul 21, 2002
5
0
0
NZ
Could anyone tell me which is faster in searchs QBE or SQL?

And is there anyway of hi-lighting a record in a table when a condition is met in a field. We have a table and one field indicates if the record is restricted or not. We have been able to set the baground of the field to red if it contains the word restricted in it, but I want it to display red backgrounds in the all fields of that record.

 
garyjon,

As far as the performance of queries goes, it really depends on the types of tables you're using. In general, SQL tends to be faster than QBE, simply because Borland spent more time tweaking the SQL supported by BDE than they spent tweaking QBE.

(QBE has not really changed very much in the last ten years while SQL has been tweaked to handle different servers and datasources.)

Also, QBE queries tend to get converted to SQL queries behind the scenes. If you create SQL queries directly, you can sometimes create a faster performing query than the ones that BDE creates from QBE queries.

Also, you can sometimes improve query performance by breaking large, complex queries into multiple, smaller ones. Case in point: If you join several tables together and return a set of rows based on various criteria (and the tables are stored on a network/remote server), you can sometimes improve performance by running the criteria query, and then joining the detail tables to the results in Answer.

Experimentation is really best.

If you're working with Paradox (or dBASE) tables, you can frequently improve the performance of either QBE or SQL queries by using ObjectPAL to save the results in TCursors, rather than saving them to an Answer table.

I've got a few different examples of different types of queries on my site. For example, walks you through the process of using an existing report to print the results of a query. It demonstrates the TCursor trick I mentioned earlier.

Also, shows a few different ways of working with queries, including a rather nifty trick for working with SQL queries.

To highlight all fields in a table frame, you'll want to change the color of the field's record object (perhaps by setting Container.Color instead of Self.Color in your code.) If you're looking to do this automatically, take a peek at
which shows the general way to persistently highlight a record in a table frame. It also shows the types of things that are available and how to harness them. Perhaps it'll help you work the precises effect you're looking for.

Hope this helps...

-- Lance
 
Thanks for the help, it has answered what I needed and want to know. Much appreciated Lance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top