How to do simple variable substitution in sql querys

Jack <[email protected]> 24 Feb 2003 22:45:45 -0700
Newsgroups gmane.comp.lang.moto.user
Message-ID <[email protected]>
Hi,
Im sorta new to the moto language, and I don't know how to get a sql
query to work with variables.

Heres what I put in the forums.

Say, I'm really rather new to some of this - but it looks like something
I'd like to know more about. In any case, I'm working on a web form
which makes queries to a MySQL db which has a single table and 4 fields.
I cannot figure out how to subsitute variables into the query string.
Ex: $declare(String query = "Select * from transactions")
Now, it'd be nice to understand how to make it so I didn't have to put
the actual table name in there - transactions. Rather, I'd like to be
able to have a query string such as: $declare(String query = "Select *
from $table_name"), but this does not seem to work. How is this supposed
to be done? 

Thanks,
Jack