Results 1 to 2 of 2

Thread: Passing table names to functions as parameters

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Passing table names to functions as parameters

    I have a function to split a string in MYSQL.

    After splitting the string I store them in a temporary table.

    I plan to use it in different SPs.

    So I plan to pass the string to be split, the delimiter and the table name.

    Please help me. If you know of some link where I can learn more of this, please get me the link.

  2. #2
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1

    Prepared Statements

    You could try to use prepared statements
    first :
    SET @sql = CONCAT("INSERT INTO TABLE ",tblname," VALUES('",string,"')");
    PREPARE stmnt FROM @sql;
    EXECUTE stmnt;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •