Hello, all Some of our stored procedures contain numerous parameters and the client program is not supposed to pass all of them (some get default values). We see in SQL Anywhere debugger that the values of parameters received are not the ones in the Parameters array of the SACommand. Some parameters, which show empty (null) in the code is received as "1" for some reason. Our question: is there a way to see the actual SQL command being created by the .NET code, so we could see why the values are messed up? Thank you Arcady asked 05 Jan '22, 01:28 Arcady Abramov |
As I said, I worked around this problem by not using the StoredProcedure type command at all. So, now I got it working and, unfortunately, do not have time to create a repro. Sorry, for the trouble answered 05 Jan '22, 23:24 Arcady Abramov |
Have you checked the Results View of the Command.Parameters? The results view will enumerate the parameters of the command object.
The results view are correct, but the actual SQL is not. I worked around it by formatting the SQL string in C# code and launching the command as Text
Does a request level log (with at least SQL+HOSTVARS) show a difference in the parameter values being passed? For the following parameters to ShowSalesOrderDetail procedure,
the request log output is
The parameters will be listed below the OPEN line. For a NULL value such as in this code,
the log will show
=,H,9,,integer,<null>
Do you have a repro that shows this behavior?
Re: Our question: is there a way to see the actual SQL command being created by the .NET code
Yes, by setting the database server option "-zr sql". Use "-o logfile" to direct the output log to a file. You'll see all the SQL being sent from all clients to the server.