Buenos días lista,
En un computador con Ubuntu 8.04 estoy tratando de insertar datos a una tablas
desde un archivo .csv o .txt pero me sale el siguiente error:
postgres=# COPY sitio FROM '/tmp/sitio.csv' using delimiters ',';
ERROR: invalid input syntax for integer: ""
CONTEXT: COPY well, line 1, column province_state_id: ""
La tabla es la siguiente:
postgres=#
CREATE
TABLE sitio(uom_id INTEGER REFERENCES
r_uom(uom_id),geologic_province_id INTEGER REFERENCES
r_geologic_province(geologic_province_id),project_id INTEGER
REFERENCES project(project_id),province_state_id INTEGER,uwi VARCHAR
PRIMARY KEY,sitio_name VARCHAR UNIQUE NOT NULL,datum VARCHAR,latitude
NUMERIC(20,6),longitude NUMERIC(20,6),origin VARCHAR,coord_X
NUMERIC(20,6),coord_Y NUMERIC(20,6),depth_total INTEGER,site_type_id
INTEGER,ge_sea_level VARCHAR,remarks VARCHAR(2000),row_created_date
DATE,row_changed_date DATE);El archivo .csv trae lo siguiente:He tratado de
ingresar con comillas (todos lo campos textos), sin comillas, etc, lo que esta
haciendo es interpretar los campos numericos como texto cuando no le pongo un
valor.
1,2,5,,"TEC71","TEC71",,,,,,,,,,,,01-12-2008
1,3,5,,"EDIF0036","EL DIF-36",,,,,,,,,,,,01-12-2008
1,1,5,,"PALM0001ST","PAL-1 ST",,,,,,,,,,,,01-12-2008
1,5,5,,"BEV0001","BEV-1",,,,"BO",,,,,,,,01-12-2008
1,1,5,,"TCHI0009","TOQUI",,,,,,,,,,,,01-12-2008Gracias por la ayuda.Olga Lucia.
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces.
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us