HI,
We are using PB 2017 R3 against a postgres database. We are in the process of porting our application from informix to postgres database.
I have an issue in that functions declared with reference variables - after retrieving the data - the strings are being truncated to 16 characters.
For example: this function public function integer
of_cpp_s04_getfirmname (string as_firm_id, ref string as_firm_name)
DECLARE cf_cpp_s04_getfirmName PROCEDURE FOR cf_cpp_s04_getFirmName
as_firm_id = :as_firm_id
USING itr_Database;
EXECUTE cf_cpp_s04_getfirmName;
// Check for an error when executing the stored procedure
ll_sql_result = itr_Database.of_CheckDBError(TRUE)
//
IF (ll_sql_result <> gi_SQL_SUCCESS) AND (ll_sql_result <> gi_SQL_NOT_FOUND) THEN
/RETURN FAILURE
END IF
// Perform the priming fetch of the name of the firm
FETCH cf_cpp_s04_getfirmName INTO :as_firm_name;
The result in as_firm_name returns only the first 16 or so characters.
I have hundreds of these functions with ref string variables and would like to know what is causing this and how to rectify without converting all of them to datastores?
We're using a JDBC driver with another Database. The only way to have no problems (for us), is by declaring the stored procedures and functions as external RPC Subroutines and Functions. (just do a "search" in the pb help on 'rpcfunc').
I'm not sure if it'll work well for Postgresql, but I think it should, as explained on this page by Bruce:
https://www.brucearmstrong.org/2018/02/powerbuilder-2017-r2-new-feature.html
regards
For example:
string ls_byRef
ls_byRef = space(60)
....