on 2021 Oct 27 9:58 AM
Hello all! sqlany 17 I have some procedures in database that cause ERROR: Error constant SQLE_INVALID_FORMAT_STRING_ARG_NUM ODBC 2 state 37000 ODBC 3 state 42000 Parameter 1 Argument number. Severity 16 SQLCODE -294 SQLSTATE 53W08 Sybase error code 2749
I would like to find what cause this error, so I translated log file . But I see in log file that there is no raiserror statements, all I see is ROLLBACK WORK. Is there any option to see this in database log or somewhere else? Regards Tomaz
Request clarification before answering.
Note that this error can be reported with TSQL PRINT also.
You can use request level logging for this. If you are sure that the error is coming from a procedure, you can set request level logging to PROCEDURES. For example, you can do so either at the command line or via SQL. Here is how to enable logging in SQL
call sa_server_option( 'RequestLogging', 'PROCEDURES' ); call sa_server_option( 'RequestLogFile', 'requests.rll' );
Here is how to disabled once you have identified the problem procedures. call sa_server_option( 'RequestLogging', 'No' ); call sa_server_option( 'RequestLogFile', '' );
Here is example output showing the procedure name and the statement that is causing the error to be reported.
=,<,2,PREPARE,call "foo"() =,>,2,PREPARE,327872 +1,<,2,EXEC,327872 =,[,2,foo,3,raiserror 17001 '%1! %2! %3! %4! %5! %6! %7! %8! %9! %10! %11! %12! %13! %14! %15! %16! %17! %18! %19! %20! %21! %22!',1,2,3,4,5,6,7,8,9,10,11,12,14,14,15,16,17,18,19.2,21,22 =,],2,foo,3 =,E,2,-294,Format string argument number 21 is invalid =,>,2,EXEC +2004,<,2,DROP_STMT,327872
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my understanding, an invalid statement cannot be executed, and as such won't be contained in the transaction log, so you won't be able to find it there...
In addition to Chris's suggestion to diagnose the issue, you might also add error logging to your stored procedures by writing to the console log (dbsrvX -o).
For a sample, see Mark's answer here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.