BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

One Tquery for different accesses

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Gianni Filippini
Guest





PostPosted: Mon Jul 18, 2005 5:55 pm    Post subject: One Tquery for different accesses Reply with 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
Bill Todd
Guest





PostPosted: Mon Jul 18, 2005 6:35 pm    Post subject: Re: One Tquery for different accesses Reply with quote



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





PostPosted: Tue Jul 19, 2005 8:53 am    Post subject: Re: One Tquery for different accesses Reply with quote




Bill ,
thank you again & regards,
Gianni Filippini



Back to top
Jan Doggen
Guest





PostPosted: Tue Jul 19, 2005 8:56 am    Post subject: Re: One Tquery for different accesses Reply with quote

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





PostPosted: Wed Jul 20, 2005 9:12 am    Post subject: Re: One Tquery for different accesses Reply with quote

Jan,
thank you much,
your advice is very useful,
Gianni Filippini



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.