Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread parameters in script
Thu, Feb 15 2007 6:31 AMPermanent Link

"Harry de Boer"
dbIsam 3.3. D6

LS

When executing a SQl script is it correct that parameters only work in the
first statement? The script and code below doesn't work because the ot
parameter doesn't seem to work. How to overcome this (in SQL -I know I can
filter the result, but I want to fetch the right result right away)?

Regards, Harry

 q.Close;
 q.ParamByName('d1').AsDateTime := d1.DateTime;
 q.ParamByName('d2').AsDateTime := d2.DateTime;
 q.ParamByName('ot').AsString := lookupcombo.Text;
 q.Open;

select distinct id_object into memory temp from objecten, contractregels
where objecten.id_object = contractregels.id_object_artikel
and ( datum_van <= :d2 and datum_tot >= :d1) ;

select distinct id_object from objecten
where id_object not in (select * from memory temp)
and verhuurobjecttype = Surprised;

Thu, Feb 15 2007 7:32 AMPermanent Link

"Robert"

"Harry de Boer" <harry@staaf.nl> wrote in message
news:6AA38805-4791-41F6-9D06-A5AE13FEE018@news.elevatesoft.com...
> dbIsam 3.3. D6
>
> LS
>
> When executing a SQl script is it correct that parameters only work in the
> first statement? The script and code below doesn't work because the ot
> parameter doesn't seem to work. How to overcome this (in SQL -I know I can
> filter the result, but I want to fetch the right result right away)?
>

Run two queries, or do a stringreplace on query.text replacing 'Surprised' with
the value. If you run two queries, don't forget to close the first one to
allow access to the memory table.

Robert


Thu, Feb 15 2007 10:21 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Harry,

<< When executing a SQl script is it correct that parameters only work in
the first statement? The script and code below doesn't work because the ot
parameter doesn't seem to work. How to overcome this (in SQL -I know I can
filter the result, but I want to fetch the right result right away)? >>

In version 3.x, yes.  In 4.x you can supply different parameters for each
statement.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image