Collection Contents Index The Backup utility The Compression utility pdf/chap4.pdf

Reference Manual
   CHAPTER 4. Database Administration Utilities     

The Collation utility


With the Collation utility, you can extract a collation (sorting sequence) from the SYS.SYSCOLLATION system table of a database into a file that is suitable for creating a database using a custom collation.

The file that is produced can be modified and used with Sybase Central or the -z option of dbinit to create a new database with a custom collation.

Be sure to change the label on the line that looks like:

Collation label (name)

Otherwise, the collation cannot be used to create a database.

If you wish to create a custom collation but have not yet created a database, extract a collation from the sample database.

For Info     For more information on custom collating sequences, see Creating databases with custom collations.

You can access the Collation utility in the following ways:

Top of page  Extracting a collation using Sybase Central

  To use the Collation utility from Sybase Central:
  1. Open the Database Utilities folder in the left panel.

  2. Double-click Create a Custom Collation in the right panel. The Custom Collation Wizard is displayed.

  3. Follow the instructions in the Wizard.

For Info     For full information on compressing a database in Sybase Central, see the Sybase Central online Help.

Top of page  The DBCOLLAT command-line utility

Syntax 

dbcollat [switches] output-file

Windows 3.x
syntax 

dbcollw [switches] output-file

Switch

Description

-c "keyword=value; ..."

Supply database connection parameters

-d filename

Convert the definition file to INSERT statements

-e

Include empty mappings

-o filename

Output log messages to a file

-q

Quiet mode — do not print messages

-x

Use hex for extended characters (7F-FF)

-y

Replace the file without confirmation

-z col-seq

Specify a collating sequence label

Description 

The DBCOLLAT command line utility allows you to extract a collation (sorting sequence) from the SYS.SYSCOLLATION system table of a database into a file that is suitable for creating a database using a custom collation.

For Info     For more information about the command-line switches, see Collation utility options.

Top of page  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 statement 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 definition file to an INSERT statement (-d)     A database is created using the CREATE DATABASE statement. The Initialization utility generates this statement internally. You can specify which collation to use in the CREATE DATABASE statement.

The collation definitions exist as an INSERT statement in a file named collseqs.sql in the scripts subdirectory of your installation directory. You can add additional custom collations to custom.sql, also in the scripts subdirectory.

This option provides a way to extract a collation definition from an existing database, as a starting point to creating a custom collation. It converts a custom collation definition file into an INSERT statement for SYSCOLLATION, suitable for adding into custom.sql.

From the dbcollat command-line utility you can use this option as follows:

dbcollat -d coll-defn-file output-file

The file coll-defn-file is read and parsed as a collation definition, and an INSERT statement is output to output-file.

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.

Output log messages to a file (-o )     Redirect the log messages from the Collation utility to a named file.

Operate quietly (-q )     Do not display messages on a window. This option is available only from the command-line utility.

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 being in 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 hex 00 to hex 1F, hex 7F and hex FF are written in hexadecimal form.

Operate without confirming actions (-y )     Without this option, you are prompted to confirm replacing an existing collation file.

Specify a collating sequence label (-z )     Specify the label of the collation to be extracted. The names of the collation sequences can be found in the collation_label column of the SYS.SYSCOLLATION table. If this option is not specified, the Collation utility extracts the collation label that is being used by the database.

Top of page  

Collection Contents Index The Backup utility The Compression utility pdf/chap4.pdf