SOQL queries - field/column aliases not recognized and/or toLabel() function duplicate field errors
Currently running Devart ODBC Driver for Salesforce 3.4.1, set up as linked server in MSSQL 2019 (15.0.4405.4), and I don't seem to be able to use field aliases when running SOQL queries via an OPENQUERY statement. For example:
- SELECT * FROM OPENQUERY(PCCUSFPROD, 'SOQL: Select Id, Family FROM Product2')
works fine, but
- SELECT * FROM OPENQUERY(PCCUSFPROD, 'SOQL: Select Id, Family FamilyCode FROM Product2')
throws an error "[Devart][ODBC][Salesforce]Invalid SOQL: unexpected token: 'FamilyCode' at position 19". Is there no support for aliases in SOQL queries with the Salesforce ODBC driver? The reason I need field/column aliases is because I'm trying to use the toLabel() function like this:
- SELECT * FROM OPENQUERY(PCCUSFPROD, 'SOQL: Select Id, Family, toLabel(Family) FamilyLabel FROM Product2')
I have to alias either the Family field or the result of the toLabel() function - if I don't alias either of them, I get a "duplicate field selected: Family" error, and I need both the field and label values. Am I doing this wrong, is there a different way to get what I'm looking for, or do I have to figure out some other way to make this happen?