Thread: Handling of nullable columns in embedded SQL

Handling of nullable columns in embedded SQL

From
Rolf Cohn
Date:
Hello!

How to treat NULL values in queries?


1) Is there an equivalent to the IFNULL (CA-Ingres)/NVL (Oracle)
functions?

Example:
EXEC SQL SELECT IFNULL(foo, -1) FROM bar INTO :dummy;

2) Is it possible to create a host variable
to put the NULL value indicator which then can be checked?

Example:
EXEC SQL SELECT foo FROM bar INTO :dummy_null_ind:dummy;

I have gone through the PostgreSQL Programmer's Guide and
the PostgreSQL User's Guide but did not find the answers.
Did I miss something?


Regards
-- 
vvvvvvvvv --------------------------------------------------------vvvvvvv  Rolf Cohn         vvvvv   Alcatel Telecom
vvv    Norway AS        E-mail: mailto:Rolf.Cohn@alcatel.no   v
-------------------------------------------------------------