Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4423A9F9DA8 for ; Wed, 10 Oct 2007 14:59:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 64174-03 for ; Wed, 10 Oct 2007 14:59:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from n054.sc0.he.tucows.com (smtpout1120.sc0.he.tucows.com [64.97.144.120]) by postgresql.org (Postfix) with ESMTP id 592CE9FA50E for ; Wed, 10 Oct 2007 14:59:34 -0300 (ADT) Received: from dreamland (74.94.66.41) by n054.sc0.he.tucows.com (7.2.069.1) (authenticated as ray@madigans.org) id 470BEAD300030831 for pgsql-sql@postgresql.org; Wed, 10 Oct 2007 17:59:30 +0000 From: "Ray Madigan" To: "Pgsql-Sql" Subject: Computed table name in function Date: Wed, 10 Oct 2007 10:59:28 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/49 X-Sequence-Number: 29421 I have a problem that I don't know where to look to understand the problem. I have a function that I first select to get a table name followed by another select into on that table name. If someone could tell me where to look to solve this problem I would appreciate it. It is something like DECLARE rec1 Record; rec2 Record; SELECT aName INTO rec1 FROM tableA WHERE new.xxx = ?; IF FOUND THEN SELECT * INTO rec2 FROM rec1.aName where new.xxx = ?; Thanks