Reputation: 11
I am trying to execute an already-defined stored procedure inside a trigger. When I tried to execute the below mentioned piece of code I am getting this error :
ERROR line 22, col 9, ending_line 22, ending_col 22, Found 'pat_lines_proc',
Expecting: ; -or- := -or- . -or- ( -or- @ -or- ROW
This is how I am calling the procedure inside the trigger and getting the above mentioned error:
create or replace trigger pat_lines_trig
after insert on pat_headers_all
for each row
begin
call pat_lines_proc (&p_lineno,&p_diseasename,&p_PAT_HEADERS_ID);
end;
/
This is how I have defined that procedure and this piece of code worked fine:
Create or Replace procedure pat_lines_proc(
p_lineno in pat_lines.LINE_NO%type,
p_diseasename in pat_lines.DISEASE_NAME%type,
p_pat_headers_id in pat_lines.PAT_HEADERS_ID%type
)
is
begin
insert into pat_lines
values(
pat_lines_seq.nextval,
p_lineno,
p_diseasename,
p_pat_headers_id
);
end pat_lines_proc;
What seems to be wrong here?
Upvotes: 1
Views: 155
Reputation: 14731
I have assumed column names so substitute correct column names when passing values to procedure, try creating your trigger as
CREATE OR REPLACE TRIGGER pat_lines_trig
AFTER INSERT
ON pat_headers_all
FOR EACH ROW
BEGIN
pat_lines_proc (:new.p_lineno, :new.p_diseasename, :new.p_PAT_HEADERS_ID);
END;
/
Upvotes: 1