简体   繁体   中英

wrong number or types of arguments in call to 'DROP_QUEUE_TABLE'

I am trying to drop a queue using jdbcTemplate().update method. which is -

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

DBMS_AQADM.DROP_QUEUE_TABLE takes two parameters. 1) queue_table as string and 2) force as boolean.

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.

I really wnat to know is there any way to solve this.

BOOLEAN parameters are not supported . As recomended write your own wrapper procedure with int parameter or pass a PL/SQL block with fixed TRUE parameter:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM