Isomorphic SmartClient/SmartGWT Framework (smartgwtee-eval-12.1d night build 27/10/2018)
Found an invalid SQL query is being created when using an ntext field fetch with criteria.
<DataSource
dbName="SQLServer"
tableName="STYLE_SPEC"
ID="STYLE_SPEC"
serverType="sql"
showPrompt="true"
>
<fields>
<field name="STYLE_SPEC_ID" primaryKey="true" type="sequence" hidden="true" ></field>
<field name="SPEC_CAT" length="50" type="text" sqlStorageStrategy="ntext"></field>
<field name="SPEC_NAME" length="100" type="text" sqlStorageStrategy="ntext"></field>
<field name="SPEC_CODE" length="20" type="text" sqlStorageStrategy="ntext"></field>
</fields>
</DataSource>
Criteria criteria = new Criteria();
criteria.setAttribute("SPEC_CAT", 'type');
ListGrid grid = new ListGrid(DataSource.get("STYLE_SPEC"));
grid.fetchData(criteria);
SQL Server will give the following error:
INFO SQLDriver - [builtinApplication.STYLE_SPEC_fetch] Execute of select: SELECT COUNT(*) FROM STYLE_SPEC WHERE (LOWER(STYLE_SPEC.SPEC_CAT)=Nn'type') on db: SQLServer threw exception: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'type'.
The query should be:
SELECT COUNT(*) FROM STYLE_SPEC WHERE (LOWER(STYLE_SPEC.SPEC_CAT)=N'type') - BUT NOT Nn
Found an invalid SQL query is being created when using an ntext field fetch with criteria.
<DataSource
dbName="SQLServer"
tableName="STYLE_SPEC"
ID="STYLE_SPEC"
serverType="sql"
showPrompt="true"
>
<fields>
<field name="STYLE_SPEC_ID" primaryKey="true" type="sequence" hidden="true" ></field>
<field name="SPEC_CAT" length="50" type="text" sqlStorageStrategy="ntext"></field>
<field name="SPEC_NAME" length="100" type="text" sqlStorageStrategy="ntext"></field>
<field name="SPEC_CODE" length="20" type="text" sqlStorageStrategy="ntext"></field>
</fields>
</DataSource>
Criteria criteria = new Criteria();
criteria.setAttribute("SPEC_CAT", 'type');
ListGrid grid = new ListGrid(DataSource.get("STYLE_SPEC"));
grid.fetchData(criteria);
SQL Server will give the following error:
INFO SQLDriver - [builtinApplication.STYLE_SPEC_fetch] Execute of select: SELECT COUNT(*) FROM STYLE_SPEC WHERE (LOWER(STYLE_SPEC.SPEC_CAT)=Nn'type') on db: SQLServer threw exception: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'type'.
The query should be:
SELECT COUNT(*) FROM STYLE_SPEC WHERE (LOWER(STYLE_SPEC.SPEC_CAT)=N'type') - BUT NOT Nn
Comment