From: | <operationsengineer1(at)yahoo(dot)com> |
---|---|
To: | Richard Broersma Jr <rabroersma(at)yahoo(dot)com>, pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Copy Data Question |
Date: | 2006-06-23 21:23:48 |
Message-ID: | 20060623212348.30485.qmail@web33308.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
> > i have 11 columns total. column 1, 2, 3, 4, 5 and
> 6
> > are NOT NULL. the rest can be null and, in the
> case
> > of the imported data set, are null.
>
> From:
>
http://www.postgresql.org/docs/8.1/interactive/sql-copy.html
>
> COPY tablename ( column [, ...] )
>
> FROM 'filename'
>
> WITH NULL AS 'null string'
> ;
my code is as follows:
COPY t_temp ( columns here... )
FROM 'C:\\Parts.csv'
WITH NULL AS 'nuls'
;
sorry to drag on here... i know this s/b simple,
but...
i'm still getting errors. as an example, i had a
varchar(4) columns rejected 'null string' as being too
long. now, i thought 'null string' represented NULL -
which isn't any characters long. i changed it to
'nuls" instead and still got the error (it might've
counted six characters ('Nuls').
okay, so i took away the max 4 character
restriction... it passed through that column fine,
but now i get...
ERROR: invalid input syntax for integer: "'Nuls'"
CONTEXT: COPY t_temp, line 1, column
assembly_instructions_revision: "'Nuls'"
again, it seems to want to actually insert 'Nuls'
instead of interpret it as NULL value.
also notice the error capitalizes Nuls, even though i
call it as lowercase.
tia...
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | operationsengineer1 | 2006-06-23 21:46:49 | Re: Copy Data Question |
Previous Message | Richard Broersma Jr | 2006-06-23 19:45:59 | Re: Copy Data Question |