I'm sorry if this issue is so simple. I have some query that can run normally in MySQL Stored Procedure. But now I'm migrating it to PostgreSQL, that query is result of Concat from another query. The query simply like this:
DECLARE A TEXT; BEGIN A = concate(sql); /*in MySQL I just use SET A = CONCATE(sql)*/ PREPARE stmt AS A; /* in MySQL normally run with PREPARE stmt FROM A;*/ EXECUTE stmt; END
But I always get an error :
ERROR: syntax error at or near "A" LINE 85: PREPARE stmt AS A;
My questions are :
PREPARE, is there any different of result when we run the query? If use
PREPAREwhat is the advantages? Thanks expert!