Hello,
Using PB 2022 R3 Build 3289 (64 bit) with PostgreSQL 15 and SQLite 3
We have many reports which constructs required SQL and set it with SetSQLSelect to retrieve the data. It works perfectly fine when we connect to PostGreSQL 15. And fails to set the SQL and the command SetSQLSelect returns -1.
On application open, there is an option to select whether to connect PG or SQLite and almost all of the windows work fine with both databases [ except for one issue.. later-on on that ].
To view any reports, we construct the required SQL based on the options selected in the report and set it to a datawindow / datastore and return the result set to calling report window.
This works fine when we connect to PG. If connected to SQLite the statement
li_rc = dw_1.SetSQLSelect( ls_sql ) => Returns -1
Couldn't figure out on what conditions it returns this value. The help stats that
SetSQLSelect returns 1 if it succeeds and -1 if the SELECT statement cannot be changed. If any argument's value is null, in PowerBuilder and JavaScript the method returns null.
From the above statement, it seems the Select statement cannot be changed, when we connect to SQLite database.
Any idea why this is so?
1. The constructed is SQL is correct. We verified it by running against the two databases. It returns the correct results.
2. When we create a new datawindow with the constructed SQL, and run it from PB, it returns the correct result.
Happiness Always
BKR Sivaprakash