Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Posts
    11

    Unanswered: Error : PLS-00103 (Help)

    CREATE OR REPLACE TRIGGER "DNRS2"."TRG_BI_TBL_DOMAIN_PERFORMANCE"
    BEFORE INSERT
    ON tbl_domain_performance
    FOR EACH ROW
    DECLARE
    last_Sequence NUMBER;
    last_InsertID NUMBER;
    BEGIN
    IF (:NEW.id IS NULL) THEN
    SELECT seq_tbl_domain_performance.NEXTVAL INTO :NEW.id FROM DUAL;
    ELSE
    SELECT NVL(Last_Number, 0) INTO last_Sequence
    FROM User_Sequences
    WHERE UPPER(Sequence_Name) = UPPER('seq_tbl_domain_performance');
    SELECT :NEW.id INTO last_InsertID FROM DUAL;
    WHILE (last_InsertID > last_Sequence) LOOP
    SELECT seq_tbl_domain_performance.NEXTVAL INTO last_Sequence FROM DUAL;
    END LOOP;
    END IF;
    END;

    CREATE SEQUENCE "SEQ_TBL_DOMAIN_PERFORMANCE" MINVALUE 1 MAXVALUE 9999999999999999999999999999;


    caused:
    Error(23,1): PLS-00103: Encountered the symbol "CREATE"

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Are these CREATE statements part of the same file?

    If so, first create a sequence. Then create a trigger and put a slash (/) sign to terminate it. . Something like
    Code:
    create sequence SEQ_TBL_DOMAIN_PERFORMANCE;
    
    create trigger TRG_BI_TBL_DOMAIN_PERFORMANCE
      <trigger code here>
    end;
    /

  3. #3
    Join Date
    Sep 2010
    Posts
    11
    hmm... i did a mistake by combining trigger and sequence together ><!!! haha.. anyway thx for your reply.

Posting Permissions

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