It always gives the error
#1415 : Not allowed to return a result set from a function.
pickup_request is a table; schedule_time is datetime variable and customer_id is the primary key and varchar(45) variable
It always gives the error
#1415 : Not allowed to return a result set from a function.
pickup_request is a table; schedule_time is datetime variable and customer_id is the primary key and varchar(45) variable
You need to store the output of all your SELECT queries into variables using INTO
+ name of variable. In your example SELECT schedule_time INTO @schedule_time
Check also the answers to Why mysql is giving error "Not allowed to return a result set from a function"?