Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Auto incrementing key
Thank you Very much everyone who helpled me.
I could do my requirement with following trigger
CREATE OR REPLACE TRIGGER STUDENTID_T
BEFORE INSERT
ON student
FOR EACH ROW
BEGIN
IF (:NEW.student_id IS NULL) THEN
SELECT CONCAT('s-',LPAD(CAST(id.NEXTVAL as char),8,'0')) INTO :NEW.student_Id FROM DUAL;
END IF;
END
But one more silly question. Can anyone tell me what is the meaning of
'from DUAL'
I used it without knowing. But like to know the meaning of it.
Thank you Received on Mon Apr 10 2006 - 03:48:39 CDT
![]() |
![]() |