Subject Re: [firebird-support] Replace Null value in select clause
Author Alexandre Benson Smith
Wayne wrote:

>Does firebird support the replacing of null values with a user specified
>value in the select clause?
>
>
>
>Example:
>
>
>
>Select R.rdb$field_position As Column_Pos,
>
> R.rdb$field_name As Column_Name,
>
> T.rdb$type_name As Data_Type,
>
> F.rdb$field_length As Column_Length,
>
>
>
> Null(R.rdb$null_flag,0) As Is_Nullable, /*<----------------
>Example */
>
>
>
>>From rdb$relation_fields R,
>
> rdb$types T,
>
> rdb$fields F
>
>Where R.rdb$relation_name = 'CUSTOMER'
>
>And F.rdb$field_name = R.rdb$field_source
>
>And T.rdb$field_name = 'RDB$FIELD_TYPE'
>
>And F.rdb$field_type = T.rdb$type
>
>Order by R.rdb$field_position
>
>
>
>Thanks
>
>

Look for Coalesce in the release notes.

Select R.rdb$field_position As Column_Pos,

R.rdb$field_name As Column_Name,

T.rdb$type_name As Data_Type,

F.rdb$field_length As Column_Length,



Coalesce(R.rdb$null_flag,0) As Is_Nullable,

From rdb$relation_fields R,

rdb$types T,

rdb$fields F

Where R.rdb$relation_name = 'CUSTOMER'

And F.rdb$field_name = R.rdb$field_source

And T.rdb$field_name = 'RDB$FIELD_TYPE'

And F.rdb$field_type = T.rdb$type

Order by R.rdb$field_position

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br