简体   繁体   English

调用“ DROP_QUEUE_TABLE”时参数的数量或类型错误

[英]wrong number or types of arguments in call to 'DROP_QUEUE_TABLE'

I am trying to drop a queue using jdbcTemplate().update method. 我正在尝试使用jdbcTemplate()。update方法删除队列。 which is - 这是-

getJdbcTemplate().update("call DBMS_AQADM.DROP_QUEUE_TABLE (?, ?)", qTableName.toUpperCase(),true);

DBMS_AQADM.DROP_QUEUE_TABLE takes two parameters. DBMS_AQADM.DROP_QUEUE_TABLE采用两个参数。 1) queue_table as string and 2) force as boolean. 1)queue_table作为字符串,2)强制为布尔值。

whn I try to run the above code, I am getting - 当我尝试运行上面的代码时,我得到-

PreparedStatementCallback; bad SQL grammar [call DBMS_AQADM.DROP_QUEUE_TABLE (?, ?)]; nested exception is java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call to 'DROP_QUEUE_TABLE'
ORA-06553: PLS-306: wrong number or types of arguments in call to 'DROP_QUEUE_TABLE'

but when I am running the following code it works fine- 但是当我运行以下代码时,它可以正常工作-

getJdbcTemplate().update("call DBMS_AQADM.CREATE_QUEUE_TABLE (?, ?)", qTableName.toUpperCase(), payloadType.toUpperCase());

What I am guessing is, the problem is passing oracle objects (which are not varchar or int) as parameters. 我猜的是,问题是将oracle对象(不是varchar或int)作为参数传递。

I really wnat to know is there any way to solve this. 我真的很想知道有没有办法解决这个问题。

BOOLEAN parameters are not supported . 不支持 BOOLEAN参数。 As recomended write your own wrapper procedure with int parameter or pass a PL/SQL block with fixed TRUE parameter: 推荐使用int参数编写您自己的包装过程,或传递具有固定TRUE参数的PL / SQL块:

BEGIN
   DBMS_AQADM.DROP_QUEUE_TABLE( 
      queue_table        => ?, 
      force              => TRUE); 
END;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MyBatis Oracle呼叫PLS-00306:呼叫错误的参数数量或类型错误 - MyBatis Oracle Call PLS-00306: wrong number or types of arguments in call Error PLS-00306:Java中对GET_NEW_EVENTS的调用中参数的数量或类型错误 - PLS-00306: wrong number or types of arguments in call to GET_NEW_EVENTS in Java ORA-06550:第1行,第7列:PLS-00306:错误的数量或调用中的参数类型 - ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call 使用@Query 调用存储过程会导致异常:调用 ProcedureName 时的参数数量或类型错误 - Calling stored procedure with @Query results in Exception: wrong number or types of arguments in call to ProcedureName 执行存储过程时,在调用异常时获取错误的数量或参数类型 - Getting wrong number or types of arguments in call to exception while executing stored procedure 当 Hibernate 看起来正确时,为什么我会收到 PLS-00306“调用中的 arguments 的数量或类型错误”? - Why am I getting PLS-00306 “wrong number or types of arguments in call” when the Hibernate looks correct? EclipseLink:调用存储过程的参数数目或类型错误 - EclipseLink: Wrong number or types of arguments calling a Stored Procedure IllegalArgumentException:参数数量错误 - IllegalArgumentException: wrong number of arguments 龙目岛Arguments号码错误 - Wrong number of Arguments with Lombok 引起:java.sql.SQLException:ORA-06550:第 1 行,第 7 列:PLS-00306:ZDBC11CAA5BDA99F77E6FB4DABD_SPE_FA 7 调用中的 ZDBC11CAA5BDA99F77E6FB4DABD8SPE_7 的错误编号或类型 - Caused by: java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'PR_SP_FAHMI'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM