Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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 '21, 08:58

Tomaz's gravatar image

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,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
=,E,2,-294,Format string argument number 21 is invalid
permanent link

answered 27 Oct '21, 23:54

Chris%20Keating's gravatar image

Chris Keating
accept rate: 31%

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 '21, 02:40

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

Thanks for the information!

permanent link

answered 2 days ago

bidlyatnik's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 27 Oct '21, 08:58

question was seen: 855 times

last updated: 2 days ago