SQL$HELP_OLD72.HLB  —  SET_ANSI, Example
    Example 1: Setting CURRENT_TIMESTAMP to ANSI format

    In the following example, SQL issues an error message because
    CURRENT_TIMESTAMP is an ADT data type by default, and TIMESTAMP
    is an ANSI data type. The SET ANSI DATE ON statement changes the
    default CURRENT_TIMESTAMP to ANSI format.

    SQL> begin
    cont> declare :logging_date timestamp;
    cont> set :logging_date = current_timestamp;
    cont> trace :logging_date;
    cont> end;
    %SQL-F-UNSDATASS, Unsupported date/time assignment from <Source> to LOGGING_DATE
    SQL> SET ANSI DATE ON;
    SQL> begin
    cont> declare :logging_date timestamp;
    cont> set :logging_date = current_timestamp;
    cont> trace :logging_date;
    cont> end;

    Example 2: Using the SET ANSI IDENTIFIERS statement to check for
    reserved words

    This example shows the output from an SQL statement that creates
    a domain and specifies the ANSI89 reserved word CONTINUE as the
    user-supplied name for that domain. The SET ANSI IDENTIFIERS ON
    statement requires that you use uppercase characters for the name
    and enclose it in double quotation marks.

    SQL> set ansi identifiers on;
    SQL> create domain continue char(5);
    %SQL-F-RES_WORD_AS_IDE, Keyword CONTINUE used as an identifier
    SQL> create domain "CONTINUE" char(5);
    SQL>
Close Help