on 03-30-2010 7:17 AM
Hello,
currently I'm facing a problem which I don't know how to deal with.
We need a script which deletes/disables two triggers first, then delete some data and afterwards create/enable the triggers again.
I didn't find a proper hint how to cover this with dbmcli, probably we have to use a "higher" language..?!?!
Is it possible at all to provide "dbmcli -i" with a file including sql statements like the example afterwards ?
Is it possible to disable/enable triggers or do I have to delete and create them ?
e.g.:
disable/drop trigger trig_a
disable/drop trigger trig_b
delete from a where....
delete from b where...
enable/create trigger trig_a...
...
enable/create trigger trig_b...
....
used maxDB version is 7.5.0.38
any hint appreciated....GERD.....
Hi Gerd,
please be aware that DBMCLI is a DBMServer client, not a SQL client (although it can tunnel some sql through the DBMServer).
Better use SQLCLI for things like that.
And. no, you cannot switch triggers on and off - just drop and recreate them.
But you may specify the IGNORE TRIGGER keyword for the delete statements.
That way you can leave the triggers just as they are.
p.s.
Any reason to stay on super old 7.5 ?
regards,
Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
there is no 'DISABLE TRIGGER' or similar available for MaxDB.
Therefore deleting them and re-installing may be the best/only way if you will have to delete maaaaaaaaaaany rows and do not want to execute the trigger(s).
But then one could ask why there IS a trigger for deletion if some deletions will be done correctly without using the trigger. But I hope, you really know what you are doing.
IGNORE TRIGGER can only be used within a trigger itself (to avoid endless-loops). This sentence is missing in the documents for delete/update. I will ask for correction.
Elke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
there is no 'DISABLE TRIGGER' or similar available for MaxDB.
Therefore deleting them and re-installing may be the best/only way if you will have to delete maaaaaaaaaaany rows and do not want to execute the trigger(s).
But then one could ask why there IS a trigger for deletion if some deletions will be done correctly without using the trigger. But I hope, you really know what you are doing.
Elke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.