Tibdataset:ModifySQL update two or more tables |
|
Re: Tibdataset:ModifySQL update two or more tables |
|
Andreas Sibbus wrote:
> Hello,
>
> is there a way of updating more than one table in ModifySql?
>
> If I try to do something like:
> {code}
> Update table1
> set a = 1
> where id = old_id;
> Update table2
> set b = 2
> where id_2 = old_id_2;
> {code}
>
> I get an error.
> I only can do one update statement.
>
> Anybody an idea?
>
> Thanks in advance.
>
> Andreas
Not directly. You will need to add an OnUpdaterecord event and use an IBSQL(s)
dto do the updating and execute different SQL when the event is Modify.
The other alternative is to write a stored procedure that does your update and
pass all the fields to it.
While I have planned to add scripting capabilities to the insert/modify/delete
SQL, I have not gotten around to it so they are all single statement items (no
won't be added for XE7 either).
--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted corridors of Whitehall.
(Fish)
|