Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Creating a trigger that calls a stored procedure
"Elie" <higuey77_at_yahoo.com> wrote in message
news:4cea796.0212221931.96143b8_at_posting.google.com...
> Hi,
>
> Using JAVA (JDBC), I'm trying to create a trigger that calls a stored
> procedure. However there seems to be something wrong with my syntax
> because when I go to the database and check the status of the trigger
> it's invalid and as a result I am unable to call it. The stored
> procedure that the trigger is trying to call is valid and exist in the
> db.
>
>
> Stored Procedure Code (which I believe is correct)is listed below.
>
> String proc= "CREATE OR REPLACE PROCEDURE stored_proc
> (parameter1 IN NUMBER, parameter2 IN NUMBER)
> AS LANGUAGE JAVA NAME 'myClass.method_one(java.lang.Integer,
> java.lang.Double)';";
>
> Trigger Code is listed below
>
> String trig= "CREATE OR REPLACE TRIGGER myTrigg
> AFTER INSERT ON student_billings
> FOR EACH ROW
> BEGIN
> call stored_proc(:new.parameter1, :new.parameter2);
> END;";
>
> Does anyone notice something wrong.
>
> Thanks in Advance
Maybe someone was trying to use the trigger when you attempted to change it
out from under them. Oracle could not replace the trigger when someone was
using it. These kinds of "tricks" will work fine when you're testing it, but
will fail as soon as you put it in a system that's shared by multiple
people.
Received on Mon Dec 23 2002 - 09:37:36 CST