Subject Re: [IBO] Multiple SQL Statements in Edit-/Insert-/DeleteSQL
Author Daniel Albuschat
Hello Helen,

Helen Borrie wrote:

>At 04:04 PM 12/07/2004 +0200, you wrote:
>
>
>
>>>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?
>>
>>
>Yes, because IBO implements the API, it doesn't re-invent the database engine.
>
>
Of course not. But IBO is an interface to automatically do Insert, Update
and Delete statements for you. The developer only has an opened TIB_Query
and calls the "Delete" method. Now IBO generates the proper Delete-SQL
Statement and executes it.
I don't understand why it would be impossible to let IBO execute more than
one Delete-SQL Statement with the same data.

The only problem I can imagine is the parameter count.
From what I can tell, IBO parses the parameters itself anyways in some
way (but I could be wrong of course), so it could just put in the values for
each parameter it finds in each of the SQL Statements.

If IBO doesn't parse and expand the parameters itself, it would be a
waste to
implement the parser just for this feature, though.

>>Wouldn't it be nice to just have 2 (or n, for that matter)
>>update-statements which are executed by ibobjects when necessary?
>>
>>
>
>Now, how would IBO do that?
>
>You can, of course, execute batches of statements using TIB_Script; but,
>of course, scripts can't take parameters...
>
>
Yes the parameters may be a problem, see above.
I don't know about the C firebird/interbase API... does it
complain if you set a parameter that doesn't occure in the SQL
Statement? If not, this shouldn't be much of a problem at all...

>>I can do whatever is necessary to insert the
>>dataset in OnCustomInsert, can't I?
>>
>>
>-- "insert the dataset" ---????
>
>
Well, insert the data.
I once had used a OnCustomInsert that did, depending on the
data it got from my Select-SQL, insert into different
tables. I just used a TIB_DSQL to do the inserts.

I still don't know why you declare this `impossible'.

cu,
Daniel