MySQL Forums
Forum List  »  General

Re: SELECT .. INTO OUTFILE not possible with stored procedure parameters?
Posted by: Klas Karlsson
Date: June 02, 2006 05:04AM

Edit:
Now got an answer from support on how to use preared statements like this:

CREATE PROCEDURE export_dynamic(IN file_name char(64))
BEGIN
set @myvar = concat('SELECT * INTO OUTFILE ',"'",file_name,"'",' FROM Table1') ;
PREPARE stmt1 FROM @myvar;
EXECUTE stmt1;
Deallocate prepare stmt1;
END;

Which works ! :)
Thnaks for the input anyway...
/K

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.