Giving up on Stored Procedures, I finally managed to get some result by simply changing the Stored Procedure to a Function doing minimal changes (I don't think it would be a lot of work, but it depends on the amount of procedures of course):
Instead of :
CREATE OR REPLACE PROCEDURE public.p_test(
INOUT arg1 bigint,
INOUT arg2 character varying)
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
Select 999 INTO arg1;
Select 'Hello from p_test' INTO arg2;
END;
$BODY$;
--------------------------------
Do this :
CREATE OR REPLACE FUNCTION public.p_test(
INOUT arg1 bigint,
INOUT arg2 character varying)
RETURNS RECORD
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
Select 999 INTO arg1;
Select 'Hello from p_test' INTO arg2;
END;
$BODY$;
In the transaction object n_tr_postgres I have it declared as a local external function, using RPC SUBROUTINE.
The call from Powerbuilder (see w_genapp_main, clicked of the only button that's on the window):
longlong all_inout
string as_inout
all_inout = 0
as_inout = space(20)
sqlca.p_test5( REF all_inout, REF as_inout)
MESSAGEBOX(string(all_inout), trim(as_inout))
//Don't forget that strings by REF have to be initialised (space(20)) here, before the call to the stored //procedure/function.
See the attached mini-application (postgres.zip), you'll have to replace the values present in n_genapp_connectservice.of_getConnectionInfo(), so that it'll connect to your database (mine is "test_db")
I've simply used an odbc profile called PostgreSQL35W and create a template app specifying my odbc profile:
ConnectString='DSN=PostgreSQL35W;UID=postgres;PWD=yourPassword',DelimitIdentifier='No',StripParmNames='Yes',PBCatalogOwner='postgres'" )
thanks for your time and effort.
I think i have to rewrite all my procedure calls in our old powerbuilder application. Maybe Appeon will fix this in a future release (or at least document this problem in the help files).
I think it's not very cheap though, so maybe it's best to wait until Appeon supports them.
https://www.cdata.com/download/getfile.aspx?file=demo/FPRE-V/setup.zip&name=PostgreSQL%20JDBC%20Driver&tag=
I've downloaded the 30 day trial version and it seems to work ok. Will try with stored procedures again, once I re-install postgress 11.5.
Just a thought.