Subject Question about SQL
Author slsolutions2002
Hello:

I have posted a few questions about the speed of Interbase/IBO and
received some good answers that have led me to experiment with
IB_DSQL. Using SQL instead of locate..edit..post does seem to make a
dramatic speed difference. However, since my knowledge of SQL is
very limited, before I spend a lot of time changing my code I want to
verify that I am using the proper approach so I don't have to change
it again later.

Basically what I need to do a is lookup a record in one table (for
update). Modify some fields in that record. Some of the fields
values are set from values in other tables. Somewhat like this:

queryone.locate
queryone.edit
queryone.fieldbyname('xxx') := yyy
....
querytwo.locate
queryone.fieldbyname('yyy') := querytwo.fieldnyname('zzz')
...
queryone.post

To do this using SQL I use an IB_DSQL as follows:

I set the SQL in the IB_DSQL to locate the record in QUERYONE to be
updated then execute the IB_DSQL
I set the SQL in the IB_DSQL to locate the record in QUERYTWO that I
will be using to update fields in QUERYONE then execute the IB_DSQL
Then, using parameters I set up the IB_DSQL to update QUERYONE then
execute the IB_DSQL

This works but causes me to set up the IB_DSQL and execute it
repeatedly to accomplish the update and locates. My question is
this: Is this the proper way to handle this or is there a way to set
up the IB_DSQL and execute it only once to handle the update of
fields in one table based on values from fields in another ..
possibly using parameters?

I hope this makes sense, Thanks.