Contents Index Extracting a collation using the dbcollat command-line utility The File Hiding utility

ASA Database Administration Guide
  Database Administration Utilities
    The Collation utility
      Extracting a collation using the dbcollat command-line utility

Collation utility options

Connection parameters (-c)    For a description of the connection parameters, see Connection parameters. If the connection parameters are not specified, connection parameters from the SQLCONNECT environment variable are used, if set.

For example, the following command extracts a collation file from the asademo database that is running on the sample_server server, and connects as user ID DBA with password SQL:

dbcollat -c "eng=sample_server;dbn=asademo;uid=DBA;pwd=SQL" c:\sample\col

Convert the collation definition file to INSERT statements that describe the collation (-d)    When a database is created, the collation is inserted into the SYS.SYSCOLLATION system table. A mapping from the collation to character sets and Sybase TDS collations is also inserted into the SYS.SYSCOLLATIONMAPPINGS system table. This collation is selected from the set of provided collations in the collseqs.sql file or from the custom collations in the custom.sql file in the scripts subdirectory of your Adaptive Server Anywhere installation directory.

For more information about the SYSCOLLATIONMAPPINGS system table, see SYSCOLLATIONMAPPINGS system table.

Custom collations are added to the custom.sql script. The -d option converts the collation definition file that you provide into INSERT statements that can be copied into custom.sql.

For example, you can use the -d option with the dbcollat command as follows:

dbcollat -d coll-defn-file custom-file

The coll-defn-file is read and parsed as a collation definition. Output is written to custom-file. The custom-file contents must be added to custom.sql.

For more information about creating a custom collation using the -d option, see Creating a custom collation.

Include empty mappings (-e)    Normally, collations don't specify the actual value that a character is to sort to. Instead, each line of the collation sorts to one position higher than the previous line. However, older collations have gaps between some sort positions. Normally, the Collation utility skips the gaps and writes the next line with an explicit sort-position. This option causes the Collation utility to write empty mappings (consisting of just a colon (:)) for each line in the gap.

Log output messages to file (-o)    Write output messages to the named file.

Operate quietly (-q)    Do not display output messages. This option is available only when you run this utility from the command prompt.

Use hexadecimal for extended characters [ 7F to FF ] (-x)    Extended single-byte characters (whose value is greater than hex 7F) may or may not appear correctly on your screen, depending on whether the code page on your computer is the same as the code page of the collation that you are extracting. This option causes the Collation utility to write any character to hex 7F or above as a two-digit hexadecimal number, in the form \xdd. For example:

\x80, \xFE

Without the -x option, only characters from \x00 to \x1F, \x7F and \xFF are written in hexadecimal form.

Operate without confirming actions (-y)    Choosing this option automatically replaces an existing collation file without prompting for confirmation.

Specify a collating sequence label (-z)    Specify the label of the collation to be extracted. The names of the recommended collation sequences can be found by executing the following command:

dbinit -l

If the -z option is specified with one of the available collation labels, then dbcollat does not connect to a database. Otherwise, it connects to a database and extracts the collation of that database. If the collation label does not match the collation label of the database, an error is returned.


Contents Index Extracting a collation using the dbcollat command-line utility The File Hiding utility