MySQL Forums
Forum List  »  Stored Procedures

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
Re: Problem with stored procedures on phpmyadmin
323
August 17, 2016 11:23AM


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.