Re: [gnome-db] Studying the posibility to add parametrized statements
- From: Dru <andru treshna com>
- To: Vivien Malerba <vmalerba gmail com>
- Cc: gnome-db-list <gnome-db-list gnome org>, Jeronimo Albi <amenofisvii yahoo com ar>
- Subject: Re: [gnome-db] Studying the posibility to add parametrized statements
- Date: Mon, 11 Oct 2004 20:37:17 +1300
Vivien Malerba wrote:
On Sun, 10 Oct 2004 13:43:05 +0000, Jeronimo Albi
<amenofisvii yahoo com ar> wrote:
[...]
How should i replace parameters with a token to be interpreted by
a database engine as parameter. For example in Firebird:
a. Original statement:
SELECT name FROM table WHERE name=## [:name="User name"]
b. Parsed statement shuld be:
SELECT name FROM table WHERE name=?
where "?" is interpreted as parameter.
The problem with the structures built by the parser is that they are
very efficient for parsing a query, but not adapted to render a
structure as a SQL statement. I don't have this problem in libmergeant
since I never use that feature (the sql_statement structure is used to
create MgQuery objects and then discarded, and then the MgQuery is
responsible to do its own rendering taking into account the real
values for the parameters).
Creating statements for insert/delete/update is pretty easy
without using the sql parser. Its strength is pulling apart
select statements so you know exactly whats been asked.
Should anything be done for its future direction?
Does #sql_update_statement and #sql_delete_statement structures
support parameters ?
Yes, they are supported, as for the SELECT statements; this is used in
libmergeant.
Cheers,
Vivien
_______________________________________________
gnome-db-list mailing list
gnome-db-list gnome org
http://mail.gnome.org/mailman/listinfo/gnome-db-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]