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

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

Re: Auto incrementing key

From: chani <chanakam2000_at_gmail.com>
Date: 10 Apr 2006 01:48:39 -0700
Message-ID: <1144658919.089276.258300@z34g2000cwc.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:48:39 CDT

Original text of this message

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