0

I have a stored procedure that returns some data from a table. I want to use that data in another query by calling the stored procedure. this is what I've tried so far:

SELECT T.ID, T.USER_ID, T.CONTENT, T.POSTAGE
    FROM post as T
    WHERE T.USER_ID  (CALL MyFollowers());

I get a syntax error on CALL. so I guessed I cant use return value of a stored procedure on IN or EXISTSkeyword. is there any other way to do this?

  • I you can show what `MyFollowers` does then other answers may be possible. Did you create the procedure to solve some specific problem? Which MySQL version? – danblack Jul 06 '21 at 05:57

1 Answers1

0

after some searching I found this:

The problem is, Stored Procedures don't really return output directly. They can execute select statements inside the script but have no return value. MySQL calls stored procedures via CALL StoredProcedureName(); And you cannot direct that output to anything, as they don't return anything (unlike a function). MySQL Call Command

the original post is here