Re: Quoting '?' placeholder in Perl's DBD::Pg?

From: Keary Suska <hierophant(at)pcisys(dot)net>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Quoting '?' placeholder in Perl's DBD::Pg?
Date: 2001-09-27 20:15:13
Message-ID: B7D8E4F1.3C46%hierophant@pcisys.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I think you are supposed to escape placeholder markers by doubling them: ??
should be effectively changed to '?' before passed to PG. I haven't come
across this yet, but I think that's the correct (although undocumented)
syntax.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
> Date: Fri, 28 Sep 2001 00:40:50 +0800
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Quoting '?' placeholder in Perl's DBD::Pg?
>
> Hi anyone know how I can quote or turn off the ? placeholder in Perl's
> DBD::Pg?
>
> I've asked on the perl modules newsgroups but I didn't get any satisfactory
> answer.
>
> Say I'm constructing a custom SQL query and it turns out that there is a ?
> somewhere, how do I quote it out? It gets recognised as a placeholder by
> the DBD::Pg driver.
> e.g.
> my $SQL=<<"EOT";
> insert into blah (a,b) values ('asdad?rerwe','blah')
> EOT
>
> The ? gets interpreted as a placeholder.
>
> Sure I can do
> my $SQL=<<"EOT";
> insert into blah (a,b) values (?,?)
> EOT
>
> And do the execute thing. But if the number of columns changes from query
> to query, and so on it might be less convenient to use placeholders.
>
> If it really can't be done, then yeah I'll use placeholders. But it seems
> strange if you can't.
>
> Cheerio,
> Link.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Keary Suska 2001-09-27 20:19:23 Re: what is wrong with this SQL?
Previous Message Nick Fankhauser 2001-09-27 19:54:13 Re: backend stalls