Evaluting STRING expression as SQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lucianoc@gmail.com

    #1

    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_FU NCTION(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

  • Bill Karwin

    #2
    Re: Evaluting STRING expression as SQL

    lucianoc@gmail. com wrote:[color=blue]
    > It is possible to execute string expressions in mysql?[/color]

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

    Regards,
    Bill K.

    Comment

    Working...