Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Creating PL/SQL procedure from Java
Christophe Vanfleteren <cD0Tvanfleteren_@_SpaMndora.be> wrote in message news:<yZi29.41221$8o4.5536_at_afrodite.telenet-ops.be>...
> Wolf wrote:
>
> > 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.
>
> Does setting autocommit to false on your connection work?
> Try something like conn.setAutoCommit(false) before you execute the
> statement.
Hi Christophe,
i checked the AutoCommit just before executing the statement, it is set to false. So it should be another reason.
Regards,
Wolf.
Received on Fri Aug 02 2002 - 03:00:35 CDT
![]() |
![]() |