Re: Column does not exist when trying to insert data.

From: Richard Huxton <dev(at)archonet(dot)com>
To: Parthan SR <python(dot)technofreak(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column does not exist when trying to insert data.
Date: 2007-03-16 08:05:14
Message-ID: 45FA4FBA.4040200@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Parthan SR wrote:
> I get the following error in the browser, whent he fields for unit and
> returnedas are left blank and hence becomes None.
> I also tried to have some string value such as 'nos' and 'not reqd' for
> 'unit' and 'requiredas' but still it get a similar error
> saying column 'nos' does not exist.
>
> *ProgrammingError*: ERROR: column "none" does not exist INSERT INTO
> orderitem
> (item,quantity,unit,conference,seller,incharge,orderdate,duedate,returnedas)
>
> VALUES (6,10.000000,None,39,1,1,2007-3-16,20-03-2007,None)
> args = ('ERROR: column "none" does not exist\n\nINSERT INT...,
> 10.000000,None,39,1,1,2007-3-16,20-03-2007,None)',)

You're looking for "Null" rather than "None".

Oh, and your dates need to be quoted too.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2007-03-16 08:24:03 Re: Is This A Set Based Solution?
Previous Message Dave Page 2007-03-16 07:59:34 Re: pg_dumpall and version confusion