Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Auto incrementing key

Re: Auto incrementing key

From: <chanakam2000_at_gmail.com>
Date: 10 Apr 2006 01:45:58 -0700
Message-ID: <1144658758.194149.16390@i40g2000cwc.googlegroups.com>


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:45:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US