cancel
Showing results for 
Search instead for 
Did you mean: 

IQ 16 - How can I debug a stored procedure step by step?

stefano_bolli
Explorer
0 Kudos

Hi all,

    how can I debug a stored procedure step by step in SAP IQ 16.0 SP 08?

Best regards,

Stefano

Accepted Solutions (0)

Answers (1)

Answers (1)

jong-kil_park
Employee
Employee
0 Kudos

Hi,

How about using a MESSAGE statement in the middle of the procedure ?

For example,

begin

        declare @sid_l int ;

        select @sid_l = 10 ;

        insert jerry(sid)  values(@sid_l) ;

        commit ;

        select sid into @sid_l from jerry where rowid(jerry) = 1 ;

        message ' SELECTED' ,@sid_l type info to LOG ;

        insert jerry(sid) values(@sid_l) ;

        commit ;

end

You can change the destination of the message.

And, you can also put it anywhere you want to check values of some variables in a procedure.

Please refer to a manual page below for details about the MESSAGE statement.

MESSAGE Statement - Reference: Statements and Options - SAP Library

Best regards,

Jerry

stefano_bolli
Explorer
0 Kudos

Hi,

      I am already using "MESSAGE" as a workaround to step-by-step debug.

What I am looking for is a debug mode in order to execute step-by-step, step-into a generic SP without changing it with PRINT or MESSAGE statements.

I hope it is available in IQ 16 like in previous IQ 12 version throught Sybase Central which are actually no more available.

Do you have any idea?

Thank you,

Stefano

jong-kil_park
Employee
Employee
0 Kudos

Hi Stefano,

As you may know, Sybase Central has been replaced with SCC and COCKPIT since IQ 15.x.

You may execute a procedure and see the its results from COCKPIT.

Unfortunately, I can't see any further feature for debugging a procedure there.

Best regards,

Jerry

Former Member
0 Kudos

and Stefano,

I'm trying to catch an exception in my Java application, which is being thrown from my stored procedure.

I was expecting to get the message I wrote in the "MESSAGE" statement. But I'm getting:


SQL Anywhere Error -156: Invalid expression near 'CUSTOM_EXCEPTION'

com.sybase.jdbc4.jdbc.SybSQLException: SQL Anywhere Error -156: Invalid expression near 'CUSTOM_EXCEPTION'



Inside the procedure I have the following message statement:

MESSAGE 'Error in procedure: ', SQLSTATE, 'SCI.NameProcedure' to client;

            SIGNAL CUSTOM_EXCEPTION;   

what should I do to get the "Error in procedure:" on the java try/catch?

Thanks in advance,

Vinícius.