 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gianni Filippini Guest
|
Posted: Mon Jul 18, 2005 5:55 pm Post subject: One Tquery for different accesses |
|
|
One Tquery for different accesses
hello Group,
my code seems to work well but I would like
to know if this way is correct :
(Delphi_6, Firebird, zQuery / or IBquery)
I use only one "query component" for select, insert, update , delete
and sometimes I set the sql.text to access to another table
(i.e. select * from otherTable)and then I execute a
Datasource.Dataset.Locate
(between .Starttransaction / .Commit )
to read a small_table record.
Then I reset the Sql.Text to execute other .ExecSql.
Is there any contraindication ?
many thanks in advance & regards,
Gianni Filippini
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Mon Jul 18, 2005 6:35 pm Post subject: Re: One Tquery for different accesses |
|
|
There is nothing wrong with changing the SQL that a query component
executes. However, doing a Locate on a query result is not a good idea
since, particularly with large result sets, since it requires the
entire result set to be read across the network to the client. It is
better to use a WHERE clause on the select to get the rows you want.
--
Bill Todd (TeamB)
|
|
| Back to top |
|
 |
Gianni Filippini Guest
|
Posted: Tue Jul 19, 2005 8:53 am Post subject: Re: One Tquery for different accesses |
|
|
Bill ,
thank you again & regards,
Gianni Filippini
|
|
| Back to top |
|
 |
Jan Doggen Guest
|
Posted: Tue Jul 19, 2005 8:56 am Post subject: Re: One Tquery for different accesses |
|
|
Hi Gianni
I do this all the time.
I use Queries for the major datasets that have to be open (very often for
views in grids, with a ClientDataset attached), and then I have a QryLookup
and a QryUpdate when the appe creates ad-hoc queries.
For clarity I sometimes use a QryTable1Lookup, QryTable1Update,
QryTable2Lookup, QryTable2Update.
The 'rule' I use is: whatever makes my code easiest to read.
Jan
"Gianni Filippini" <nonono (AT) tiscalinet (DOT) it> wrote
| Quote: | One Tquery for different accesses
hello Group,
my code seems to work well but I would like
to know if this way is correct :
(Delphi_6, Firebird, zQuery / or IBquery)
I use only one "query component" for select, insert, update , delete
and sometimes I set the sql.text to access to another table
(i.e. select * from otherTable)and then I execute a
Datasource.Dataset.Locate
(between .Starttransaction / .Commit )
to read a small_table record.
Then I reset the Sql.Text to execute other .ExecSql.
Is there any contraindication ?
many thanks in advance & regards,
Gianni Filippini
|
|
|
| Back to top |
|
 |
Gianni Filippini Guest
|
Posted: Wed Jul 20, 2005 9:12 am Post subject: Re: One Tquery for different accesses |
|
|
Jan,
thank you much,
your advice is very useful,
Gianni Filippini
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|