本人有一个过程一个函数,过程中对一张表进行查询,函数调用这个过程,并对这张表进行插入操作,在后台数据库中测试没出现问题,但是在前台调用时会报查询操作中执行DML操作 (ORA-14552及ORA-14552),这个问题要如何解决?

解决方案 »

  1.   

    ORA-14552 cannot perform a DDL, commit or rollback inside a query or DML Cause: DDL operations like creation tables, views etc. and transaction control statements such as commit/rollback cannot be performed inside a query or a DML statement. Action: Ensure that the offending operation is not performed or use autonomous transactions to perform the operation within the query/DML operation.
      

  2.   

    问题解决了,和大家分享一下,我发现是我在前台调用调用时是使用 select sp_test() into :xxx from dual; 这样的语句,可能是oracle将这句话当成是查询了,后来将那个函数也改成过程,在前台调用那个过程就没有问题了!