I have a stored procedure that has an OUT parameter of type SYS_REFCUROR. From C# before executing the procedure I add all the parameters except for that OUT parameter. But when I execute the procedure I get “wrong number or types of arguments ” error. My question is if I’m not going to assign any value to that parameter why do I have to add it to my parameters collection?
Share
You need to add out the parameter because after execution of the stored procedure, the value of out parameter of sql is stored in this out parameter you supplied in your code, which you can use later on in your further execution.
If you want to omit passing out the parameter, then assign a default value to the output parameter, that will resolve your issue.
For example :
If you do as above, then you don’t need to pass the output parameter by code, and it will hide the error you are getting.