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

I am consuming external webservices from SQL Anywhere 17 Database, and in order to trace the calls I activate the log file using the following commands:

CALL sa_server_option( 'WebClientLogFile', 'c:\temp\ClientLog.txt' );

CALL sa_server_option( 'WebClientLogging', 'ON' );

The problem is that these commands have volatile effect, so once I restart the database I should issue the commands again in order to activate the logging.

Is it possible to set the WebClientLogFile and put it on 'ON' permanently?

asked 09 Apr '20, 18:00

Baron's gravatar image

accept rate: 48%

edited 09 Apr '20, 18:01

This option can be set via the command line for the server. It is set via the LogFile(LOG) protocol option.

permanent link

answered 09 Apr '20, 21:37

Chris%20Keating's gravatar image

Chris Keating
accept rate: 31%

and is it then permanent? Do I need also to 'ON' it?

(10 Apr '20, 02:49) Baron

Chris names the option to log the requests the SQL Anywhere Webserver receives and answers, when acting as a web server.

I guess you want to log the requests it sends and receives as a web client. For that use the -zoc option.

permanent link

answered 10 Apr '20, 07:28

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

edited 10 Apr '20, 08:06

Yes, I my SQL-Anywhere 17 Database is consuming webservices, so is acting as web client.

The -zoc option is good, because the DB is starting with this option and so the option stays active as long as the DB is still running (over this server), but if shut down the server and start it without this option then it is not anymore active.

Is there a way to set this option permanently in the DB?


Is it possible to use the -zoc option in ODBC-Settings? Knowing that I am configuring the odbc under start and connect a database on this computer! Writing the -zoc option in start line for example didn't help!

(10 Apr '20, 14:10) Baron
Replies hidden

Frankly, I don't get your point:

  • With the command line option -zoc you can enforce logging all the time the database server runs.
  • With sa_server_option('WebClientLogging'), you can turn it on or off on a running server.
  • With sa_server_option('SecureFeatures') you can influence whether the according feature can be modified.

Of course if you sometimes start the database server with and sometimes without the command line option, behaviour is different, but that goes for all command line options... And I guess for a production system, you usually build the "correct command line" once and then use that unless something has to be changed (and probably usually have it run as a service so nobody even "sees" a command line).

I guess if you cannot prevent the command line from being modified by others and you want to make sure the option is always set when a particular database is running then you could use a DatabaseStart event to enable the sa_server_option('WebClientLogging') option and use the SecureFeatures facility to prevent others from disabling the feature - although even that may be difficult when you cannot control the command line...

(13 Apr '20, 15:07) Volker Barth

Sorry for the confusing, I will explain our exact situation.

So we have the same database in several installations (used by several tens of clients), and the installation settings vary among clients, so some clients start the Database as Windows Service (using DBSVC + DBSRVx), other clients does not start the database as service, but it starts upon first connection.

The common thing among all clients is that they have the same basis DB, and also the same ODBC-Settings, and this was the reason why to have this webclient settings residing PERMANENTLY either as Database-Option or as ODBC configuration.

So far I couldn't find how to set this option in ODBC-Settings (in connection-string as connection-parameter for example), and also couldn't save it in Database as Database-Option permanently, and this was the reason for writing this question!

Thanks in advance

(14 Apr '20, 05:04) Baron

Windows Service (using DBSVC + DBSRVx),

Put the -zoc in the dbsrv command line in the DBSVC command line.

it starts upon first connection.

Put the -zoc in the dbsrv command line in the ODBC START= parameter

(14 Apr '20, 08:45) Breck Carter

Ah, I see. Hm, you could try to add -zoc to the START connection parameter but that would only work for those clients connecting to a not already database.

Then using a DatabaseStart event to automatically set the sa_server_option if it not yet set when the database is started may be your best bet.

(14 Apr '20, 08:51) Volker Barth

The idea would be to put -zoc in EVERY dbsrv command line, so it is set no matter how the server is started.

(14 Apr '20, 10:44) Breck Carter

Yes, I surely agree, no need for a DatabaseStart event here.

(14 Apr '20, 11:57) Volker Barth

It is a super idea to set the sa_server_option from within DatabaseStart event!!

The START connection parameter sounds good, but where can I use it? Can I use it in ODBC? In the advanced tab for example I can see that I can set another parameters (Appinfo, Compress...), but not this one regarding START!

Where can I find the documentation how can I set these advanced values (maybe even in the below box where I should type the whole advanced string)

(14 Apr '20, 18:22) Baron

Within the ODBC setup dialog, the "Start line" will appear on the "Login" tab when you choose the action "Start and connect to a database on this computer". But that's just an GUI issue. Note that START is only relevant when you try to connect to a database (a) on the local machine and (b) when the database and the engine is it specified to run on are not yet running. It has no effect when there is nothing to start...

AFAIK you can use all general connection parameters within an ODBC datasource, and some ODBC-specific connection parameters, too.

(15 Apr '20, 02:44) Volker Barth
Comment Text Removed
showing 1 of 9 show all flat view
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: 09 Apr '20, 18:00

question was seen: 1,186 times

last updated: 15 Apr '20, 09:45