Re: Cannot drop a table with dynamic SQL.

From: <rhari_at_us.oracle.com>
Date: Fri, 15 May 1992 17:47:51 GMT
Message-ID: <1992May15.094751.1_at_us.oracle.com>


In article <1992May13.195741.29110_at_aut.abb.se>, asjohans_at_aut.abb.se (Anders S Johansson) writes:
> I have run into a problem which I am not able to solve, so if
> anyone has any hints please inform me.
>
> The problem is that i cannot drop a modifyed committed table with
> a dynamic SQL statement.
>
> When I run the following code this error message is presented:
> ORA-00056: DDL lock on object '18815' is already held in an incompatib
>

Well assuming that you are using the default precompiler options for HOLD_CURSOR, RELEASE_CURSOR, then you may/maynot be able to drop the table. This is because the cursor declared (implicitly) for the delete is still around and although you closed it (implicitly) it has not been reused. To make your program add the following code ......

EXEC ORACLE OPTION (RELEASE_CURSOR=YES); EXEC SQL DELETE .....
EXEC ORACLE OPTION (RELEASE_CURSOR=NO); The above code will be need for every implicitly/explicitly declared cursor that reference that table.

Hari Received on Fri May 15 1992 - 19:47:51 CEST

Original text of this message