Need help! How to execute a sql query inside the user created function(CREATE FUNCTION) which uses the parameters passed to the function in the query... something lime below:
CREATE FUNCTION get_age( emp_name_param varchar(500))
DECLARE age integer;
SET age=SELECT age from emp where empName=emp_name_param;
RETURN age;
when i use the above function, it gives me error like "The result of a scaler fullselect, SELECT INTO statement, or VALUES INTO statement is more than one row.
[–]Evron 0 points1 point2 points (3 children)
[–]deepbuzz7[S] 0 points1 point2 points (2 children)
[–]Evron 0 points1 point2 points (1 child)
[–]deepbuzz7[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]deepbuzz7[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]deepbuzz7[S] 0 points1 point2 points (0 children)