Re: [gnome-db] parameters in SQL commands



* [ Rodrigo Moya <rodrigo gnome-db org>
* Mon, 30 Sep 2002 12:13:54 +0200 ]
> My idea is to use a generic format for the placeholders (:name, for
> instance) and add a new function that just gets a SQL string and a
> GdaParameterList, and which replaces the placeholders with the values in
> the parameter list.

Agree.

> 
> So, the only question is what format to use for the placeholders. I
> think it is not very important, since the string will be parsed before
> being sent to the DBMS, but anyway, we should be sure we use something
> that doesn't conflict with some SQL dialects or whatever.
> 
> Ideas? If nobody disagrees, I'll use :name.

But... what we should support are prepared statements.

For the providers that don't support them, we can simulate it (ie, we
generate the whole SQL statement from the parameters and the place
holders).

For the rest, we should use whatever the DB backend uses for prepared
statements and use its native interface. Why? Performance.

-Gonzalo

-- 
Gonzalo Paniagua Javier <gonzalo gnome-db org>
http://www.gnome-db.org/~gonzalo/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]