13

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

Cause: This error occurs when the named subprogram call cannot be matched to any declaration for that subprogram name. The subprogram name might be misspelled, a parameter might have the wrong datatype, the declaration might be faulty, or the declaration might be placed incorrectly in the block structure. For example, this error occurs if the built-in square root function SQRT is called with a misspelled name or with a parameter of the wrong datatype.

Action: Check the spelling and declaration of the subprogram name. Also confirm that its call is correct, its parameters are of the right datatype, and, if it is not a built-in function, that its declaration is placed correctly in the block structure.

How do I quickly identify the wrong argument?

I have a stored-procedure with dozens of parameters. Is there an easy way to check the differences between the used and defined procedure? I don't want to check it line by line..

Stephan Schielke
  • 233
  • 1
  • 2
  • 6

1 Answers1

12

No, there's really no shortcuts here. Examine things in the following order:

  1. Check the procedure name.
  2. Check the number of parameters.
  3. Check the types of the parameters.
  4. Check the parameter names.
Leigh Riffel
  • 23,534
  • 16
  • 75
  • 147
  • 4
    Also check the parameter names if calling them by name. That just caught me out. – swref Jan 30 '17 at 15:28
  • checking the name of parameters is the key for me, thanks. – Arpit Aggarwal Jan 29 '19 at 05:19
  • It could be the Object type – Arthur Sep 18 '19 at 14:44
  • I spent about 4 hours debugging this error today. In my case it was because the return value parameter wasn't first. So make sure that one is added first before the others. (Even though I was using named parameters, it still needed to be first) – CovertIII Jan 26 '22 at 22:48