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

asked 27 Oct, 08:58

Tomaz's gravatar image

Tomaz
101248
accept rate: 0%


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
permanent link

answered 27 Oct, 23:54

Chris%20Keating's gravatar image

Chris Keating
6.1k38103
accept rate: 30%

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.

permanent link

answered 28 Oct, 02:40

Volker%20Barth's gravatar image

Volker Barth
37.8k347515785
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×17

question asked: 27 Oct, 08:58

question was seen: 86 times

last updated: 28 Oct, 02:40