Re: ORA-14551 when using select for update inside a java stored procedure

From: Vasileios Lourdas <Vasileios.Lourdas_at_eurodyn.com>
Date: Tue, 01 Apr 2003 10:58:26 +0300
Message-ID: <3E8946A2.EC8494F_at_eurodyn.com>


Hi.

OK, i found the solution. I now realize what i was doing wrong. The java stored procedure was a static class function that returned an integer. So, i created a PL/SQL function that returned the return result from the jsp. The problem was that i was calling the PL/SQL function the wrong way. I used a select clause, but instead i should have used the call SQL*Plus command. Using the select clause, Oracle threw this exception (ORA-14551). Thanks!

bung ho wrote:
>
> Vasileios Lourdas <Vasileios.Lourdas_at_eurodyn.com> wrote in message news:<3E8469BF.72666276_at_eurodyn.com>...
> > Hi.
> >
> > I have written a Java stored procedure in Oracle 8.1.6.1.0 Enterprise
> > where i try to update a BLOB column. Oracle's documentation clearly
> > states that prior to updating a LOB field, you must first get an
> > exclusive lock for the row, using the select for update statement.
> > Inside SQL*Plus, the statement of course works fine, but when executing
> > the PL/SQL procedure that calls the JSP i get an ORA-14551 error. The
> > code i use for locking the row is:
> > ...
> > Connection dbConn =
> > DriverManager.getConnection("jdbc:default:connection:");
> > dbConn.setAutoCommit(false);
> > String lockStatement = "SELECT * FROM " + tableName + " WHERE ROWSEQNO="
> > + String.valueOf(rowSequence) + " FOR UPDATE";
> > OracleCallableStatement stmt =
> > (OracleCallableStatement)dbConn.prepareCall(lockStatement);
> > stmt.execute();
> > ...
> > I have tried this using either an OracleStatement object or any object i
> > could think of and i always get the same error.
> >
> > How can i solve this issue? Could it be a 8.1.6 bug?
> >
> > Regards,
> > Vasilis
>
> what is the code that calls this stored procedure? and what is the
> full text of the CREATE PROCEDURE statement?
Received on Tue Apr 01 2003 - 09:58:26 CEST

Original text of this message