pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: [SQL] sql statements
2+ messages / 2 participants
[nested] [flat]

* Re: [SQL] sql statements
@ 2000-02-03 18:03  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David Warren <exec@shreve.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2000-02-03 18:03 UTC (permalink / raw)
  To: David Warren <exec@shreve.net>; +Cc: pgsql-sql@hub.org

"David Warren" <exec@shreve.net> writes:
> UPDATE table1 SET val1 = 'test', SET val2 = 'test' WHERE recnum=1;
> This statement doesn't work for me. If I use only one SET per statement =
> it does. Is this supposed to be this way?

Yes.  I don't know where you got the idea that the SET keyword should
appear multiple times, but the SQL92 syntax is perfectly clear that
it appears once:

         <update statement: searched> ::=
              UPDATE <table name>
                SET <set clause list>
                [ WHERE <search condition> ]

         <set clause list> ::=
              <set clause> [ { <comma> <set clause> }... ]

         <set clause> ::=
              <object column> <equals operator> <update source>

         <update source> ::=
                <value expression>
              | <null specification>
              | DEFAULT

         <object column> ::= <column name>

> Also, the statement INSERT INTO table1 (val1, val2, ..., val68) VALUES =
> ('test','test',...,'test') gives me an error as well. There are 68 =
> elements I am trying to add in that one statement. If I trim it down to =
> 30 or so it is fine. Is it supposed to be this way?

How long is the resulting statement?  There's an 8K limit on the length
of the query text in 6.5 and older releases (it's gone in current
sources though).  If you're not hitting that then I dunno... what error
do you get exactly?

			regards, tom lane



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

* sql statements
@ 2000-02-03 19:53  David Warren <exec@shreve.net>
  0 siblings, 1 reply; 2+ messages in thread

From: David Warren @ 2000-02-03 19:53 UTC (permalink / raw)
  To: pgsql-sql@hub.org

UPDATE table1 SET val1 = 'test', SET val2 = 'test' WHERE recnum=1;
This statement doesn't work for me. If I use only one SET per statement it does. Is this supposed to be this way?
Also, the statement INSERT INTO table1 (val1, val2, ..., val68) VALUES ('test','test',...,'test') gives me an error as well. There are 68 elements I am trying to add in that one statement. If I trim it down to 30 or so it is fine. Is it supposed to be this way? The same statement will load into a MySQL database without any problems at all so I know there are no errors in the statement syntax.

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


end of thread, other threads:[~2000-02-03 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-02-03 19:53 sql statements David Warren <exec@shreve.net>
2000-02-03 18:03 ` Tom Lane <tgl@sss.pgh.pa.us>

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