RE: Simple Insert Problem

From: "Robby Slaughter" <webmaster(at)robbyslaughter(dot)com>
To: "Gonzo Rock" <GonzoRock(at)Excite(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: RE: Simple Insert Problem
Date: 2001-08-07 01:17:46
Message-ID: EPEHLKLEHAHLONFOKNHNMEOLDDAA.webmaster@robbyslaughter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)postgresql(dot)org
[mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Gonzo Rock
Sent: Monday, August 06, 2001 7:18 PM
To: pgsql-sql(at)postgresql(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message GonzoRock 2001-08-07 01:41:03 RE: Simple Insert Problem
Previous Message Josh Berkus 2001-08-07 00:59:18 Re: Simple Insert Problem