DBI and placeholders question - Mailing list pgsql-general

From mike
Subject DBI and placeholders question
Date
Msg-id 1108406519.9335.17.camel@datacc
Whole thread Raw
Responses Re: DBI and placeholders question
List pgsql-general
Is it possible to have a placeholder on the left side of a select
criteria?

eg:

SELECT CASE WHEN date_part('dow',?::date)=5

this bit is fine

THEN CASE WHEN ? = 2 OR ? =3 OR ?=6 OR ?=7 OR ?=8 OR ?=12 THEN '7:00'

here the ? is being read as NULL ie, output from LOG

SELECT CASE WHEN date_part('dow', '2005-02-28'::date)=5 THEN CASE WHEN
NULL = 2 OR  NULL =3 OR  NULL=6 OR  NULL=7 OR  NULL=8 OR  NULL=12 THEN
'7:00' WHEN  NULL = 1 OR  NULL =5 OR  NULL=13 THEN '3:30' ELSE  NULL
END

I am getting the ? translated as nulls

apologies for off-topic, but any help appreciated

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: SQL Injection possible on custom functions
Next
From: Bruce Momjian
Date:
Subject: Re: possible bug with compound index.