problems - prepared statement within stored procedure
Dear friends,
I am just using a simple SP like below:
CREATE PROCEDURE sp_load_new_occurrences_data_from_file()
BEGIN
SET tab = 'abc';
SET @s = CONCAT("DROP TABLE IF EXISTS ", tab);
PREPARE stmt FROM @s;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END |
I can run the SP alone without problem. However, when I trying to use it with Perl code, I alway receive below error:
DBD::mysql::st execute failed: PROCEDURE mysql5_test.sp_load_new_occurrences_data_from_file can't return a result set in the given context at ...
This problem is really bad because I cannot use any SP within perl code. I googled this problem, somebody said we can solve the problem by setting client flag CLIENT_MULTI_RESULTS. However, I didnt find any approach to enable this flag in Perl DBI.
Anyone know how to set this flag in Perl DBI, or other method to solve the "return a result set" problem?
Many thanks!!!
I am using mysql-5.0.22.
Subject
Written By
Posted
problems - prepared statement within stored procedure
November 13, 2007 04:39PM
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.