Re: placeholder syntax - Mailing list pgsql-hackers

From Mike Mascari
Subject Re: placeholder syntax
Date
Msg-id 40D723AB.4050006@mascari.com
Whole thread Raw
In response to Re: placeholder syntax  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark wrote:

> Tom Lane <tgl@sss.pgh.pa.us> writes:
> 
>>Abhijit Menon-Sen <ams@wiw.org> writes:
>>
>>>Should Postgres accept ? as a placeholder?
>>
>>In short, I think this notation sucks and I don't want to emulate it.
> 
> Certainly it sucks. Unfortunately it's the supported ODBC API which is
> emulated by everyone else, including JDBC and DBI. So the world's pretty much
> stuck with it.
> 
> However this isn't Postgres's problem. If you want to write code that works
> with multiple databases then you're going to want to be using something like
> ODBC or JDBC or DBI anyways. In which case it's the driver's responsibility to
> provide the standard API which includes translating ? into appropriate syntax
> for the database.

This brings back memories. This is how the whole Access hack for the 
parse-time transformation of '= NULL' to 'IS NULL' came about. IIRC, 
older versions of Access would invoke SQLPrepare() with a statement 
like:

SELECT *
FROM employees
WHERE employeeid = ?

then invoke SQLBindParameter() with NULL as the value, followed by 
SQLExecute() and the backend would receive:

SELECT *
FROM employees
WHERE employeeid = NULL

Later versions of one of the Access components (jet, mdac, 
access.exe - who knows where) changed its behavior and never 
performed similarly...

Mike Mascari






pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: placeholder syntax
Next
From: "Thomas Hallgren"
Date:
Subject: Re: placeholder syntax