Received: from bjke.com (firewall-user@ganymede.bjke.com [144.210.8.38]) by hub.org (8.9.2/8.9.1) with ESMTP id MAA92027 for ; Fri, 16 Apr 1999 12:34:55 -0400 (EDT) (envelope-from djackson@cpsgroup.com) Received: by bjke.com; id LAA17482; Fri, 16 Apr 1999 11:34:52 -0500 (CDT) Received: from unknown(144.210.12.10) by gauntlet.bjke.com via smap (4.1) id xma017313; Fri, 16 Apr 99 11:34:41 -0500 Received: by cpsmail with Internet Mail Service (5.5.2448.0) id <2D6760FQ>; Fri, 16 Apr 1999 11:35:26 -0500 Message-ID: From: "Jackson, DeJuan" To: Chris Bitmead , pgsql-sql@postgreSQL.org Subject: RE: [SQL] UPDATE subselect? Date: Fri, 16 Apr 1999 11:35:21 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id MAA92030 try: UPDATE category SET parent[0] = mfr.oid FROM mfr WHERE mfr.name='canon'; -DEJ > José Soares wrote: > > > > Take a look at PostgreSQL User's Guide > > Chapter 10. Arrays > > Which doesn't help me because I need to update individual array elements > from subselects. > > > > > syntax: > > INSERT INTO SAL_EMP > > VALUES ('Bill', > > '{10000, 10000, 10000, 10000}', > > '{{"meeting", "lunch"}, {}}'); > > > > José > > > > Chris Bitmead ha scritto: > > > > > What is the correct syntax for this UPDATE? > > > > > > CREATE TABLE category ( > > > name text, > > > image text, > > > url text, > > > parent oid[] > > > ); > > > update category set parent = '{0,0}' where name='slr'; > > > So far so good... > > > update category set parent[0] = (SELECT oid from mfr where > > > name='canon'); > > > ERROR: parser: parse error at or near "select" > > > > > > -- > > > Chris Bitmead > > > http://www.bigfoot.com/~chris.bitmead > > > mailto:chris.bitmead@bigfoot.com > > -- > Chris Bitmead > http://www.bigfoot.com/~chris.bitmead > mailto:chris.bitmead@bigfoot.com