Thread

  1. Updating multiple fields

    Joao Paulo Felix <felix@cyclades.com> — 1998-06-26T17:20:38Z

    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
    ________________________________________________________________
    
    
  2. RE: [GENERAL] Updating multiple fields

    Rob den Boer <rdboer@hrs-rotterdam.nl> — 1998-06-30T11:16:38Z

    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