I am running into an issue with the debugger in SQL Anywhere 12 Build 3840.
We have created a stored procedure that gets called on connection to the database. Now back in the ASA6 days, we didn't have events, so we created a procedure called pa.prloginenvironment. PA being our public user with dba privileges that is used to create all objects in the database. We then set the login procedure option to pa.prloginenvironment. For the record, pa.prloginenvironment calls the "sp login environment" procedure, so we're handling that as well.
We're running into an error in this procedure, so I'm wanting to put some stops into the procedure and watch it in the debugger.
I turn the debugger option on, and select that I want to debug all users.
I literally have about 12 stops set up in the procedure. Including one at the very first line after the begin statement. It's a create variable command that creates a connection level variable that is used throughout that databases connection.
I know the procedure is being called on connection, because there are some messages that we are sending to the console. These are getting generated. But these messages that are getting sent to the console are after the breakpoints.
Anybody have any thoughts on why the procedure wouldn't stop at these breakpoints?
Any ideas would be greatly appreciated.
asked 29 Jan '14, 17:01
I don't believe that you can use the SP debugger to debug a login procedure directly... because the debugger itself doesn't setup its debugging hooks until after the login procedure has completed. I.e. until after the connection has successfully been created (and to be 'successful' the login procedure must complete without generating an exeception).
To debug your pa.prloginenvironment procedure you will need to call it explicitly after you have logged into the database.
answered 29 Jan '14, 17:22