10 16 5 AsValue

LANSA Technical

10.16.5 AsValue

AsValue allows you to better handle *SQLNull. Rather than having to test for a potential SQL null, AsValue allows a variable to return a specified value.

Input Parameters

Default - The value to be returned when the variable contains an SQLNull.

Allowable values for a date variable are any valid dates

Example

The IF below tests for the date as SQLnull or less than 10:

 

If ((#Integer.IsSqlNull) *or (#Integer < 10))

 

Endif

 

Using AsValue it can be coded as follows

 

If (#Integer.AsValue(0) < 10)

 

 Endif

 

Ý 10.16 Integer Intrinsic Functions