pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Updating multiple fields
2+ messages / 2 participants
[nested] [flat]

* Updating multiple fields
@ 1998-06-26 17:20  Joao Paulo Felix <felix@cyclades.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Joao Paulo Felix @ 1998-06-26 17:20 UTC (permalink / raw)
  To: pgsql-general@postgreSQL.org <pgsql-general@postgreSQL.org>

Hello there, 

I have the following fields description, info and title.
Is there a PostgreSQL query to update more than one field at the same
time? 

Right now I have the following (I am using it with PHP, so please
desregard its code):

pg_Exec($conn, "UPDATE options SET description = '$description' 
	WHERE product = '$product' AND title = '$old_title';");

pg_Exec($conn, "UPDATE options SET info = '$info' 
	WHERE product = '$product' AND title = '$old_title';");

pg_Exec($conn, "UPDATE options SET title = '$title' 
	WHERE product = '$product' AND title = '$old_title';");

Ultimately I would like to have one single query. Is it possible?

Thanks in advance for your help/pointers.

Regards,

JP

-- 
________________________________________________________________

Joao Paulo Felix 
Interactive Media Coordinator

Cyclades Corporation                    voice: (510) 770-9727
41934 Christy Street                    fax: (510) 770-0355
Fremont, CA                             www.cyclades.com
________________________________________________________________



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

* RE: [GENERAL] Updating multiple fields
@ 1998-06-30 11:16  Rob den Boer <rdboer@hrs-rotterdam.nl>
  parent: Joao Paulo Felix <felix@cyclades.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Rob den Boer @ 1998-06-30 11:16 UTC (permalink / raw)
  To: Joao Paulo Felix <felix@cyclades.com>; +Cc: Pgsql-Sql <pgsql-sql@hub.org>

Hi Joao,

> -----Original Message-----
> From: owner-pgsql-general@hub.org [mailto:owner-pgsql-general@hub.org]On
> Subject: [GENERAL] Updating multiple fields

How about this:

pg_Exec($conn, "UPDATE options SET description = '$description' , info =
'$info' , title = $title'  WHERE product = '$product' AND title =
'$old_title';");

regards
Rob den Boer





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


end of thread, other threads:[~1998-06-30 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-06-26 17:20 Updating multiple fields Joao Paulo Felix <felix@cyclades.com>
1998-06-30 11:16 ` Rob den Boer <rdboer@hrs-rotterdam.nl>

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