Evaluting STRING expression as SQL

Evaluting STRING expression as SQL

am 31.05.2006 16:16:49 von Luciano Callero

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

Re: Evaluting STRING expression as SQL

am 31.05.2006 21:36:30 von Bill Karwin

lucianoc@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.