isnull function

Поиск
Список
Период
Сортировка
Искать

isnull function

От:
Kachun Lee <kachun@pathlink.com>
Дата:
I tried to implement an is_null function, such as:

   select is_null(dt, 'now'::datetime) ...

The following code does not seem to work:

#include 
#include 
#include "postgres.h"
#include "libpq-fe.h" 
#include "utils/dt.h"

DateTime * is_null(DateTime *, DateTime *);

DateTime * is_null (DateTime * dt, DateTime * def)
{
        return dt ? dt : def;
}

I searched the doc/maillist, and I could not find how to test an arg for
NULL value. Any info or help will be greately appreciated.
FAQ