SQL$HELP_OLD72.HLB  —  DROP  COLLATING_SEQUENCE
    Deletes the named collating sequence.

    You cannot delete a collating sequence if it is used by the
    database or by any domain in the database.

1  –  Environment

    You can use the DROP COLLATING SEQUENCE statement:

    o  In interactive SQL

    o  Embedded in host language programs to be precompiled

    o  As part of a procedure in an SQL module

    o  In dynamic SQL as a statement to be dynamically executed

2  –  Format

  DROP COLLATING SEQUENCE --> <collation-name> -+---------------+->
                                                +-> IF EXISTS --+

3  –  Arguments

3.1  –  collation-name

    Specifies the collation-name argument you used when creating the
    collating sequence in the CREATE COLLATING SEQUENCE statement.

3.2  –  IF_EXISTS

    Prevents SQL command language from displaying error messages if
    the referenced object does not exist in the database.

4  –  Examples

    Example 1: Creating, then deleting, a French collating sequence

    The following example creates a collating sequence using the
    predefined collating sequence FRENCH. It then uses the SHOW
    COLLATING SEQUENCE statement to show the defined collating
    sequence.

    The example next deletes the collating sequence using the
    DROP COLLATING SEQUENCE statement. The SHOW COLLATING SEQUENCE
    statement shows that the collating sequence no longer exists.

    SQL> ATTACH 'FILENAME personnel';
    SQL> CREATE COLLATING SEQUENCE FRENCH FRENCH;
    SQL> --
    SQL> SHOW COLLATING SEQUENCE
    User collating sequences in database with filename personnel
         FRENCH
    SQL> --
    SQL> DROP COLLATING SEQUENCE FRENCH;
    SQL> --
    SQL> SHOW COLLATING SEQUENCE
    User collating sequences in database with filename personnel
    No collating sequences found

    Example 2: Deleting a collating sequence used to define a domain
    or database

    The following example shows that you cannot delete a collating
    sequence if a domain or database is defined using the collating
    sequence:

    SQL> CREATE COLLATING SEQUENCE SPANISH SPANISH;
    SQL> CREATE DOMAIN LAST_NAME_SPANISH CHAR (14)
    cont> COLLATING SEQUENCE IS SPANISH;
    SQL> --
    SQL> SHOW DOMAIN LAST_NAME_SPANISH
    LAST_NAME_SPANISH               CHAR(14)
     Collating sequence: SPANISH
    SQL> --
    SQL> SHOW COLLATING SEQUENCE
    User collating sequences in database with filename personnel
         SPANISH
    SQL> --
    SQL> -- You cannot delete the collating sequence because the
    SQL> -- domain LAST_NAME_SPANISH, defined using SPANISH, still exists:
    SQL> --
    SQL> DROP COLLATING SEQUENCE SPANISH;
    %RDB-E-NO_META_UPDATE, metadata update failed
    -RDMS-F-COLUSEDFLD, the collating sequence named SPANISH is used in
    field LAST_NAME_SPANISH
    SQL> --
    SQL> -- Delete the domain:
    SQL> --
    SQL> DROP DOMAIN LAST_NAME_SPANISH;
    SQL> --
    SQL> -- Now you can delete the collating sequence:
    SQL> --
    SQL> DROP COLLATING SEQUENCE SPANISH;
    SQL> --
    SQL> SHOW COLLATING SEQUENCE
    User collating sequences in database with filename personnel
    No collating sequences found
Close Help