Insert NULL value with to_numeric()

Поиск
Список
Период
Сортировка
От Ghislain Bob Hachey
Тема Insert NULL value with to_numeric()
Дата
Msg-id 1153356715.2234.342.camel@informationmanagement.pfnet.local
обсуждение исходный текст
Ответы Re: Insert NULL value with to_numeric()  ("Aaron Bono" <postgresql@aranya.com>)
Список pgsql-admin
Hello all,

I'm a newbie.  PostgreSQL 8.1.4. Fedora Core 5.

I'm writing a small java application that will import CSV txt files into
my DB.  The SQL statement I'm sending to pgsql looks like this:

"INSERT into table (col1,col2,col3) values (to_number(?,
'999'),to_timestamp(?, 'MM/DD/YYYY HH24:MI:SS'),to_number(?, '9999');

Values are taken from a String array.

sometimes in col3 (smallint in pgsql DB) I need to insert a NULL value
but when I do I get the following error message:

invalid input syntax for type numeric: " "

I've search the archives and Internet and found similar situations but I
guess not experienced enough to fix this myself with info that I've
found.

Any help would be greatly appreciated.

Regards,

Ghislain Hachey




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

Предыдущее
От: "Mr. Dan"
Дата:
Сообщение: Re: On-line backup
Следующее
От: "Aaron Bono"
Дата:
Сообщение: Re: Insert NULL value with to_numeric()