Local SQL supports any kind of expression in the ORDER BY clause. With remote SQL only field names are allowed.
I missed that in the docs.
This makes it very difficult to emulate just a simple browse with a SORT on the header.
Up to now, I have been using an array of data objects to do this, but there are big limitations because (as you said), the entire workarea needs to be traversed to load the array.
I had a customer here last week who is trying to migrate to PostGreSQL and that was my recommendation to him, except that I suggested that he use the ODBCDBE and SQL statements in a TEXT INTO rather than trying to create a SQL statement using Universal SQL and PGDBE.
I am still trying to figure out how to use my own set of functions with PGDBE.
I just want to do this simple thing:
Code: Select all
FUNCTION LoadCursor( cOrder, cAlias, oSession )
LOCAL cSQL, cAlias, lStatus
TEXT INTO cSQL
SELECT * FROM Customers ORDER BY ?
ENDTEXT
cSQL := DC_ApplySQLParams( cSQL, { cOrder )}
lStatus := SqlStmtExec(cSql,oSession,,,.F.)
IF lStatus
dbUseArea( .T., (oSession), (cSql), "CUSTOMERS")
ENDIF
RETURN lStatus
I do this all the time with the ODBCDBE and Microsoft SQLServer.
I'm sure that I can also do this with the ODBCDBE and PostGreSQL.
However, I'm being told (by Steffen) that PGDBE and Universal SQL is the way to migrate and I don't get it.
It appears that nobody is using this.
We appear to have another communication problem with Alaska.