How can i reference a collumn of my table on Before Delete Trigger of this table?
Thanks
Printable View
How can i reference a collumn of my table on Before Delete Trigger of this table?
Thanks
You can't delete column without deletting a row.
You may update it only.
CREATE OR REPLACE TRIGGER TRG1
before update OF "WORK_EMAIL2" ON "MEMBER_TBL"
REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
begin
...
... :old.work_email2 ...
... :new.work_email2 ...
end;
CREATE OR REPLACE TRIGGER TRG1
before delete ON "MEMBER_TBL"
REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
begin
...
... :old.work_email2 ...
end;
Quote:
Originally posted by margraf
How can i reference a collumn of my table on Before Delete Trigger of this table?
Thanks
No, i don't want delete just a collumn. I want to delete a row from another table but i have to reference a collumn for this table.
For Ex:
Delete from another_table where collumn_another_table =
collumn_table_of_trigger;
How can i reference the collumn?
Thanks.......
Sorry, I don't know, but Why would you want to do that, the reference between the tables is not variable, it is not based on what column is modified, the reference existed before, so the trigger must be fixed.
2 cents
Hey, I am sure you are talking about trigger on view !!!
First of all you have to create view as
select t1.*,t2* from t1,t2
and then create 'INSTEAD OF TRIGGER' on view for the column are you interesting in.
Best wishes!
Quote:
Originally posted by margraf
No, i don't want delete just a collumn. I want to delete a row from another table but i have to reference a collumn for this table.
For Ex:
Delete from another_table where collumn_another_table =
collumn_table_of_trigger;
How can i reference the collumn?
Thanks.......
I didn't understand, can you explain?
I want to do delete cascade without use this clause, I want to create a trigger for this...... Because sometimes I have values in the second table that no appear in the first table..
O'k if you would like to delete cascade you may not use a trigger at all:
Do like that:
ALTER TABLE address_reminder_tbl
ADD ( FOREIGN KEY (rem_id)
REFERENCES reminder_calendar_tbl on delete cascade) ;
And when you delete from the parent table all records will be deleted from the doughters tables.
Quote:
Originally posted by margraf
I didn't understand, can you explain?
I want to do delete cascade without use this clause, I want to create a trigger for this...... Because sometimes I have values in the second table that no appear in the first table..
Well, just do it, Have you tried and you've got an error message?
I don't try, I am using that!
Quote:
Originally posted by rcaballe
Well, just do it, Have you tried and you've got an error message?
JE JE, my post was for Margraf. See you