Reputation: 37
I have written the following SQL query:
CREATE PROCEDURE query_05_b(OUT rez VARCHAR(200))
BEGIN
rez := "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
END
When I try to run it, I get the following error message:
MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':= "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);"' at line 3
Can you help me understand what is the problem with the query that I have written because I really don't understand where is the mistake.
Thank you!
Upvotes: 0
Views: 74
Reputation: 31397
I believe you are trying to return SQL string, then
You have wrong syntax
rez := "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
instead
SET rez = "SELECT numean FROM angajati WHERE idan IN (SELECT idan FROM certificare);";
Upvotes: 2