Thread: Simple Insert Problem

Simple Insert Problem

From
Gonzo Rock
Date:
Sorry but this is making me crazy... yes... I'm way new to SQL



Why would this error out ??

This is the Query... 
INSERT INTO OP (op_num,op_name,start_time) Values (5400,Welding,06:00:00);

And this is the pgSQL error...
ERROR:  parser: parse error at or near ":"


The table has reasonable values in it already... I'm just adding a few more rows by hand.

Thanks All,



Re: Simple Insert Problem

From
"Josh Berkus"
Date:
Gonzo,

> Sorry but this is making me crazy... yes... I'm way new to SQL

Buy PostgreSQL: Introduction and Concepts.  Now.  Read it cover to cover
before posting any more questions, ok?


> Why would this error out ??
> 
> This is the Query... 
> INSERT INTO OP (op_num,op_name,start_time) Values
> (5400,Welding,06:00:00);

Because you've forgotten the quote marks.

-Josh Berkus


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


RE: Simple Insert Problem

From
"Robby Slaughter"
Date:
Gonzo:

You need to make sure that you delimit your values correctly.

To insert text fields (which may contain spaces) use 'single
quotes'. You'll also want to enter date fields the same way.

So, you should try

INSERT INTO OP (op_num,op_name,start_time) VALUES
(5400,'Welding','06:00:00');

Of course, you're probably using the "time" data type, which means that
6:00:00 really means 6:00 in the morning!

Hope that helps!

-Robby


-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Gonzo Rock
Sent: Monday, August 06, 2001 7:18 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] Simple Insert Problem


Sorry but this is making me crazy... yes... I'm way new to SQL



Why would this error out ??

This is the Query...
INSERT INTO OP (op_num,op_name,start_time) Values (5400,Welding,06:00:00);

And this is the pgSQL error...
ERROR:  parser: parse error at or near ":"


The table has reasonable values in it already... I'm just adding a few more
rows by hand.

Thanks All,


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



RE: Simple Insert Problem

From
GonzoRock@excite.com
Date:
Josh,

Fuck you and the high horse you rode in on.

Yes as a matter of fact I did forget the quote marks. Do you think reading
that book will help with my silly syntactical errors? Do you think I did not
pull my hair out prior to posting? Sometimes the obvious just eludes the
smartest of us.


Perhaps a better answer would have been: 

Gonzo, 

Maybe that question belongs in the pgsql-novice list instead. This list is
for the experts like myself.

Thanks, Josh

------------
Personally I think you are as Spiritually Bankrupt as that Silly website you
have been working on.
------------

later,
Gonzo


Oh and P.S. Thanks for the clue. I'm not spinning my wheels on that one
anymore, but I'm sure I'll run up aginst something else soon enough.


At 05:59 PM 8/6/01 -0700, you wrote:
>Gonzo,
>
>> Sorry but this is making me crazy... yes... I'm way new to SQL
>
>Buy PostgreSQL: Introduction and Concepts.  Now.  Read it cover to cover
>before posting any more questions, ok?
>
>
>> Why would this error out ??
>> 
>> This is the Query... 
>> INSERT INTO OP (op_num,op_name,start_time) Values
>> (5400,Welding,06:00:00);
>
>Because you've forgotten the quote marks.
>
>-Josh Berkus
>
>
>______AGLIO DATABASE SOLUTIONS___________________________
>                                       Josh Berkus
>  Complete information technology      josh@agliodbs.com
>   and data management solutions       (415) 565-7293
>  for law firms, small businesses        fax 621-2533
>    and non-profit organizations.      San Francisco
>





_______________________________________________________
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/




Re: Simple Insert Problem

From
"Josh Berkus"
Date:
Gonzo,

> F*** you and the high horse you rode in on.

Please restrain yourself from posting strong language to the list.  If
you want to use stong language at me, please e-mail it directly. 

Further, I e-mailed an apology for touching a nerve, but you appear to
have supplied an invalid reply-to address -- thus forcing me to reply to
the list.

> Gonzo, 
> 
> Maybe that question belongs in the pgsql-novice list instead. This
> list is
> for the experts like myself.

Hey, you're right.  I'll use something similar to that reply next time.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: Simple Insert Problem

From
Jan Wieck
Date:
GonzoRock@excite.com wrote:
> Josh,
>
> Fuck you and the high horse you rode in on.
   Stop  that language immediately! It is not accepted on any of   our PostgreSQL mailing lists.

> Yes as a matter of fact I did forget the quote marks. Do you think reading
> that book will help with my silly syntactical errors? Do you think I did not
> pull my hair out prior to posting? Sometimes the obvious just eludes the
> smartest of us.
   All Josh did was to put the IMNSHO appropriate "Read The Fine   Manual"  into  polite  words.  And I don't see a
problemwith   that. Maybe reading that book might help you.  Maybe  reading   any  book  about SQL might help you. I
guesssomehow Josh got   the impression you haven't tried that yet.
 

> Oh and P.S. Thanks for the clue. I'm not spinning my wheels on that one
> anymore, but I'm sure I'll run up aginst something else soon enough.
   Feel free to do so and be sure that  you'll  get  the  answer   (maybe  with  some  tips  where  to  gather  that
information  yourself :-). But stay calm  and  show  the  same  amount  of   tolerance you want to get.
 


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com