Var substitution in SELECT statements

From: Randall Perry <rgp(at)systame(dot)com>
To: <pgsql-interfaces(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Var substitution in SELECT statements
Date: 2001-04-24 01:20:35
Message-ID: B70A4D23.A28D%rgp@systame.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

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?

--
Randy Perry
sysTame
Mac Consulting/Sales

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Randall Perry 2001-04-24 01:41:51 Re: Var substitution in SELECT statements
Previous Message Vince Vielhaber 2001-04-24 01:16:30 Re: [HACKERS] Re: Hardcopy docs available

Browse pgsql-interfaces by date

  From Date Subject
Next Message Randall Perry 2001-04-24 01:41:51 Re: Var substitution in SELECT statements
Previous Message Rich Handler 2001-04-23 18:43:31 Problem importing auto-increment fields in MS Access to PostgreSQL.