Re: invalid input syntax for integer: "NULL"

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Kumar S <ps_postgres(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: invalid input syntax for integer: "NULL"
Date: 2004-10-15 22:03:38
Message-ID: 20041015145918.B90697@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Fri, 15 Oct 2004, Kumar S wrote:

> In my table definition I defined INTEGER. When I
> uploaded my data it did not take empty SPACE as
> character type. Following a friends suggestion
> (experienced in ORACLE) I made those empty spaces as
> NULL and then I tried to input my insert statement.
>
> I get ERROR:
> ERROR: invalid input syntax for integer: "NULL"
>
> I might want to perform calculations on this column
> and if null is not accepted for INTEGER data type,
> then the only way for me is to make it varchar. BUT I
> CANNOT perform caclulations on this column. It is sad.
>
>
> Is there a way to get going. Please help me.
>
> Below is my table definition and INSERT STATEMENT.
> Many columns has empty spaces. I cannot put Zero's or
> any other negative values because these are
> statistical data columns and zero and any other number
> mean something and might lead to erratic conclusions.
> SORRY these sql statements and table definitions are
> big.

...
> VALUES ( '9215','18491','IMAGE:267638','FLJ22004','hypothetical protein
> FLJ22004','Hs.108812','N25427','NULL','115416','224','NULL','NULL',
...

You probably want NULL rather than 'NULL'. The former means a null value,
the latter means the word NULL.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mitch Pirtle 2004-10-17 00:51:27 Re: possible to access a Linux box db from a Windows box via a GUI?
Previous Message Kumar S 2004-10-15 21:55:13 invalid input syntax for integer: "NULL"