Variables in DB Query Builder
Jan Schenkel
janschenkel at yahoo.com
Mon Dec 18 15:40:07 EST 2006
--- Horst <baleareninsel at gmx.net> wrote:
>
> Hol SQL-Professionals,
>
> Im 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 dont 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
query.
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
<http://www.quartam.com>
=====
"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
http://mail.yahoo.com
More information about the use-livecode
mailing list