Archive

Archive for the ‘MySQL’ Category

PERL MYSQL DBD::mysql::st execute failed: PROCEDURE - can’t return a result set in the given context

August 31st, 2008

So I kept getting this error using DBD-mysql. DBD::mysql::st execute failed: PROCEDURE Data.getToday can’t return a result set in the given context at demo.pl line 15. The problem turned out to be that, I was using version 3.002 of the MySQL driver. I upgraded to 4.005 and all was good! Hope this helps you out…

Greg MySQL

How to Create a Stored Proc in MySQL

May 15th, 2008

I haven’t seen this very well and clearly documented, as far as passing parameters go. Here is a simple create user proc.

DELIMITER $$

DROP PROCEDURE IF EXISTS `portfoliomanager`.`createNewUser` $$
CREATE PROCEDURE `portfoliomanager`.`createNewUser` (IN username varchar(45),IN pass varchar(45))
BEGIN
INSERT INTO portfoliomanager.users (email,password) VALUES(username,pass);
END $$

DELIMITER ;

Greg MySQL