Subject Re: [IBO] Parameterized queries
Author Jason Wharton
That's how you have to do it if you want to see what the server has done
with the record. If you don't care what the server has or hasn't done then
an additional fetch isn't necessary.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Nico Callewaert" <nico.callewaert@...>
To: <IBObjects@egroups.com>
Sent: Monday, January 22, 2001 11:59 AM
Subject: [IBO] Parameterized queries


> Hi list,
>
> I'm always using parameterized queries to transfer just the record of
> interest to the client, to reduce network traffic and to not transfer
> unnecesary records to the clients side. I just have one problem /
> question. I will use an example to explain it : let's say I get 1
invoice
> record from a table. My code looks like this :
>
> AQuery1.Prepare;
> AQuery1.Params [0].AsInteger := ANumber; (let's say 1234)
> AQuery1.Open;
>
> This works nice and fast, but the problem is now, if I insert a new
record,
> let's say the new invoiceno is 9999. After I post the record, the new
> inserted data disappears from the screen, which is normal, because the
> parameter for the record was InvoiceNo := 1234.
> Now I solve it like this, just close the query, add the new parameter to
it
> and open it again, this takes some little time and the user can see it,
that
> something is closing and opening again. Is there a better way, or that's
> the way it has to be ?
>
> AQuery1.Close;
> AQuery1.Params [0].AsInteger := TheNewNumber; (here 9999)
> AQuery1.Open;
>
> Thanks a lot...
>
> Nico Callewaert
>
> E-mail : nico.callewaert@...
> ncw@...
>
>
>
>