Using CFQUERY / CFSTOREDPROC to execute PostgreSQL
I’m converting a database from MS‑SQL to PostgreSQL and I need to change the calls to the Stored Procedures.
I rewrote them in PostgreSQL, and when I try to execute them, it returns an error saying that the procedure’s cursor does not exist.
For example, a call that used to be:
<cfquery name="getApp_Version">
EXEC sp_app_version;
</cfquery>
Was changed to:
<cfquery name="getApp_Version">
BEGIN;
CALL "public"."sp_app_version"('c1');
FETCH NEXT FROM c1;
COMMIT;
</cfquery>
And the following message appes:
ERROR: cursor "c1" does not exist
I was advised to convert the procedures into functions to solve the problem, but there are too many procedures to rewrite.
Is there a way to call Stored Procedures in PostgreSQL without getting this error?
