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.

We use sa_validate() within system events to validate the database. As such, the procedure's return value is checked for successful runs.

The v12.0.1 doc does state the following:

The procedure returns a single column named Messages. Errors returned during validation appear in the column. If validation succeeds without error, the column contains No error detected.

Well, that's only correct when the SA system language is set to EN.

For German setups, the message is "Keine Fehler gefunden" (and in earlier versions it was "Kein Fehler gefunden"). So, as we are usually running "DBLANG DE", the event code checks for the German message to know whether the validation has succeeded.

You bet I was puzzled when a database on a test system claimed to fail validation - simply as I had run an English version here, and "No errors detected" didn't fit "Keine Fehler gefunden".


Suggestion: Please add a second column to sa_validate()'s result set with a numeric return code (a SQLCODE or something similar to the "software component exit codes") that allows a language-agnostic return value check. Say, if the result set would contain something like "error_code = 0" for successful runs, the check would be much easier.

I do not know whether the result set may contain several rows in case there are several validation errors (i.e. a separate entry for each message about an invalid page/whatever) - however, that would still allow each entry to have its own error code.

asked 24 Jan '13, 05:16

Volker%20Barth's gravatar image

Volker Barth
40.2k361549822
accept rate: 34%

edited 24 Jan '13, 05:28


This request seems reasonable, and I'm a bit surprised that this issue was not addressed in the initial design (but that was too many years ago to know why it was not handled). I've added this to our list of items to be consider for some future release.

Thanks for making the suggestion.

permanent link

answered 07 Feb '13, 11:31

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297
accept rate: 41%

1

A very late addition: This was changed with version 17, sa_validate() now also returns the bit column "IsValid" (set to 1 for a successful validation) and the column "ObjectName" to name the object that could not be validated. Thanks!

(12 Oct '23, 05:19) 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

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:

×113
×30
×11

question asked: 24 Jan '13, 05:16

question was seen: 2,203 times

last updated: 12 Oct '23, 05:19