Received: from tech.com.au (IDENT:root@techpt.lnk.telstra.net [139.130.75.122]) by hub.org (8.9.2/8.9.1) with ESMTP id LAA85158 for ; Fri, 16 Apr 1999 11:28:20 -0400 (EDT) (envelope-from chris.bitmead@bigfoot.com) Received: from bigfoot.com (chris@localhost [127.0.0.1]) by tech.com.au (8.8.7/8.8.7) with ESMTP id BAA25358 for ; Sat, 17 Apr 1999 01:27:36 +1000 Sender: chris@tech.com.au Message-ID: <371756E6.7AB8FEF1@bigfoot.com> Date: Fri, 16 Apr 1999 15:27:34 +0000 From: Chris Bitmead X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.0.36 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgreSQL.org Subject: Re: [SQL] UPDATE subselect? References: <371736C4.96C8469E@bigfoot.com> <37175024.21E29E50@sferacarta.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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