Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Creating PL/SQL procedure from Java

Creating PL/SQL procedure from Java

From: Wolf <deschanel_news_at_gmx.de>
Date: 1 Aug 2002 12:20:57 -0700
Message-ID: <78ed976.0208011120.15f1cbac@posting.google.com>


Hi there,

i have to create a PL/SQL procedure from my Java code. If i execute the code by connecting via JDBC to the Oracle 8.1.7. database, all works fine:

For example,
I do a stmt.execute("CREATE OR REPLACE FUNCTION getCalcul RETURN VARCHAR2 IS calcul VARCHAR2(2000); BEGIN calcul := 'Toto'; RETURN calcul; END;");

Now i put the Java code inside the database via "loadjava" and connect with the default connection. Other SQL queries still work fine.

When i execute the creation of my PL/SQL procedure, i get the following exception:

BadExecuteException: Can't executeUpdate query-ORA-14552: DDL operation, COMMIT or ROLLBACK not allowed in an DML instruction.

What's the clue here?
Should'nt i use Statement.execute() but other things instead?

Regards,
Wolf. Received on Thu Aug 01 2002 - 14:20:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US