This is in PB2019 Build 2082, using the Firebird SQL Database.
We have one user’s database from our application that is behaving extremely strangely for certain SQL retrieved through a datastore created at runtime (actually, our inherited datastore object, with a dberror event script). The datastore is created via SyntaxFromSQL and CREATE.
For this one user’s DB, a Retrieve on that created datastore returns -15448 (not the only documented error return of -1!) and does not trigger the dberror event at all.
We can run the same SQL that is giving this Retrieve error return value with no problem with an external tool for accessing Firebird (FlameRobin), or in the Database Painter.
One other bizarre thing: although we have no known problems with JOIN clauses in Firebird or PB or our application for any other user, the problem SQL includes a JOIN, and if we replace that with old-style SQL (like SELECT ... FROM table1, table2 WHERE table1.joincolumn = table2.joincolumn AND ...) the problem goes away!
Here's a super-simple variation of the SQL the user originally had the problem with, that still gives the same problem:
SELECT (donor.last_name) "Name"
FROM constants co
JOIN donor on co.year_number = donor.year_number
ORDER BY donor.last_name
Any bright ideas? Thanks.
One difference I just realized between this customer and others is that they have over 93,000 donor records. I'm not sure I have been aware of another one with over 20K.
TRACE ODBC showed it retrieving every donor name, nothing that looked like an error.
If I saved the SyntaxFromSQL to a file, it looked sensible, and then if I replaced an existing DW's syntax with that saved syntax and opened it, it retrieved all of the names!
OMG I feel so stupid. The 90K rows (more than can be held in an int) was my hint of something to look for. Here was my code for testing the Retrieve after creating the DS to make sure it worked:
int li_ret
li_ret = ids.Retrieve()
if li_ret < 0 then ERROR
All I had to do was change that int to a long and it's all fixed!
I'm glad you solved it !
regards