10 13 1 AsValue

LANSA Technical

10.13.1 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 ((#Decimal.IsSqlNull) *or (#Decimal < 10))

 

Endif

 

Using AsValue it can be coded as follows

 

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

 

 Endif

 

Ý 10.13 Decimal Intrinsic Functions