I cannot put instruction < PREPARE > in a trigger
here my table :
CREATE TABLE `test` (
`id_test` int(8) NOT NULL auto_increment,
`designation` varchar(100) default NULL,
`val_date` date default NULL,
PRIMARY KEY (`id_test`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
here my trigger
create trigger test AFTER INSERT ON test
FOR EACH ROW
BEGIN
DECLARE F VARCHAR(255);
SET F=CONCAT(NEW.id_test,'_',UNIX_TIMESTAMP(Now()));
SET @S=CONCAT('select * INTO OUTFILE ''e:/maj/',F,'.txt'' FIELDS TERMINATED BY '';'' LINES TERMINATED BY ''\r\n'' from test where id_test=',NEW.id_test);
PREPARE stmt FROM @S;
EXECUTE stmt;
DROP PREPARE stmt;
END;
at the time of creation it marks :
"Dynamic SQL is not allowed in stored function or trigger"
my goal is to create a file following an action, with a site to use it later
Subject
Views
Written By
Posted
I cannot put instruction < PREPARE > in a trigger
3367
February 21, 2006 01:16PM
2042
February 24, 2006 08:47AM
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.