Evaluting STRING expression as SQL

Hi:
It is possible to execute string expressions in mysql?
I mean, i need to execute as SQL (in a SP) some string like this:

DECLARE sql;
DECLARE qid BigInt;
SET sql = 'SELECT * FROM table WHERE idx = ' + qid;
SOME_EXECUTE_FUNCTION(sql);

The real problem is: I have a table with 2 columns, 1 Autonumeric, and
2 VarChar column. In this varchars columns i store some table names. I
Need to retrieve one row (easily :)) and make a select in between this
2 tables that the varchars columns return. This must be inside a Stored
Procedure.

I Can't found anything in the web, it is this possible? how can i
solve?

Thank you beforehand
Luciano Callero [ Mi, 31 Mai 2006 16:16 ] [ ID #1336551 ]

Re: Evaluting STRING expression as SQL

lucianoc [at] gmail.com wrote:
> It is possible to execute string expressions in mysql?

Yes, read this doc page:
http://dev.mysql.com/doc/refman/5.0/en/sqlps.html

Regards,
Bill K.
Bill Karwin [ Mi, 31 Mai 2006 21:36 ] [ ID #1336552 ]
Datenbanken » mailing.database.mysql » Evaluting STRING expression as SQL

Vorheriges Thema: Why are databases created in /var/lib/mysql ???
Nächstes Thema: MYSQL SSL