MySQL Forums
Forum List  »  French

Re: variable dans le nom de la table d'un INSERT (procedure stockée)
Posted by: Thomas CORBIERE
Date: May 31, 2007 05:20AM

Bonjour,

Vous devez utiliser une requête préparée :

CREATE PROCEDURE p( IN nom_table VARCHAR(64) )
BEGIN
SET @requete = CONCAT( 'INSERT INTO ' , nom_table , '() VALUES()' ) ;
PREPARE rp FROM @requete ;
EXECUTE rp ;
DROP PREPARE rp ;
END //


Cordialement,

Thomas CORBIERE

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: variable dans le nom de la table d'un INSERT (procedure stockée)
4206
May 31, 2007 05:20AM


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.