I have write a trigger that insert a Sequence next value number into a table column.But Now i want to Concatenate current Date + Sequence and save that result as a number into that column.
Sample :new.MED_RECORDNO (Number) = Date(YYYYMMDD) + Sequence(nextval)
:new.MED_RECORDNO = 20160120 + 75 = 2016012075 (Number)
How i can do this.Please help me on this.thanks
Here is the code:
create or replace TRIGGER MED_RECORDNO_TRIGGER
BEFORE INSERT ON TBL_MEDICAL_CENTER_BILLS
FOR EACH ROW
BEGIN
:new.MED_RECORDNO := to_number(to_char(sysdate, 'yyyymmdd')) + MED_RECORDNO_seq.nextval;
END;