Re: escaping arrays in perl dbi

From: Ian Barwick <barwick(at)gmx(dot)net>
To: Vincent Stoessel <vincent(at)xaymaca(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: escaping arrays in perl dbi
Date: 2002-05-09 23:09:27
Message-ID: 200205100109.27473.barwick@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-05-10 02:31:33 Re: Help with indexes
Previous Message Vincent Stoessel 2002-05-09 21:00:12 Re: escaping arrays in perl dbi