SQL Statements

Stored procedure with Null output

Description

It is currently unsupported to use NULL value in an OUTPUT parameter when declaring a stored procedure.

Workaround

Set a variable and set it to NULL. Then use the variable in the OUTPUT parameter to provide the same functionality.

Example

Original code:

// Declare the procedures
Declare SPgetseniva procedure for SPgetseniva &
@codpes = :l_usp_codpes, &
@nomsis = :s_usp_systemname, &
@staobt = :s_usp_systemstatus,&
@numseniva = null output ;

Modified code:

integer li_return
SetNull(li_return)
// Declare the procedures
Declare SPgetseniva procedure for SPgetseniva &
@codpes = :l_usp_codpes, &
@nomsis = :s_usp_systemname, &
@staobt = :s_usp_systemstatus,&
@numseniva = :li_return output ;