Home » SQL & PL/SQL » SQL & PL/SQL » tigger
tigger [message #208262] Fri, 08 December 2006 22:03 Go to next message
seyiisq
Messages: 125
Registered: September 2005
Senior Member
is it alright for me to execute a procedure by a trigger.

for example


1 create or replace Trigger warning
2 After insert or update of absent on attendance_warning
3 For each row
4 begin
5 execute pro_absent(student_id_in in number);
6* END;
SQL> /

Warning: Trigger created with compilation errors.

SQL> show error
Errors for TRIGGER WARNING:

LINE/COL ERROR
-------- -----------------------------------------------------------------
2/9 PLS-00103: Encountered the symbol "PRO_ABSENT" when expecting one
of the following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "PRO_ABSENT" to continue.

2/37 PLS-00103: Encountered the symbol "NUMBER" when expecting one of
the following:
(

where pro_absent(student_id_in in number) is the procedure.
Re: tigger [message #208268 is a reply to message #208262] Fri, 08 December 2006 23:34 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
EXECUTE is a SQL*Plus command. You dont' need it when you call PL/SQL procedures from within PL/SQL.

Ross Leishman
Re: tigger [message #208274 is a reply to message #208262] Sat, 09 December 2006 00:28 Go to previous messageGo to next message
dba_blr
Messages: 43
Registered: December 2006
Member
Simply put the procedure name along with the parameters. That's it...
Re: tigger [message #208358 is a reply to message #208274] Sat, 09 December 2006 17:12 Go to previous messageGo to next message
seyiisq
Messages: 125
Registered: September 2005
Senior Member
i have tried it but still having this error below


1 create or replace Trigger warning
2 After insert or update of absent on attendance_warning
3 declare
4 For each row
5 begin
6 pro_absent(:old.student_id);
7* END;
SQL> /

Warning: Trigger created with compilation errors.

SQL> show error;
Errors for TRIGGER WARNING:

LINE/COL ERROR
-------- -----------------------------------------------------------------
2/1 PLS-00103: Encountered the symbol "FOR" when expecting one of the
following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor
Re: tigger [message #208359 is a reply to message #208358] Sat, 09 December 2006 17:37 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's nothing to DECLARE.
Re: tigger [message #208428 is a reply to message #208359] Sun, 10 December 2006 19:36 Go to previous message
seyiisq
Messages: 125
Registered: September 2005
Senior Member
thanks it works
Previous Topic: pl/sql
Next Topic: snychronized role
Goto Forum:
  


Current Time: Sun Dec 11 04:33:07 CST 2016

Total time taken to generate the page: 0.06742 seconds