Subject | Re: [IBO] Multiple SQL Statements in Edit-/Insert-/DeleteSQL |
---|---|
Author | Helen Borrie |
Post date | 2004-07-12T13:44:21Z |
At 03:23 PM 12/07/2004 +0200, you wrote:
tables, you have no option other than a stored procedure (which, itself,
can be quite trivial).
row of data into a single table using your own parameter assignments; or
calling a parameterised stored procedure.
input parameters, you won't have to code anything.
Helen
>Hello,No. A DML statement can operate on one and only one table.
>
> is it possible to have multiple SQL statements in the Edit-, Insert- or
>Delete SQL fields in a TIB_Query?
>I'd like to do something like this in an InsertSQL:
>
>insert into foo( a, b ) values ( :a, :b );
>insert into bar( c ) values ( :c );
>
>because the select looks like
>
>select a, b, c from foo left join bar on bar.id_foo=foo.id
>and I don't want to add a stored procedure for this moreUpdating two tables is not a trivial task. If you have to update both
>or less trivial task.
tables, you have no option other than a stored procedure (which, itself,
can be quite trivial).
>I can't use the BeforeInsert event, because bar dependsYou simply can't do it, period. It's against database rules.
>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.
>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.
>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.
Helen