If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Error : PLS-00103 (Help)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-08-10, 04:50
polar polar is offline
Registered User
 
Join Date: Sep 2010
Posts: 11
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"
Reply With Quote
  #2 (permalink)  
Old 09-08-10, 05:32
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
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;
/
Reply With Quote
  #3 (permalink)  
Old 09-08-10, 09:15
polar polar is offline
Registered User
 
Join Date: Sep 2010
Posts: 11
hmm... i did a mistake by combining trigger and sequence together ><!!! haha.. anyway thx for your reply.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On