From: Joao Paulo Felix <felix@cyclades.com>
To: pgsql-general@postgreSQL.org <pgsql-general@postgreSQL.org>
Subject: Updating multiple fields
Date: Fri, 26 Jun 1998 10:20:38 -0700
Message-ID: <3593D866.7C23664E@cyclades.com> (raw)
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
________________________________________________________________
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: felix@cyclades.com, pgsql-general@postgreSQL.org
Subject: Re: Updating multiple fields
In-Reply-To: <3593D866.7C23664E@cyclades.com>
References: <3593D866.7C23664E@cyclades.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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