SQL_SET_STATEMENT_TERMINATOR

The SQL_SET_STATEMENT_TERMINATOR script element determines the character which terminates  SQL statements. Specifications made with SQL_SET_STATEMENT_TERMINATOR apply for all subsequent SQL statements until the job ends or until the SQL_SET_STATEMENT_TERMINATOR statement is used again.

Important! This script element is automatically inserted in the script when the separator is used within an SQL statement. No manual intervention is required.

Syntax

SQL_SET_STATEMENT_TERMINATOR

TERM=...

Parameters

  • SQL_SET_STATEMENT_TERMINATOR

    Determines the character which terminates SQL statements

  • TERM=

    Separator

    Default value: ;

    The following order is kept when a separator is selected:

    ;, @, $, /, ~, *, +, ?, =, ., -, §, ë

Examples

The following is an example for Oracle where SQL_SET_STATEMENT_TERMINATOR is added to the script because a semicolon (;) is used within an SQL statement.

SQL_SET_STATEMENT_TERMINATOR TERM='@';

DECLARE

v_unit_short varchar2(10);

v_description varchar2(40);

BEGIN

v_unit_short := 'kg';

v_description := 'Kilogram';

insert into unit (unit_short, description)

values (v_unit_short, v_description);

EXCEPTION when DUP_VAL_ON_INDEX then

/* Data record already exists => Reset description */

update unit set

description = v_description

where unit_short = v_unit_short;

END;

@

See also: