Subject Re: [IBO] Multiple SQL Statements in Edit-/Insert-/DeleteSQL
Author Daniel Albuschat
On Mon, Jul 12, 2004 at 11:44:21PM +1000, Helen Borrie wrote:
> At 03:23 PM 12/07/2004 +0200, you wrote:
> >Hello,
> >
> > is it possible to have multiple SQL statements in the Edit-, Insert- or
> >Delete SQL fields in a TIB_Query?
--8<------
>
> A DML statement can operate on one and only one table.

But do these SQL-Statements need to be treated as a
single DML Statement?

> >and I don't want to add a stored procedure for this more
> >or less trivial task.
>
> Updating two tables is not a trivial task. If you have to update both
> tables, you have no option other than a stored procedure (which, itself,
> can be quite trivial).

Wouldn't it be nice to just have 2 (or n, for that matter)
update-statements which are executed by ibobjects when necessary?

> >I can't use the BeforeInsert event, because bar depends
> >on foo (foreign key set).
> >And I can't use AfterInsert because I'd have to Refresh the
> >data after I've done the insert.
>
> You simply can't do it, period. It's against database rules.

What do you mean? I can't do what?
And having two tables linked to each other definitely is
not against database rules...

> >OnCustomInsert would work,
>
> Not. OnCustomInsert refers to a custom InsertSQL operation: inserting a
> row of data into a single table using your own parameter assignments; or
> calling a parameterised stored procedure.

I can do whatever is necessary to insert the
dataset in OnCustomInsert, can't I?

> >but the InsertSQL is less to type and maintain, IMHO.
>
> It certainly is; and, if you are careful with the names you give to the
> input parameters, you won't have to code anything.

Except for the stored procedure...

Thanks for your answer,
Daniel Albuschat

--
eat(this); // delicious suicide