mysql Trigger to replicate the ID value in another column

Asked

Viewed 26 times

-1

I’ve been around this but the value is "NULL"

create trigger tr_ReplID before insert on DuploId FOR EACH ROW set new.ID=new.Replica_ID;

What do I mean... When entering data in the Processes table ID will be the process number, later when making changes in the table with PHP form the process number that will be shown will be the Replica_id, which can be duplicated and so know whenever I am changing the intended process. In my ignorance is the way to do it ... Can you help me? Thank you

1 answer

0

Then some tests I came to the conclusion that it might not be possible to copy the ID. (at least with simple Trigger) Am I right? I did a test with a Rigger that copies and Formats the Date and works, with the NULL ID or "0".

PS: Mariadb usage on Linux

Browser other questions tagged

You are not signed in. Login or sign up in order to post.