Home » Developer & Programmer » JDeveloper, Java & XML » trigger creation via JDBC
trigger creation via JDBC [message #133082] Wed, 17 August 2005 11:17
adamato
Messages: 5
Registered: May 2005
Junior Member
Hi everybody.
I need to create a trigger via JDBC on Oracle.
This trigger contain a call procedure.
The sql statement is:

CREATE OR REPLACE TRIGGER TRIG1 BEFORE
INSERT ON T9
CALL insert_log('T9')

The code is:

String code="CREATE OR REPLACE TRIGGER TRIG1 BEFORE "+
"INSERT ON T9 "+
"CALL insert_log('T9')";
Statement stmt = null;
try
{
stmt = connection.createStatement();
stmt.execute(code);
stmt.close();
}
catch(SQLException e)
{
}


This code don't throws any exception but the trigger is invalid.
The procedure 'insert_log' is valid.
With the command 'SHOW ERRORS' I receive:

PLS-00103: Found symbol "end-of-file" instead of:
:= . ( % ;
Symbol ";" has been substituted ...

If I use a Pl/Sql Block to call the procedure like this:

BEGIN
insert_log('T9');
END;

there are no problems. The trigger results valid!

Why this error ?

Thanks
Antonio
Previous Topic: Help for Java Stored Procedure
Next Topic: Help with CLOBS
Goto Forum:
  


Current Time: Fri Apr 19 21:45:38 CDT 2024