Re: what is the equivalent to EXEC()
Hi Hugues,
When executing the following SP does not generate error. We are speaking of 925 rows.
DELIMITER $$
DROP PROCEDURE IF EXISTS `sptest`$$
CREATE PROCEDURE `sptest`()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE _TableName, _TableSchema, _TableType VARCHAR(64);
DECLARE cur CURSOR FOR
SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur;
REPEAT FETCH cur INTO _TableName, _TableSchema, _TableType;
IF NOT done THEN
PREPARE stmt1 FROM 'SELECT "ok"';
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
END IF;
UNTIL done END REPEAT;
CLOSE cur;
END$$
DELIMITER ;
Subject
Views
Written By
Posted
43867
May 07, 2007 06:22AM
17886
May 07, 2007 07:34AM
9717
May 07, 2007 08:53AM
Re: what is the equivalent to EXEC()
6698
May 07, 2007 09:22AM
4031
May 07, 2007 09:37AM
3803
May 07, 2007 08:30PM
3621
May 08, 2007 04:20AM
3839
May 08, 2007 04:29AM
6980
July 30, 2007 08:10AM
4172
July 30, 2007 02:05PM
3898
August 01, 2007 10:06AM
4735
August 02, 2007 10:13AM
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.