Inserting Null Value or String Value

Поиск
Список
Период
Сортировка
От test test
Тема Inserting Null Value or String Value
Дата
Msg-id 20021001165453.882.qmail@web14410.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Inserting Null Value or String Value  (Keary Suska <hierophant@pcisys.net>)
Re: Inserting Null Value or String Value  ("Papp Gyozo" <pgerzson@freestart.hu>)
Список pgsql-php

Hi,

I am trying to insert a date into a date field, but also sometimes I need to insert a null value.  Inserting the null value seems to require not using quotes around null, but if I try to enter a date without quotes around it, it thinks it is a number.

Here is the error I get: Warning: PostgreSQL query failed: ERROR: column "spec_start_date" is of type 'date' but expression is of type 'integer' You will need to rewrite or cast the expression

The value I am sending is: spec_start_date = 10/01/02

If I surround the date with single quotes it should be fine, but I can't do that when I want to insert a null value.  I know that I can do an "IF <use quotes> ELSE <don't use quotes>" in the SQL string, by I am entering many values and this would really get messy. I was hoping that there was a better solution. Thanks for any help.

Sean



Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

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

Предыдущее
От: Devrim GUNDUZ
Дата:
Сообщение: Connecting PostgreSQL db using Pear
Следующее
От: Keary Suska
Дата:
Сообщение: Re: Inserting Null Value or String Value