Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Possible bug fieldType ntext fetch with criteria

    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 Click image for larger version

Name:	smartclient.jpg
Views:	133
Size:	177.3 KB
ID:	255706 Nn

    #2
    Any Feedback??? Is it a bug???

    Comment


      #3
      It is a bug. We'll follow up once it is fixed.

      Comment


        #4
        This is fixed and will be available for download in Nov 7 nightly build.

        Comment

        Working...
        X