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.

I want to be able to give admin users a warning when errors that might not otherwise be see (eg errors generated by events) are logged. I thought about filtering the server messages for errors.

When server messages are written to a log file, they are nicely categorised with a message type indicator at the beginning of the line:

E. 01/25 05:00:49. Handler for event 'iqx_updateLapsed' caused SQLSTATE '23W01'

E. 01/25 05:00:49. Primary key for table 'contactevent' is not unique : Primary key value (''MG49000525012014004A'')

E. 01/26 05:00:46. Handler for event 'iqx_updateLapsed' caused SQLSTATE '23W01'

E. 01/26 05:00:46. Primary key for table 'contactevent' is not unique : Primary key value (''MG460005260120140068'')

I. 01/26 05:56:37. Starting checkpoint of "IQX" (pears.db) at Sun Jan 26 2014 05:56

I. 01/26 05:56:46. Finished checkpoint of "IQX" (pears.db) at Sun Jan 26 2014 05:56

However that indicator isn't present when server messages are retrieved using the property('Message',n) or property('MessageText',n) functions. The exact text used to indicate the error is hard to predict and it is particularly difficult to get the additional information (eg the second line in the messages above). Is there, or could there be, a way of retrieving the indicator as well?

I could grep the output file - but that does seem a bit of a round about way of doing it!

asked 28 Jan '14, 09:02

Justin%20Willey's gravatar image

Justin Willey
accept rate: 20%

edited 28 Jan '14, 09:03

Take a look at the sa_server_messages system procedure - it contains all of the information that you need including message severity (INFO, WARN, ERR)

permanent link

answered 28 Jan '14, 09:09

Mark%20Culp's gravatar image

Mark Culp
accept rate: 41%

perfect - thank you! (I was used to the old get_server_messages function)

select msg_time, msg_text from sa_server_messages(0,1000000) where msg_severity = 'ERR' order by msg_id desc

(28 Jan '14, 09:25) Justin Willey
Replies hidden

FWIW: Here's another link on that topic:

How to replace the server property "Message" and the like?

(28 Jan '14, 09:36) Volker Barth
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: 28 Jan '14, 09:02

question was seen: 2,162 times

last updated: 28 Jan '14, 09:36