Getting wrong number or types of arguments in call to exception while executing stored procedure

Sanjay

I have created below stored procedure in oracle.

CREATE OR REPLACE PROCEDURE "UPDATE_ASSET_LOB_PROC"(
asset_id IN integer,
distribution_id_list IN distribution_id)

IS
CURSOR dist_id
IS
select adt.lkp_dist_type from Asset_Dist_Type adt where adt.asset_id= asset_id;

BEGIN

  delete  from Asset_Dist_Type where asset_id= asset_id;
  commit;
  for i IN dist_id 
  LOOP
  insert into Asset_Dist_Type values (asset_id_list,i.lkp_dist_type);
  commit;
  END LOOP;

END UPDATE_ASSET_LOB_PROC;

distribution_is a custom type. I have created it as

`CREATE TYPE distribution_id AS TABLE OF NUMBER;`

My java code is as follows.

Integer[] idArray = new Integer[selectedDistributionTypes.size()]; 
        idArray = selectedDistributionTypes.toArray(idArray); 

    entityManager.createNativeQuery("CALL UPDATE_ASSET_LOB_PROC (:assetIdParam,:distributionIdParam)")
                    .setParameter("assetIdParam", assetId).setParameter("distributionIdParam", idArray).executeUpdate();

I am getting

`Caused by: java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call to 'UPDATE_ASSET_LOB_PROC'`.

What is the wrong thing here? I guess it is with stored procedure. But I am not much into writing stored procedure. OR is it feasible to pass a comma separated list and split it in stored procedure?

Sanjay

Got solution to this problem. I removed the created custom type "distribution id" and made distribution_id_list as varchar2. From bean, I sent a comma separated list and in stored procedure, removed the comma's looping over it as below.

SELECT REGEXP_SUBSTR (distribution_id_list, '[^,]+', 1,LEVEL) dist_id
                             FROM DUAL
                             CONNECT BY REGEXP_SUBSTR (distribution_id_list, '[^,]+', 1, LEVEL) IS NOT NULL

Inside a for loop I can use dist_id to whatever the operation I want.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Call Oracle Stored Procedure with Char Out Parameter errors with PLS-00306: wrong number or types of arguments in call

From Dev

Oracle Stored Procedure PLS-00306: wrong number or types of arguments

From Dev

Wrong number or types of arguments error while calling procedure

From Dev

Oracle procedure call results in "PLS-00306: wrong number or types of arguments in call"

From Dev

Exception while executing stored procedure odp.net

From Dev

Getting error "Incorrect syntax near '-' " while executing Stored Procedure

From Dev

Error while executing stored procedure

From Dev

Oracle Procedure - PLS-00306: wrong number or types of arguments

From Dev

nPLS-00306: wrong number or types of arguments in call

From Dev

Wrong number or types of arguments in call to even after correct parameters

From Dev

PHP Apache crashes while executing a STORED PROCEDURE

From Dev

Python - Wrong number of arguments exception?

From Dev

Getting Error While Defining Stored Procedure MySQL

From Dev

passing PHP array to Oracle Stored Proc (PLS-00306: wrong number or types of arguments)

From Dev

No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

From Dev

No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

From Dev

SQL Exception when executing stored procedure from within Biztalk

From Dev

Executing Sql Server Stored Procedure and getting OUTPUT INSERTED value

From Dev

Executing Sql Server Stored Procedure and getting OUTPUT INSERTED value

From Dev

Show the declared variable value while executing stored procedure

From Dev

Error converting data type nvarchar to int - while executing stored procedure

From Dev

Error While Executing my Stored Procedure in Windows Form

From Dev

While Executing Stored Procedure in MySQL Amazon RDS Show Access Denied

From Dev

N''' prefix is added by default while executing Stored Procedure

From Dev

SQL Server data not being shown while executing with stored procedure

From Dev

PL/SQL: Error "PLS-00306: wrong number or types of arguments in call to" triggered for table of numbers

From Dev

PLS-00306: wrong number or types of arguments in call to 'OUTPUT_ARRAY'

From Dev

PLS-00306: wrong number or types of arguments in call to 'CREATE_PROGRAM'

From Dev

PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

Related Related

  1. 1

    Call Oracle Stored Procedure with Char Out Parameter errors with PLS-00306: wrong number or types of arguments in call

  2. 2

    Oracle Stored Procedure PLS-00306: wrong number or types of arguments

  3. 3

    Wrong number or types of arguments error while calling procedure

  4. 4

    Oracle procedure call results in "PLS-00306: wrong number or types of arguments in call"

  5. 5

    Exception while executing stored procedure odp.net

  6. 6

    Getting error "Incorrect syntax near '-' " while executing Stored Procedure

  7. 7

    Error while executing stored procedure

  8. 8

    Oracle Procedure - PLS-00306: wrong number or types of arguments

  9. 9

    nPLS-00306: wrong number or types of arguments in call

  10. 10

    Wrong number or types of arguments in call to even after correct parameters

  11. 11

    PHP Apache crashes while executing a STORED PROCEDURE

  12. 12

    Python - Wrong number of arguments exception?

  13. 13

    Getting Error While Defining Stored Procedure MySQL

  14. 14

    passing PHP array to Oracle Stored Proc (PLS-00306: wrong number or types of arguments)

  15. 15

    No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

  16. 16

    No luck getting most recent entry in sub-select: ORA-00904: invalid identifier, and ORA-06553: wrong number or types of arguments in call

  17. 17

    SQL Exception when executing stored procedure from within Biztalk

  18. 18

    Executing Sql Server Stored Procedure and getting OUTPUT INSERTED value

  19. 19

    Executing Sql Server Stored Procedure and getting OUTPUT INSERTED value

  20. 20

    Show the declared variable value while executing stored procedure

  21. 21

    Error converting data type nvarchar to int - while executing stored procedure

  22. 22

    Error While Executing my Stored Procedure in Windows Form

  23. 23

    While Executing Stored Procedure in MySQL Amazon RDS Show Access Denied

  24. 24

    N''' prefix is added by default while executing Stored Procedure

  25. 25

    SQL Server data not being shown while executing with stored procedure

  26. 26

    PL/SQL: Error "PLS-00306: wrong number or types of arguments in call to" triggered for table of numbers

  27. 27

    PLS-00306: wrong number or types of arguments in call to 'OUTPUT_ARRAY'

  28. 28

    PLS-00306: wrong number or types of arguments in call to 'CREATE_PROGRAM'

  29. 29

    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

HotTag

Archive