Re: escaping arrays in perl dbi - Mailing list pgsql-sql

From Ian Barwick
Subject Re: escaping arrays in perl dbi
Date
Msg-id 200205100109.27473.barwick@gmx.net
Whole thread Raw
In response to escaping arrays in perl dbi  (Vincent Stoessel <vincent@xaymaca.com>)
List pgsql-sql
On Thursday 09 May 2002 16:12, Vincent Stoessel wrote:
> Hello All,
> I am trying to figure out how I need to change the string below in
> order to do an insert into my table using perl dbi. perl seems to choke
> on the curly brackets.

It's choking on the unescape quotes...

> $dbh->do("update basket set f_order ='{"apple",0}' where cap ='I'");

qq is your friend:

$dbh->do(qq|update basket set f_order ='{"apple",0}' where cap ='I'|);

Type

perldoc perlop

into a nearby commandline and look for the section "Quote and Quote-like
Operators" for more info.


Ian Barwick


pgsql-sql by date:

Previous
From: Vincent Stoessel
Date:
Subject: Re: escaping arrays in perl dbi
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Help with indexes