pass table name from trigger to procedure?
As you can see below I am trying to delete rows from tables based on the number of days defined in the trigger defined on the table.
I have read the docs but I can not determine what value to use as the tablename unless I just set one.
Any suggestions?
<code>
CREATE PROCEDURE TRUNCATE_TABLE_TO_TIME (tb varchar(32),days int(11))
-> BEGIN
-> DELETE FROM tb where timestamp <= UNIX_TIMESTAMP(DATE_SUB(CURDATE(),INTERVAL days DAY));
-> END;
CREATE TRIGGER Delete_After_Insert AFTER INSERT ON event_table
-> FOR EACH ROW BEGIN
CALL TRUNCATE_TABLE_TO_TIME( ?NEW? , 10);
-> END;
-> //
</code>
Subject
Views
Written By
Posted
pass table name from trigger to procedure?
6896
May 19, 2006 03:22PM
3311
May 19, 2006 03:29PM
3018
May 19, 2006 04:52PM
2618
May 22, 2006 08:17AM
2808
May 22, 2006 08:49AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.