Skip site navigation (1) Skip section navigation (2)

ERROR: invalid input syntax for integer: SQL state: 22P02

From: avalon78 geek <avalon78(dot)gr(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: ERROR: invalid input syntax for integer: SQL state: 22P02
Date: 2012-01-01 14:01:08
Message-ID: CALcq1oMENA8Wyhx+5OJ_EQcLsD+_qsWQUYfPCQDnz=zfK2KaNA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
hi guys,
i am new to pgsql and i am facing a strange problem which i cannot solve.i
want to import data from a txt file to the table cust

the table is
 CREATE TABLE cust
(
   custid integer NOT NULL,
   custOccupation  varchar(30) NOT NULL,
  PRIMARY KEY(custid)
}

and the txt file contains
13;developer
22;sales manager
  etc

i issue the following sql command
COPY cust
 FROM 'C:\Program Files\PostgreSQL\9.1\customers.txt'
WITH DELIMITER ';'  ;

and i get an error
ERROR: invalid input syntax for integer: "13"
SQL state: 22P02

i would appreciate if you could help me

best regards and a happy new year!:)

Responses

pgsql-novice by date

Next:From: Andreas KretschmerDate: 2012-01-01 15:12:10
Subject: Re: is it normal behavior of index?
Previous:From: Jean-Yves F. BarbierDate: 2012-01-01 13:35:04
Subject: Re: is it normal behavior of index?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group