Discussion:
Problem between TRIGGERS and APPEND
(too old to reply)
neoLeoX
2004-12-31 14:55:22 UTC
Permalink
Hi...

Me Again...

How could I temporarily interrupt the effect of the
Insert, Update and Delete Triggers on a table?

So after my "Data Import" routines I could activate them again.

Thanks in advance

L.Ortega
El Paso Tx.
Happy New Year!!
Olaf Doschke
2004-12-31 16:30:51 UTC
Permalink
Hi L.Ortega,

Please read this as whole before you start:

That can be done with
DELETE TRIGGER ON Tablename FOR DELETE
...UPDATE
...INSERT

But I'd only suggest dropping the triggers
for APPENDS, if you have exclusive
access to the tables.

To recreate the triggers you need to reset them with
DBSETPROP("Tablename","TABLE","DELETETRIGGER","__RI_DELETE_Tablename")

__RI_DELETE_Tablename is the normal name for that trigger
You may also drop the triggers with setting this to "" and you
can find out how this was set before by initially storing the
information DBGETPROP gives you.

Bye, Olaf
neoLeoX
2004-12-31 21:36:30 UTC
Permalink
Thanks Olaf I could solve it using what you adviced me...

Only one thing
I could not use
DBSETPROP("Tablename","TABLE","DELETETRIGGER","__RI_DELETE_Tablename")
because appearently is an read-only property

so I used

.
.
.
lcTrigUpd = ALLTRIM(af[jj,14])
.
.
DELETE TRIGGER ON (lcAlias) FOR UPDATE
.
.
CREATE TRIGGER ON (lcAlias) FOR UPDATE AS &lcTrigUpd
.
.

And works ok!


Thanks again!!
Post by Olaf Doschke
Hi L.Ortega,
That can be done with
DELETE TRIGGER ON Tablename FOR DELETE
...UPDATE
...INSERT
But I'd only suggest dropping the triggers
for APPENDS, if you have exclusive
access to the tables.
To recreate the triggers you need to reset them with
DBSETPROP("Tablename","TABLE","DELETETRIGGER","__RI_DELETE_Tablename")
__RI_DELETE_Tablename is the normal name for that trigger
You may also drop the triggers with setting this to "" and you
can find out how this was set before by initially storing the
information DBGETPROP gives you.
Bye, Olaf
Leonid
2005-01-02 11:39:15 UTC
Permalink
You may use CREATE TRIGGER command to restore triggers:

CREATE TRIGGER ON MyTable FOR INSERT AS __RI_INSRET_MyTable()


Leonid
Post by neoLeoX
Thanks Olaf I could solve it using what you adviced me...
Only one thing
I could not use
DBSETPROP("Tablename","TABLE","DELETETRIGGER","__RI_DELETE_Tablename")
because appearently is an read-only property
so I used
.
.
.
lcTrigUpd = ALLTRIM(af[jj,14])
.
.
DELETE TRIGGER ON (lcAlias) FOR UPDATE
.
.
CREATE TRIGGER ON (lcAlias) FOR UPDATE AS &lcTrigUpd
.
.
And works ok!
Thanks again!!
Post by Olaf Doschke
Hi L.Ortega,
That can be done with
DELETE TRIGGER ON Tablename FOR DELETE
...UPDATE
...INSERT
But I'd only suggest dropping the triggers
for APPENDS, if you have exclusive
access to the tables.
To recreate the triggers you need to reset them with
DBSETPROP("Tablename","TABLE","DELETETRIGGER","__RI_DELETE_Tablename")
__RI_DELETE_Tablename is the normal name for that trigger
You may also drop the triggers with setting this to "" and you
can find out how this was set before by initially storing the
information DBGETPROP gives you.
Bye, Olaf
Olaf Doschke
2005-01-02 14:21:59 UTC
Permalink
Hi!
Post by neoLeoX
I could not use
DBSETPROP("Tablename","TABLE","DELETETRIGGER","__RI_DELETE_Tablename")
because appearently is an read-only property
Yep! You're right. Sorry.
Sometimes I wonder why certain
DB-Properties are Read-Only although
you can set them with other commands...

Also take a look at what GenDBC generates
for setting the relation TYPE. It hacks the
dbc table and inserts into the RiInfo field:

FUNCTION MakeRI
...
REPLACE RiInfo WITH '...'
...

But don't worry, this (and the stored procedures
themselves) remain unchanged, if you drop triggers
and restore them with DELETE TRIGGER /
CREATE TRIGGER...

On the other side, this introduces some
inconsistency, if you really want to remove
a trigger. I think next time you rebuild the RI-
Code with the Database Manager the triggers
are there again as defined in the RiInfo field,
as that is the source of the information the
RI-Code-Builder uses to create the trigger-
code.

Bye, Olaf.

Loading...