Updating multiple fields

From: Joao Paulo Felix <felix(at)cyclades(dot)com>
To: "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Updating multiple fields
Date: 1998-06-26 17:20:38
Message-ID: 3593D866.7C23664E@cyclades.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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
________________________________________________________________

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Lynch 1998-06-26 18:44:28 Re: [GENERAL] Updating multiple fields
Previous Message Joerg Schultz 1998-06-26 16:49:39 pg_dump failed sanity check

Browse pgsql-sql by date

  From Date Subject
Next Message Kachun Lee 1998-06-26 17:42:03 isnull function
Previous Message Bruce Momjian 1998-06-26 02:13:47 Re: [SQL] SQL Bug?