well, I have 10 parameters and I am passing 10 parameters. Without names being correct in SP it wont insert data into table. But it is inserting the data in to table and still going to exception in catch block and throws an exception saying overload.
Your help is much appreciated.
DB2 != SQL Server
DB2 doesn't use @ as a parameter marker, it uses ? as a positional marker or : for named markers.
But this isn't a prepared statement so just try to remove all @
Disclaimer, I'm not working with DB2 either.
Should note that the error message you're getting is not from DB2 but from VB.Net, stating that there is a mismatch in the parameters. Or rather that it can't find an overload of the procedure having the right parameters.
The reason it works is that it tries to apply the parameters in the order they've been added like as if you had used ? as a marker. Like this:
Dim cm AsNew iDB2Command("CALL DEVSUSH.SP_CUSTINFO(?,?,?,?,?,?,?,?,?,?)", Cn)
I have googled and it seems that this is a known issue - however I can find no guaranteed fix.
A person needed their name changing so the admins changed their name in AD and all seemed to go fine.
However I noticed that the SQL Server stored procedures using system_user or user are still returning the old name from AD.
There are some posts out there on google acknowledging that the SID maintains the link between AD and SQL Server however the name in SQL Server is not updated.
I am loath to bounce the server as it is used pretty much 24/7(and apparently it is not guaranteed to work).
So I am wondering if anyone else has seen this and knows how to get the name in SQL Server to pick up the new AD name(the user logs on via a group policy rather than as themselves).
See SUCCESS post below for information regarding fix.
“That which can be asserted without evidence, can be dismissed without evidence.”