MySQL Forums
Forum List  »  Stored Procedures

User defined variable in the stored function
Posted by: Alex Graham
Date: September 30, 2019 11:26AM

Hello guys.
I have this stored function
----
CREATE DEFINER=`root`@`localhost` FUNCTION `horw`(Y DOUBLE, n DOUBLE,alpha DOUBLE,t JSON) RETURNS double
READS SQL DATA
DETERMINISTIC
BEGIN

RETURN t;
END
---
and stored procedure
---
CREATE DEFINER=`root`@`localhost` PROCEDURE `Estimation_Methods`()
BEGIN
declare Y DOUBLE;
declare n DOUBLE;
declare alpha DOUBLE;
declare t CHAR;
SET Y=10000000;
SET n=56;
SET alpha=0.05;
SET t = '[1,2]';
SELECT horw(Y,n,alpha,t);
END
---
So I have json array as a variable in the function.
When I call the procedure with t I get Error Code: 1406. Data too long for column 't' at row 1
I also tried using @t in the procedure, no result.
What the data type should I need to use in the stored function for json array t?
Regards,

Options: ReplyQuote


Subject
Views
Written By
Posted
User defined variable in the stored function
601
September 30, 2019 11:26AM


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.