My Csv file has missing entries denoted as -
1.2E+09 8.59E+09 In 3 480 5697277130 822277190 OK 1 0 1.23E+09 34295
4.89E+09 9.59E+09 Out 3 480 1677272449 6747272509 OK 1 -100 8.87E+09 21
2.33E+09 4.49E+09 In 4 640 4347277310 4567277370 OK 1 - 3.23E+09 123
2.33E+09 4.49E+09 4 640 4347277310 4567277370 OK 1 - 3.23E+09
I have defined my table schema as follows
create table zip_codes(
Source numeric,
manual numeric,
TTYPE varchar,
feature1 numeric,
feature2 numeric,
LBP1 numeric,
RLBP numeric,
STATUS varchar,
NUMBER_OF_TRASVERSE numeric,
rank numeric,
image_number numeric,
parent_class numeric);
and my import script from csv file is
test_db=# COPY zip_codes FROM 'C:/tmp/dd_1.csv' delimiter ',' csv;
my error:
ERROR: invalid input syntax for type numeric: "-"
CONTEXT: COPY zip_codes, line 7, column rank: "-"
Should I change the numeric schema of rank to something else to get the - values imported? Any suggestions on how i can get these values imported.
It is a large csv so is there a way i can import all (-) values? Any suggestions?
Any suggestions?
Thanks!