Re: Inserting values into numeric fields

Поиск
Список
Период
Сортировка
От Jason Earl
Тема Re: Inserting values into numeric fields
Дата
Msg-id 87y9ft23cg.fsf@npa01zz001.simplot.com
обсуждение исходный текст
Ответ на Inserting values into numeric fields  ("Eric Carpenter" <postgresql@slacker.to>)
Список pgsql-sql
"Eric Carpenter" <postgresql@slacker.to> writes:

> Greetings all,
> 
> I'm trying to insert values into a numeric field which may be
> optional. I'm using perl's DBI and bind parameters to do
> this. However, psotgresql complains that '' is not a numeric, since
> the DBI quotes everything before inserting.. I've tried inserting
> NULL as well, but that gets quoted and rejected as well.
> 
> Is there any way to do this without hard coding "NULL" into the
> prepared statement handle?

It's been a long time since I used Perl with PostgreSQL but it seems
DBI will insert null values if you pass them variables that are
undefined.  Try using undef() and see what you get.

Good luck,
Jason


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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Transactional vs. Read-only (Retrieval) database
Следующее
От: Markus Wagner
Дата:
Сообщение: how to get more detailed error messages?