0
votes

I am getting this error

Compilation failed, line 2 (11:52:47) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.

PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge json_exists json_value json_query json_object json_array

Code:

create or replace trigger "GDS_CLIENT_T1"

BEFORE 

insert or update or delete on GDS_CLIENT

for each row

begin

create or replace trigger "client insert"

before
insert on "Identify Client"

for each row

begin

select nv1(max(id),0)+1 into :NEW_ID FROM IDENTIFY CLIENT

end;
1
You are creating a trigger within another trigger; it seems unlikely you wanted to do that, so it looks like you were trying to create two triggers and you've missed out the body of the first. I'd also suggest you avoid creating objects with quoted identifiers; and use a sequence or identity column for your ID.Alex Poole

1 Answers

0
votes

CREATE OR REPLACE TRIGGER is a DDL command that requires a full specification of the trigger to create; in your case, your first command has not ended:

create or replace trigger "GDS_CLIENT_T1"
BEFORE 
insert or update or delete on GDS_CLIENT
for each row
begin

At this point it is expected that you will finish the definition of the GDS_CLIENT_T1 trigger; but instead, you have create or replace trigger which is not valid PL/SQL.