Progress
Embedded SQL-92
Guide and Reference


UPDATE with NULL Values

You can modify a column value to contain a NULL value by using the UPDATE statement. Assign the desired column the keyword value NULL in an UPDATE statement.

EXAMPLE

The following example shows how to update the projno column to NULL, indicating there is no project assigned to employee 2040:

EXEC SQL
     UPDATE employee
     SET projno = NULL
     WHERE empno = 2040 ; 

You can also modify a column value to contain a NULL by using indicator variables. Set the indicator variable to negative one ( -1 ) and use it with its associated host variable.

EXAMPLE

The following code fragment shows how to update the employee table using an indicator variable:

projno_i = -1 ;
EXEC SQL
     UPDATE employee
     SET projno = projno_v:projno_i
     WHERE empno = 2040 ; 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095