I am trying to call a “stored procedure” (i.e. no return value) from Lucee, but I get this error:
(ERROR: sp_notify(character varying, character varying, character varying, character varying) is a procedure Hint: To call a procedure, use CALL. Position: 15)
I can’t easily change the code in the database, as it is called from other places (and languages). I can make a call to a PostgreSQL stored function without issue.
Which version of the PostgreSQL driver (extension) are you using?
Please always describe your stack when asking for help.
By default, Lucee installs the 9.4.1212 which is old, there is a newer Postgres 42.1.4 JDBC driver,
but oddly it doesn’t get flagged as needing to be upgraded, except within the extension
page
This is what is in the bundles on the admin, so looks good to me.
PostgreSQL JDBC Driver - JDBC 4.2 (org.postgresql.jdbc42)
Java JDBC 4.2 (JRE 8+) driver for PostgreSQL database 42.1.4 Aug 1, 2017 696kb PostgreSQL Global Development Group PostgreSQL active
Sorry, I have no idea what ACF is. This was “myFirstScript.cfm” tinkered to include some DB code, as I start to play.
It looks to me, that it still thinks it’s a stored function (& in fact stored functions work fine). I can’t see any switches to force it to do a “Call” to use a stored proc.
I am bit stuck, is there a way to escalate it, debug at a greater level or even look at the source code?
I had this problem and first tried adding escapeSyntaxCallMode=callIfNoReturn to my JDBC connection string (as suggested by cassiomolin in Issue while executing PostgreSQL Stored Procedure - Stack Overflow ), and it worked, but something else broke so I changed my PROCEDURE to a FUNCTION as a workaround.