Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Query params count
Fri, Nov 1 2013 2:27 PMPermanent Link

dmitryl

Why params.count return 1, if actual params - 2?

 DBISAMQuery1.SQL.Text := 'DELETE FROM item WHERE id = :id DELETE FROM link WHERE parent_id = Tonguerent_id;';
 DBISAMQuery1.Prepare;
 ShowMessage(IntToStr(DBISAMQuery1.Params.Count)); // return - 1
Fri, Nov 1 2013 2:58 PMPermanent Link

dmitryl

dmitryl wrote:

Why params.count return 1, if actual params - 2?

 DBISAMQuery1.SQL.Text := 'DELETE FROM item WHERE id = :id; DELETE FROM link WHERE parent_id = Tonguerent_id;';
 DBISAMQuery1.Prepare;
 ShowMessage(IntToStr(DBISAMQuery1.Params.Count)); // return - 1
Mon, Nov 4 2013 9:47 AMPermanent Link

Matthew Jones

There are two queries/statements there so I presume it is picking up only the first
for the count.


/Matthew Jones/
Mon, Nov 4 2013 12:42 PMPermanent Link

Raul

Team Elevate Team Elevate

Exactly and one has to use the OPnGetParams event to use multiple
parameters in this case.

Manual has details (under Parameters and Multiple SQL Statements section) :

http://www.elevatesoft.com/manual?action=viewtopic&id=dbisam4&product=rsdelphi&version=2007&topic=Parameterized_Queries

Raul

On 11/4/2013 9:47 AM, (Matthew Jones) wrote:
> There are two queries/statements there so I presume it is picking up only the first
> for the count.
>
>
> /Matthew Jones/
>
Image