Please enable JavaScript to view this site.

Example

Using the DECLARE command, define and initialize a numeric variable and a character variable.

-- Declare a 5 byte variable V_EMP_NUM and initialize it to zero (0)

DECLARE V_EMP_NUM 5 0’;

 

-- Declare a 20 byte variable VAR_CHR and initialize it to spaces

DECLARE V_EMPLOYEE_LNAME 20 ‘;