"in" statement

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
francisco
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 14.05.2013, 00:49

"in" statement

Post by francisco »

what is the best way to work with "in" statement, and zeos query?

example:
...
query.sql.add('where fieldname in (:field) ');
query.parambyname('field').AsIDontKnow := MaybeArray;

I currently have to concatenate the string, to do this...
is there a more elegant way than simply having to concatenate strings?

and excuse me if I say any bullshit...
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: "in" statement

Post by EgonHugeist »

francisco,

don't know which provider you're using.. You could also try to use parameters '.... in [:P1, :P2......]. IF your changing your SQL all pareters are cleared and reassigned so you have a floating param-count. String-Concatation forces Zeos always to prepare a new stmt which leads to performance loss.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply