pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
begin update ... syntax error
4+ messages / 4 participants
[nested] [flat]

* begin update ... syntax error
@ 2004-04-10 21:32 Kemin Zhou <kemin.zhou@ferring.com>
  2004-04-10 22:07 ` Re: begin update ... syntax error Adrian Klaver <aklaver@comcast.net>
  2004-04-10 22:19 ` Re: begin update ... syntax error Yasir Malik <ymalik@cs.stevens-tech.edu>
  0 siblings, 2 replies; 4+ messages in thread

From: Kemin Zhou @ 2004-04-10 21:32 UTC (permalink / raw)
  To: pgsql-sql

I was trying to speed up a simple update query

fri=# begin
fri-# update tabA set nobegin=tmp.nobegin, noend=tmp.noend
fri-# from tmp
fri-# where tabA.acc=tmp.acc;
ERROR:  syntax error at or near "update" at character 7

The same query can be run with no problem if not starting with BEGIN.

Does mean that BEGIN cannot preceed UPDATE?

Or I am making some obvious miskate?

Kemin




**********************************************************************
Proprietary or confidential information belonging to Ferring Holding SA or to one of its affiliated companies may be contained in the message. If you are not the addressee indicated in this message (or responsible for the delivery of the message to such person), please do not copy or deliver this message to anyone. In such case, please destroy this message and notify the sender by reply e-mail. Please advise the sender immediately if you or your employer do not consent to e-mail for messages of this kind. Opinions, conclusions and other information in this message represent the opinion of the sender and do not necessarily represent or reflect the views and opinions of Ferring.
**********************************************************************




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

* Re: begin update ... syntax error
  2004-04-10 21:32 begin update ... syntax error Kemin Zhou <kemin.zhou@ferring.com>
@ 2004-04-10 22:07 ` Adrian Klaver <aklaver@comcast.net>
  1 sibling, 0 replies; 4+ messages in thread

From: Adrian Klaver @ 2004-04-10 22:07 UTC (permalink / raw)
  To: pgsql-sql

On Saturday 10 April 2004 02:32 pm, Kemin Zhou wrote:
begin; Note the semi-colon
Then the update query;
commit; or rollback;
> I was trying to speed up a simple update query
>
> fri=# begin
> fri-# update tabA set nobegin=tmp.nobegin, noend=tmp.noend
> fri-# from tmp
> fri-# where tabA.acc=tmp.acc;
> ERROR:  syntax error at or near "update" at character 7
>
> The same query can be run with no problem if not starting with BEGIN.
>
> Does mean that BEGIN cannot preceed UPDATE?
>
> Or I am making some obvious miskate?
>
> Kemin
>
>
>
>
> **********************************************************************
> Proprietary or confidential information belonging to Ferring Holding SA or
> to one of its affiliated companies may be contained in the message. If you
> are not the addressee indicated in this message (or responsible for the
> delivery of the message to such person), please do not copy or deliver this
> message to anyone. In such case, please destroy this message and notify the
> sender by reply e-mail. Please advise the sender immediately if you or your
> employer do not consent to e-mail for messages of this kind. Opinions,
> conclusions and other information in this message represent the opinion of
> the sender and do not necessarily represent or reflect the views and
> opinions of Ferring.
> **********************************************************************
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html

-- 
Adrian Klaver	
aklaver@comcast.net



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

* Re: begin update ... syntax error
  2004-04-10 21:32 begin update ... syntax error Kemin Zhou <kemin.zhou@ferring.com>
@ 2004-04-10 22:19 ` Yasir Malik <ymalik@cs.stevens-tech.edu>
  1 sibling, 0 replies; 4+ messages in thread

From: Yasir Malik @ 2004-04-10 22:19 UTC (permalink / raw)
  To: Kemin Zhou <kemin.zhou@ferring.com>; +Cc: pgsql-sql

Kemin,
Instead of just begin, have "begin;" and put "commit;" at the end of the
SQL statement.  Go here for more information:
http://developer.postgresql.org/docs/postgres/tutorial-transactions.html

Regards,
Yasir

On Sat, 10 Apr 2004, Kemin Zhou wrote:

> Date: Sat, 10 Apr 2004 14:32:46 -0700
> From: Kemin Zhou <kemin.zhou@ferring.com>
> To: pgsql-sql@postgresql.org
> Subject: [SQL] begin update ... syntax error
>
> I was trying to speed up a simple update query
>
> fri=# begin
> fri-# update tabA set nobegin=tmp.nobegin, noend=tmp.noend
> fri-# from tmp
> fri-# where tabA.acc=tmp.acc;
> ERROR:  syntax error at or near "update" at character 7
>
> The same query can be run with no problem if not starting with BEGIN.
>
> Does mean that BEGIN cannot preceed UPDATE?
>
> Or I am making some obvious miskate?
>
> Kemin
>
>
>
>
> **********************************************************************
> Proprietary or confidential information belonging to Ferring Holding SA or to one of its affiliated companies may be contained in the message. If you are not the addressee indicated in this message (or responsible for the delivery of the message to such person), please do not copy or deliver this message to anyone. In such case, please destroy this message and notify the sender by reply e-mail. Please advise the sender immediately if you or your employer do not consent to e-mail for messages of this kind. Opinions, conclusions and other information in this message represent the opinion of the sender and do not necessarily represent or reflect the views and opinions of Ferring.
> **********************************************************************
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>



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

* Re: begin update ... syntax error
@ 2004-04-10 21:51 Gregory S. Williamson <gsw@globexplorer.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Gregory S. Williamson @ 2004-04-10 21:51 UTC (permalink / raw)
  To: Kemin Zhou <kemin.zhou@ferring.com>; pgsql-sql


try a semicolon after the begin ?

begin;
<code>
commit;

Greg Williamson
DBA
GlobeXplorer LLC

-----Original Message-----
From:	Kemin Zhou [mailto:kemin.zhou@ferring.com]
Sent:	Sat 4/10/2004 2:32 PM
To:	pgsql-sql@postgresql.org
Cc:	
Subject:	[SQL] begin update ... syntax error
I was trying to speed up a simple update query

fri=# begin
fri-# update tabA set nobegin=tmp.nobegin, noend=tmp.noend
fri-# from tmp
fri-# where tabA.acc=tmp.acc;
ERROR:  syntax error at or near "update" at character 7

The same query can be run with no problem if not starting with BEGIN.

Does mean that BEGIN cannot preceed UPDATE?

Or I am making some obvious miskate?

Kemin




**********************************************************************
Proprietary or confidential information belonging to Ferring Holding SA or to one of its affiliated companies may be contained in the message. If you are not the addressee indicated in this message (or responsible for the delivery of the message to such person), please do not copy or deliver this message to anyone. In such case, please destroy this message and notify the sender by reply e-mail. Please advise the sender immediately if you or your employer do not consent to e-mail for messages of this kind. Opinions, conclusions and other information in this message represent the opinion of the sender and do not necessarily represent or reflect the views and opinions of Ferring.
**********************************************************************


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html






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


end of thread, other threads:[~2004-04-10 22:19 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-10 21:32 begin update ... syntax error Kemin Zhou <kemin.zhou@ferring.com>
2004-04-10 22:07 ` Adrian Klaver <aklaver@comcast.net>
2004-04-10 22:19 ` Yasir Malik <ymalik@cs.stevens-tech.edu>
2004-04-10 21:51 Re: begin update ... syntax error Gregory S. Williamson <gsw@globexplorer.com>

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