SmartClient Version: v11.1p_2019-12-02/Enterprise Deployment (built 2019-12-02)
Hello, I just noticed a strange behaviour in a SQLDataSource, where In my actual use case it seems that I forgot to add a join for the default fetch, which seems required for a field, but it does work indeed, as the field seems to be ignored.
It is like that in my application since a long time.
I've simplified it for a test case:
When I execute IMA_ABBONAMENTI.fetchData() the generated query doesn't contain JPC_STAGIONI.DATA_INIZIO:
so DATA_INIZIO_STAGIONE seems to be ignored, which I find strange, but as it's working I really haven't noticed it...until I've added an operationBinding:
that seems to be sufficient to trigger an error, as now the generated query is:
which leads to:
Why is there a different behaviour? Which is correct?
Hello, I just noticed a strange behaviour in a SQLDataSource, where In my actual use case it seems that I forgot to add a join for the default fetch, which seems required for a field, but it does work indeed, as the field seems to be ignored.
It is like that in my application since a long time.
I've simplified it for a test case:
Code:
<DataSource xmlns="http://www.smartclient.com/schema"
ID="IMA_ABBONAMENTI"
tableName="IMA_ABBONAMENTI"
schema="DBSALES"
dbName="dbJpcEP"
serverType="sql"
dropExtraFields="false"
>
<fields>
<field sqlType="decimal" primaryKey="true" name="ID_REC" type="sequence" hidden="true"
sequenceName="SEQUENCE_ID_REC"/>
<field name="ID_STAGIONE_FK" type="integer" foreignKey="JPC_STAGIONI.ID_REC"/>
<field name="DATA_INIZIO_STAGIONE" nativeName="DATA_INIZIO" type="date" tableName="JPC_STAGIONI"/>
</fields>
....
Code:
SELECT IMA_ABBONAMENTI.ID_REC,
IMA_ABBONAMENTI.ID_STAGIONE_FK
FROM DBSALES.IMA_ABBONAMENTI
WHERE (IMA_ABBONAMENTI.ID_STAGIONE_FK = 4485361)
Code:
<operationBinding operationType="fetch">
<whereClause>$defaultWhereClause</whereClause>
</operationBinding>
Code:
SELECT IMA_ABBONAMENTI.ID_REC,
IMA_ABBONAMENTI.ID_STAGIONE_FK,
JPC_STAGIONI.DATA_INIZIO AS DATA_INIZIO_STAGIONE
FROM DBSALES.IMA_ABBONAMENTI
WHERE (IMA_ABBONAMENTI.ID_STAGIONE_FK = 4485361)
java.sql.SQLSyntaxErrorException: ORA-00904: "JPC_STAGIONI"."DATA_INIZIO": identificativo non valido
Comment