MySQL Forums
Forum List  »  Stored Procedures

Error : Not allowed to return a result set from a function
Posted by: Fernando Rodelo
Date: October 12, 2009 12:02AM

Como debe definirse la siguiente funcion para que no se de el error "Not allowed to return a result set from a function"

DELIMITER \\
CREATE FUNCTION bd_devNewvalue(pbase varchar(10))
RETURNS varchar(10)
BEGIN
DECLARE newdocn numeric(10);
DECLARE newdocc varchar(10);

SELECT CAST(pbase AS DECIMAL)+1 INTO newdocn;
SELECT LPAD(newdocn, 10, '0') INTO newdocc;

RETURN(newdocc);
END\\


Supongase que pbase = 5 y se desea obtener 0000000005

Options: ReplyQuote


Subject
Views
Written By
Posted
Error : Not allowed to return a result set from a function
3195
October 12, 2009 12:02AM


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.