Thursday, May 5, 2011

Failed to execute stored procedure in different database?

Stored procedure that executes fine with a development database but fails to execute in production database? Error returned is :"PLS-00306: wrong number or types of arguments in call to <procedure naeme>"

VC++ database oracle

Closed:The error occurred due to wrong synonym.

From stackoverflow
  • This error has nothing to do with a problem in the procedure you are executing. This error has to do with the way you are calling it in one database versus another. It is the caller in DEV that is sending the right combination of parameters and parameter types. The logic that is ultimately calling the procedure in PROD is sending a different combination of parameters.

    First check the procedure specification in both databases to make sure it is REALLY the same. Look for differences in the parameters, the data types or any difference in DEFAULT NULL or the like.

    Next check the logic that is calling the actual procedure between databases. Usually it will be missing one of the parameters or the data type will be incorrect. The ordering of your parameters is also important if you are not using named notation.

    If ultimately you are sure all is the same, then it is possible that it is data related one of the parameters coming in has lack of value and your C++ drivers are not calling into the procedure the same.

    This is a solid and clear error and it is telling you there is ultimately some difference in how it is being called. Good Luck.

    yesraaj : the calling code and called sp remains same in both the database
  • You should provide more information. At least, are these 'basic' datatypes (NUMBER, DATE, VARCHAR2, etc) or do you have exotic ones (XMLTYPE, geo, user defined types ?) use SQL*Plus, connect to the schema in both databases and do a DESC Post the results so we can see them.

0 comments:

Post a Comment