Personally, I agree. The '?' sucks for multiple reasons. The major reason
being when you want to use the same parameter in more than one place in a
statement. Another reason is query rewrites where you have to reorganize the
actual order of parameters. You are then forced to first convert the '?'
into some other form (like the $1, $2 syntax that PostgreSQL uses today).

But even if it sucks, it's used by a very broad range of clients. As Greg
mentions, both ODBC and JDBC uses this syntax and no other SQL database that
I know of treats '?' as an operator. The '?' is, and will remain, a
parameter placeholder in SQL for most people. So even if '?' shouldn't be
emulated at this time, perhaps it would be a good idea to abandon it as a
valid operator?

Kind regards,

Thomas Hallgren

"Greg Stark" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Tom Lane <[EMAIL PROTECTED]> writes:
>
> > Abhijit Menon-Sen <[EMAIL PROTECTED]> 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.
>
> In other words, your problem should already be solved by your driver.
>
> -- 
> greg
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
>


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to