Determines the character which terminates SQL statements
SQL_SET_STATEMENT_TERMINATOR TERM=...
Syntax |
Description/Format |
---|---|
TERM= |
Separator Default value: ";" |
This script element is automatically inserted in the script when the separator is used within an SQL statement. No manual intervention is required.
The following order is adhered to when a separator is selected:
";", "@", "$", "/", "~", "*", "+", "?", "=", ".", "-", "§", "ë"
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.
SQL_SET_STATEMENT_TERMINATOR is added to the script because ";" is used within an SQL statement.
This example is specifically meant for Oracle.
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: