pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Please help me out on this insert error
7+ messages / 4 participants
[nested] [flat]

* Please help me out on this insert error
@ 2002-06-13 05:16  Vernon Wu <vernonw@gatewaytech.com>
  0 siblings, 3 replies; 7+ messages in thread

From: Vernon Wu @ 2002-06-13 05:16 UTC (permalink / raw)
  To: pgsql-sql


Command:

Insert into profile (userid, haveChildren)values('id98', 'No');

Error:

ERROR:  Relation 'profile' does not have attribute 'havaChildren'

Table:

                 Table "profile"
    Column    |         Type          | Modifiers
--------------+-----------------------+----------
 userid       | character varying(25) | not null
 sex          | character(1)          | not null
 dob          | date                  | not null
 pob          | character varying(20) |
 status       | character varying(20) | not null
 ethnicity    | character varying(20) | not null
 religion     | character varying(20) | not null
 bodytype     | character varying(20) | not null
 height       | numeric(3,0)          | not null
 weight       | numeric(2,0)          | not null
 education    | character varying(20) |
 occupation   | character varying(20) | not null
 incomelow    | numeric(6,0)          | not null
 incomeup     | numeric(6,0)          | not null
 haveChildren | character varying(20) | not null
 wantChildren | character varying(20) | not null
 drinking     | character varying(20) |
 smoking      | character varying(20) | not null
 narration    | text                  |
Primary key: pro_pkey


What is wrong here?

Thanks.






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Please help me out on this insert error
@ 2002-06-13 07:24  Vernon Wu <vernonw@gatewaytech.com>
  parent: Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Vernon Wu @ 2002-06-13 07:24 UTC (permalink / raw)
  To: Stephan Szabo <sszabo@megazone23.bigpanda.com>; +Cc: pgsql-sql


You are right, Steve. It needs the double quote mark. After I use the double quote mark, an error message is:

ERROR:  ExecAppend: Fail to add null value in not null attribute ...

which is right since I don't have non-null value to non-null field yet.

I, however, didn't use double quote mark when I created the table at all.

Now, I need to figure out how to add double quote mark in Java code query string.

v.

6/14/2002 6:12:18 AM, Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:

>On Thu, 13 Jun 2002, Vernon Wu wrote:
>
>>
>> Command:
>>
>> Insert into profile (userid, haveChildren)values('id98', 'No');
>
>You presumably used double quotes when creating the column, so
>you need to use them to refer to the column from that point on:
>
>insert into profile(userid, "haveChildren") ...
>
>
>






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Please help me out on this insert error
@ 2002-06-13 07:50  Vernon Wu <vernonw@gatewaytech.com>
  parent: Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Vernon Wu @ 2002-06-13 07:50 UTC (permalink / raw)
  To: pgsql-sql

6/14/2002 6:31:16 AM, Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:

>
>On Thu, 13 Jun 2002, Vernon Wu wrote:
>
>> I, however, didn't use double quote mark when I created the table at all.
>
>If you used an interface to generate the table def, alot of them add the
>quote marks behind your back when they do the creation. 

That must be what really happended without my knowledge. I used the pgAdmin to create the table. So, it is safer to 
create tables using the command line.

In general, it's
>safer to just use all lowercase names. :)
>
>

That is a separated issue, is it?

Thanks.

v






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Please help me out on this insert error
@ 2002-06-13 21:53  Joe Conway <mail@joeconway.com>
  parent: Vernon Wu <vernonw@gatewaytech.com>
  2 siblings, 0 replies; 7+ messages in thread

From: Joe Conway @ 2002-06-13 21:53 UTC (permalink / raw)
  To: vernonw@gatewaytech.com; +Cc: pgsql-sql

Vernon Wu wrote:
> Command:
> 
> Insert into profile (userid, haveChildren)values('id98', 'No');
> 
> Error:
> 
> ERROR:  Relation 'profile' does not have attribute 'havaChildren'
                                                         ^^^
 From the error message, looks like you spelled haveChildren wrong.

HTH,

Joe




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Please help me out on this insert error
@ 2002-06-13 22:12  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Vernon Wu <vernonw@gatewaytech.com>
  2 siblings, 1 reply; 7+ messages in thread

From: Stephan Szabo @ 2002-06-13 22:12 UTC (permalink / raw)
  To: Vernon Wu <vernonw@gatewaytech.com>; +Cc: pgsql-sql

On Thu, 13 Jun 2002, Vernon Wu wrote:

>
> Command:
>
> Insert into profile (userid, haveChildren)values('id98', 'No');

You presumably used double quotes when creating the column, so
you need to use them to refer to the column from that point on:

insert into profile(userid, "haveChildren") ...





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Please help me out on this insert error
@ 2002-06-13 22:26  Manfred Koizar <mkoi-pg@aon.at>
  parent: Vernon Wu <vernonw@gatewaytech.com>
  2 siblings, 0 replies; 7+ messages in thread

From: Manfred Koizar @ 2002-06-13 22:26 UTC (permalink / raw)
  To: vernonw@gatewaytech.com; +Cc: pgsql-sql

On Thu, 13 Jun 2002 13:16:29 +0800, Vernon Wu
<vernonw@gatewaytech.com> wrote:
>
>Command:
>
>Insert into profile (userid, haveChildren)values('id98', 'No');
>
>Error:
>
>ERROR:  Relation 'profile' does not have attribute 'havaChildren'
                                                        ^
                                 cut'n'paste error here ?

>Table:
>                 Table "profile"
>    Column    |         Type          | Modifiers
>--------------+-----------------------+----------
> userid       | character varying(25) | not null
> [...]
> haveChildren | character varying(20) | not null

Anyway, try
Insert into profile (userid, "haveChildren") values('id98', 'No');

Servus
 Manfred



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Please help me out on this insert error
@ 2002-06-13 22:31  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Vernon Wu <vernonw@gatewaytech.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Stephan Szabo @ 2002-06-13 22:31 UTC (permalink / raw)
  To: Vernon Wu <vernonw@gatewaytech.com>; +Cc: pgsql-sql


On Thu, 13 Jun 2002, Vernon Wu wrote:

> I, however, didn't use double quote mark when I created the table at all.

If you used an interface to generate the table def, alot of them add the
quote marks behind your back when they do the creation. In general, it's
safer to just use all lowercase names. :)




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2002-06-13 22:31 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-06-13 05:16 Please help me out on this insert error Vernon Wu <vernonw@gatewaytech.com>
2002-06-13 21:53 ` Joe Conway <mail@joeconway.com>
2002-06-13 22:12 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-06-13 07:24   ` Vernon Wu <vernonw@gatewaytech.com>
2002-06-13 22:31     ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-06-13 07:50       ` Vernon Wu <vernonw@gatewaytech.com>
2002-06-13 22:26 ` Manfred Koizar <mkoi-pg@aon.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox