Variables in DB Query Builder

Jan Schenkel janschenkel at
Mon Dec 18 15:40:07 EST 2006

--- Horst <baleareninsel at> wrote:
> Holá SQL-Professionals,
> I´m thinking, how to put a variable Part in the
> SQL-Message of the DB Query
> builder
> f.e.
> Select Landname, Landvorwahl from land_kz where
> Landname BETWEEN "A%" AND
> "¦"  ORDER BY Landname ASC;
> How to put the variable instead of "A%" witch makes
> by the way, no sense.
> Thanks for many good ideas and don´t let me alone
> :-)
> Best regards
> Horst

Hi Horst,

The automated database queries don't currently provide
for a method to place 'variables' inside the SQL

For now the easiest way to achieve dynamic queries is
to save a template query somewhere, and fill in the
dynamic parts, then update the SQL of the query using
the undocumented command "'revSetSQLOfQuery <name of
the query>,<sql statement>".
An example :
on mouseUp
  put "123456" into tCustomerID # or some field data
  put "SELECT * FROM orders WHERE customerid='" & \
         tCustomerID & "'" into tSQLStatement
  revSetSQLOfQuery "orders",tSQLStatement
end mouseUp

Hope this helped,

Jan Schenkel.

Quartam Reports for Revolution

"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Use-livecode mailing list