Re: invalid input syntax for integer: ""

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: invalid input syntax for integer: ""
Дата
Msg-id Pine.LNX.4.33.0405040857010.30999-100000@css120.ihs.com
обсуждение исходный текст
Ответ на invalid input syntax for integer: ""  ("Sebastian Tewes" <stewes@tewes.homelinux.net>)
Список pgsql-sql
On Sat, 1 May 2004, Sebastian Tewes wrote:

> Hello :-)
> 
> got a little prob... 
> 
> so my table 
> 
> create table warengruppen ( kennung char (1),
>                                 holder int,
>                      HauptWarenGruppe int,
>                         BezHWG varchar (50),
>                           WarenGruppe int,
>                          BezWG varchar (50));
> 
> 
> the copy syntax 
> 
> copy warengruppen FROM '/usr/pgsql/datanorm.wrg' with DELIMITER ';';
> 
> and a smal part of my 'datanorm.wrg'
> 
> 
> S;;011;Dachsteine+Formst.;;;
> S;;011;;0111;Dachst.glatt(Biber);
> S;;011;;0112;Dachst.glatt(Tegal.);

the problem here is that "" is not an integer. 

0 is.  If you were to write a simple script file to process the input file 
and turn the empty fields into 0s where they should be because they're 
integers you're set.

OR, you can build a temp table with all text columns, import into that, 
then use a select query to change the blank text columns to the character 
0, then import that into the target table.



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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: typecasting numeric(18,4) to varchar/text
Следующее
От: Martin Knipper
Дата:
Сообщение: Re: typecasting numeric(18,4) to varchar/text