Forum OpenACS Development: Response to Query Extractor and Query Dispatcher

Collapse
Posted by Don Baccus on
I'm not sure the QE is going to be able to help with dynamic queries, which are being mapped with db_map calls in the "set" command that builds a query snippet (or 100% dynamic queries).

Flagging fully dynamic queries would be sufficient.

If I have:

set foo "select foo from bar"

db_... dynamic_foo $foo ...

The translation is

set foo [db_map foo "select foo from bar"]

db_... dynamc_foo $foo

There's really nothing in the "set" statement that the QE can recognize.

Also queries buried in query files can now have Tcl variables in them,  so you can have something like:

<fullquery ...> ...

select foo from bar where $foo_where_clause

</fullquery>

And the Tcl variable will be substituted.  These can be put into the .xql file (I think they are already?).  The "set" command that builds "foo_where_clause" that needs to be modified to use db_map.  A flag in the .xql file indicating a dynamic query would help folks out, though grepping for dollar signs helps too!