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

SQL Anywhere 17 » SQL Anywhere Server - Database Administration » Database administration tools and utilities » Database administration utilities » Configuration files

Conditional parsing in configuration files

You can use conditional parsing in configuration files to specify the utilities that can use the file.

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

The following values are supported for utility-name:

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

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 encrypt the contents of a configuration file when conditional parsing is used in the file.

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 dbspawn utility allows you to specify a configuration file reference in the command to be spawned, but you cannot specify a configuration file with options for the dbspawn utility. For example, the first command below is supported, but the second command is not supported:

dbspawn dbeng17 @myconfig.ini 

dbspawn @spawnopts.ini dbeng17 demo.db

Example

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

#if tool=dbping,dbstop,dbvalid
   #always make tools quiet
   -q
   -c "UID=DBA;PWD=passwd;Host=myhost;DBN=mydb"
   #if dbping
      #make a database connection
      -d
   #elif tool=dbstop
      #don't ask
      -y
   #else
      #must be dbvalid
      #use WITH EXPRESS CHECK
      -fx
   #endif
#endif