Deletes a variable definition from interactive and dynamic SQL that was used for invoking stored procedures and for testing procedures in modules or embedded SQL programs.
1 – Environment
You can use the UNDECLARE statement: o In interactive SQL o In dynamic SQL as a statement to be dynamically executed
2 – Format
(B)0[m[1;4mUNDECLARE[m[1m qqwq> <variable-name> qqqqqqwqqq> [m [1m mqqqqqqqqqq , <qqqqqqqqqqqj [m [1m [m
3 – Arguments
3.1 – variable-name
Specifies the name of the local variables.
4 – Example
Example 1: Undeclaring variables in interactive SQL SQL> ATTACH 'FILENAME personnel'; SQL> SQL> DECLARE :X INTEGER; SQL> DECLARE :Y CHAR(10); SQL> SQL> BEGIN cont> SET :X = 100; cont> SET :Y = 'Active'; cont> END; SQL> PRINT :X, :Y; X Y 100 Active SQL> SHOW VARIABLES X INTEGER Y CHAR(10) SQL> UNDECLARE :X, :Y;