Help with prepared statement

Поиск
Список
Период
Сортировка
От Bendik Rognlien Johansen
Тема Help with prepared statement
Дата
Msg-id C000E196-F222-4383-B72F-5AC7BA089E1E@gmail.com
обсуждение исходный текст
Список pgsql-novice
Hello,
I am having some difficulty using a prepared statement.

PREPARE fooplan(int4, int4) AS SELECT * FROM records WHERE id = $1
AND fax = $2;

Normally this works fine like this:
EXECUTE fooplan(42985, 12345678);

However, sometimes I need to match NULL values like this:

EXECUTE fooplan(42985, NULL);

This fails of course since "fax = NULL" is not the same as "fax IS
NULL".

Is there any way around this?


Thanks!



В списке pgsql-novice по дате отправления:

Предыдущее
От: Afton & Ray Still
Дата:
Сообщение: Re: postgres files in windows xp
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Problem restarting server