MySQL Forums :: Stored Procedures :: Problem with stored procedures on phpmyadmin


Advanced Search

Re: Problem with stored procedures on phpmyadmin
Posted by: Andrew James ()
Date: August 17, 2016 11:23AM

I tested GetAllFiles() procedure like this:

DELIMITER go

Create procedure GetAllFiles()
BEGIN
DECLARE CheckExists int;

DECLARE specialty CONDITION FOR SQLSTATE '45000';

SET CheckExists = 0;
SELECT COUNT(files.FileID) INTO CheckExists from
files,Users where files.UserID = Users.UserID group by files.FileID;
IF (CheckExists < 0) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Files does not exists';
ELSE
select files.Files,Users.firstname,Users.lastname,Users.EmailAddress from files,Users
where files.UserID = Users.UserID group by files.FileID
END IF;
END
DELIMITER ;

It executed that stored procedure. Then I decided to test the COUNT(files.FileID)without calling stored procedure by using SELECT COUNT(files.FileID) from files,Users where files.UserID = Users.UserID group by files.FileID and the result is

" COUNT(files.FileID)
1
1
1
1"

However when calling by testing the stored procedure i used CALL GetAllFiles(); and the result is an error message saying:"Error

SQL query:

CALL GetAllFiles()

MySQL said: Documentation
#1172 - Result consisted of more than one row"

Options: ReplyQuote


Subject Views Written By Posted
Problem with stored procedures on phpmyadmin 2662 Andrew James 08/11/2016 03:20PM
Re: Problem with stored procedures on phpmyadmin 333 Peter Brawley 08/11/2016 06:41PM
Re: Problem with stored procedures on phpmyadmin 290 Andrew James 08/12/2016 12:07PM
Re: Problem with stored procedures on phpmyadmin 302 Peter Brawley 08/12/2016 12:31PM
Re: Problem with stored procedures on phpmyadmin 300 Andrew James 08/16/2016 02:37PM
Re: Problem with stored procedures on phpmyadmin 271 Peter Brawley 08/16/2016 02:52PM
Re: Problem with stored procedures on phpmyadmin 303 Andrew James 08/17/2016 11:23AM
Re: Problem with stored procedures on phpmyadmin 285 Peter Brawley 08/17/2016 12:17PM
Re: Problem with stored procedures on phpmyadmin 291 Andrew James 08/17/2016 02:35PM
Re: Problem with stored procedures on phpmyadmin 288 Peter Brawley 08/17/2016 04:19PM


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.