pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
invalid input syntax for integer: ""
2+ messages / 2 participants
[nested] [flat]

* invalid input syntax for integer: ""
@ 2004-04-30 22:44 Sebastian Tewes <stewes@tewes.homelinux.net>
  2004-05-04 14:58 ` Re: invalid input syntax for integer: "" scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Sebastian Tewes @ 2004-04-30 22:44 UTC (permalink / raw)
  To: pgsql-sql

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.);
S;;011;;0114;Dachst.mulde(Donau);
S;;011;;0116;Dachst.symm.(Frankf);
S;;011;;0118;Dachst.asym.(Dop.-S);
S;;011;;0119;Dachst.Sonstige;
S;;012;Dachziegel+Formst.;;;
S;;012;;0121;Biberschwanzziegel;
S;;012;;0122;Hohlz.+Krempz.;
S;;012;;0123;Mnch + Nonne;
S;;012;;0124;Strangfalzziegel;
S;;012;;0125;Falzz.(Doppelmulde);
S;;012;;0126;Flachdachziegel;
S;;012;;0127;Verschiebeziegel;
S;;012;;0129;Ziegel Sonstige;
S;;013;Faserzementplatten;;;
S;;013;;0131;Dach+Fassadenplatten;
S;;013;;0133;Wellplatten;
S;;013;;0135;Tafeln;
S;;013;;0137;Elemente;
S;;014;Fassadenpl.speziell;;;
S;;014;;0141;Asphalt;

and the error message 

ERROR:  invalid input syntax for integer: ""
CONTEXT:  COPY warengruppen, line 1, column holder: ""

i know it's hard to fill the integer colume    holder    with nothing out of csv table.. but it's the same with the colume   WarenGruppe so i can't use a char type... so mybe someone know a litte trick to save me ?? don't like to reformat 10MB datasource ...

thank's 

Sebastian
 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: invalid input syntax for integer: ""
  2004-04-30 22:44 invalid input syntax for integer: "" Sebastian Tewes <stewes@tewes.homelinux.net>
@ 2004-05-04 14:58 ` scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 0 replies; 2+ messages in thread

From: scott.marlowe @ 2004-05-04 14:58 UTC (permalink / raw)
  To: Sebastian Tewes <stewes@tewes.homelinux.net>; +Cc: 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.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-05-04 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-30 22:44 invalid input syntax for integer: "" Sebastian Tewes <stewes@tewes.homelinux.net>
2004-05-04 14:58 ` scott.marlowe <scott.marlowe@ihs.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox