Received: from mail4.lig.bellsouth.net (mail4.lig.bellsouth.net [207.203.120.43]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3O1hj361541; Mon, 23 Apr 2001 21:43:45 -0400 (EDT) (envelope-from rgp@systame.com) Received: from [216.77.205.159] (host-216-77-205-159.psl.bellsouth.net [216.77.205.159]) by mail4.lig.bellsouth.net (3.3.5alt/0.75.2) with ESMTP id VAA11751; Mon, 23 Apr 2001 21:43:41 -0400 (EDT) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Mon, 23 Apr 2001 21:41:51 -0400 Subject: Re: Var substitution in SELECT statements From: Randall Perry To: , Message-ID: In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Archive-Number: 200104/992 X-Sequence-Number: 8206 on 4/23/01 9:20 PM, Randall Perry at rgp@systame.com wrote: > This works: > $res = $conn->exec("select cust, contact, user_name, email from $t where > user_name = a1a"); > > This doesn't: > $c = "a1a"; > $res = $conn->exec("select cust, contact, user_name, email from $t where > user_name = $c"); > > and returns the error: > Attribute 'a1a' not found > > > How do you do var substitution with the Pg module in Perl? Whoops! Needed to quote the var as so (for $c above): $c = "\'$c\'"; Works now. -- Randy Perry sysTame Mac Consulting/Sales