Subject Re: [IBO] TIBOQuery EditSQL with an anonymous sql block
Author Jason Wharton
Create a stored procedure and then pass in the info you need to the stored
procedure.

Jason

----- Original Message -----
From: "lsolart" <lsolar@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, October 23, 2003 10:57 AM
Subject: [IBO] TIBOQuery EditSQL with an anonymous sql block


> Is it possible to create an anonymous SQL block at a customized
> TIBOQuery.EditSQL sentence? Let's say:
>
> begin
> if (itemId is not null) then
> update items
> set value = :value
> where itemId = :itemId;
> else
> begin
> :itemId = gen_id(items_sq, 1);
> insert into items (orderId, itemId, value)
> values (:orderId, :itemId, :value);
> end
> end;
>
> I do this because the sql is a outer joined query, so the dataset
> suposes that record exists and it calls directly EditSQL sentence
> instead InsertSQL one.
>
> Thanks,
> Luis Solar.