Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - Database Administration » Administering Your Database » Database administration utilities » Administration utilities overview » Using configuration files


Using conditional parsing in configuration files

You can use conditional parsing in configuration files to specify the utilities that can use the file. Conditional directives allow command parameters to be included or excluded depending on the utility using the file. The File Hiding Utility (dbfhide) can still be used to hide the contents of a configuration file when conditional parsing is used in the file.

configuration-file= text...
text : comment | conditional | command-line-option
comment : line starting with # that is not a conditional
conditional :
#if  condition
   [ #elif  condition
   ] ...
   [ #else
 ] ...
condition : { tool=utility-name[,utility-name]... | utility-name }

The following values are supported for utility-name:

dbbackup dbinfo dbltm dbstop dbxtract
dbdsn dbinit dbmlsync dbsupport mlsrv
dbeng dblic dbping dbsvc mluser
dberase dblocate dbremote dbunload qaagent
dbfhide dblog dbspawn dbupgrad rteng
dbhist dblsn dbsrv dbvalid

To be treated as a directive, the first non-whitespace character on a line must be #. When a utility is encountered in an #if or #elif directive, the lines that follow the directive are included until another conditional directive is encountered. The #else directive handles the condition where the utility has not been found in the preceding blocks. The #endif directive completes the conditional directive structure.

Blank spaces are not permitted anywhere within the list of tool names specified by tool=. You can nest conditional directives. If an error occurs while parsing the configuration file, the utility reports that the configuration file cannot be opened.


The following configuration file can be used by dbping, dbstop, and dbvalid.

#if tool=dbping,dbstop,dbvalid
   #always make tools quiet
   -c "UID=DBA;PWD=sql;ENG=myserver;DBN=mydb"
   #if dbping
      #make a database connection
   #elif tool=dbstop
      #don't ask
      #must be dbvalid