Hello,
Every time I modify a row, I'd like to copy the contents of the SONG_FULL_NAME column to the SONG_PDF column, replacing the spaces with underscores.
I had a trigger to capture the user's name and modified date, and I figured that I would just enhance that existing trigger, but I can't seem to make it work.
I'm using Oracle XE 11.2
create or replace
TRIGGER "SOME_SCHEMA"."BU_SONG_LISTING"
BEFORE UPDATE ON SONG_LISTING
FOR EACH ROW
DECLARE
v_username varchar2(512);
BEGIN
:new.MODIFIED_DATE := SYSDATE;
-- Find username of person performing INSERT into table
SELECT user INTO v_username
FROM dual;
:new.MODIFIED_BY := v_username;
:new.SONG_PDF := replace(:new.SONG_FULL_NAME, ‘ ‘, ‘_’);
END;
The goal is to always replace SONG_PDF with the data from SONG_FULL_NAME, but replacing the spaces with underscores.
Thanks for looking at this.