pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <barwick@gmx.net>
To: Vincent Stoessel <vincent@xaymaca.com>
To: pgsql-sql@postgresql.org
Subject: Re: escaping arrays in perl dbi
Date: Fri, 10 May 2002 01:09:27 +0200
Message-ID: <200205100109.27473.barwick@gmx.net> (raw)
In-Reply-To: <3CDA83BB.5000006@xaymaca.com>
References: <3CDA83BB.5000006@xaymaca.com>

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



view thread (6+ messages)

Message-ID: <200205100109.27473.barwick@gmx.net>
Permalink:  ../200205100109.27473.barwick@gmx.net/
Also on:    postgresql.org/message-id/200205100109.27473.barwick@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barwick@gmx.net, vincent@xaymaca.com
  Subject: Re: escaping arrays in perl dbi
  In-Reply-To: <200205100109.27473.barwick@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox