DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Oracle Insert trigger

  1. #1
    Join Date
    Oct 2001
    Location
    UK
    Posts
    7
    Hello,

    I am trying to use a pre_insert trigger with my oracle db:-

    create table book(
    id number,
    name varchar2(100)
    );



    CREATE OR REPLACE TRIGGER book_ins
    BEFORE INSERT ON book FOR EACH ROW
    BEGIN
    SELECT book_seq.NEXTVAL
    INTO :new.id
    from DUAL;
    END;

    Does anyone know if this is correct?

  2. #2
    Join Date
    Oct 2001
    Posts
    5
    for the script side is everything perfect..

    First time before insert into that particular table "book" table is created. next time before insert , the trigger fires to create the "book" once again.the database wont allow u to creat database object with same names..



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width