Announcement

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

  • Isomorphic
    replied
    We have tried this in our own development environment, and also with yesterday's public download of 12.0p, and we cannot reproduce this problem. In both cases, with a dataSource like this:
    Code:
    <DataSource
        ID="longText"
        serverType="sql"
        dbName="Oracle"
        tableName="testLongText"
    >
        <fields>
            <field name="pk"            type="sequence"   hidden="true"            primaryKey="true" />
            <field name="theText"    type="text"       title="Long Text"       length="5000"      />
        </fields>
    </DataSource>
    and a test case like this:
    Code:
    <isomorphic:loadDS ID='longText'/>
    var testText = "Lorem ipsum dolor..." // and so on, for 5000 characters
    longText.addData({theText: testText}, function(resp, data) {
        alert("OK");
    });
    we see the server run a query like this:
    Code:
    INSERT INTO testLongText (theText, pk) VALUES (TO_CLOB('Lorem ipsum dolor... etc... for 4000 chars') ||
    'Maecenas vestibulum... etc... for 1000 chars', textLongText_pk.NextVal)
    If your use case is different from this simple test, please provide more details.

    Leave a comment:


  • pavo123
    replied
    Hi Isomorphic,

    sorry, my fault. That day I tested this bug with 6.1p and with 12.0p so I probably didn't deploy correctly or something like that.
    But doesn't matter now. This bug happens in 12.0p current build and it works correctly in 6.1p.

    Best regards
    Pavo

    Leave a comment:


  • Isomorphic
    replied
    To be clear: are you saying the problem was fixed but has now reappeared? Or are you saying you get the same Oracle error in slightly different circumstances?

    Leave a comment:


  • pavo123
    replied
    Hi Isomorphic,

    it works correctly.

    Bug from post #1 happens again (using v12.0p_2019-02-26/PowerEdition Deployment (built 2019-02-26))
    Code:
    ORA-01704: string literal too long
    when saving CLOB data.

    Best regards
    Pavo

    Leave a comment:


  • Isomorphic
    replied
    That looks correct. Are you saying this does not work correctly?

    Leave a comment:


  • pavo123
    replied
    Hi Isomorphic,

    insert works as you said using current build of 12.0.
    But filtering on that field (properties of the field you can see:#1) works like this:

    Part of the criteria:
    Code:
                {
                    fieldName:"BIGSTRING",
                    operator:"iContains",
                    value:"Spitzen"
                },
    Part of SQL Statement:
    Code:
    AND (LOWER(TABLE_NAME.BIGSTRING) LIKE LOWER('%spitzen%') ESCAPE'\'  AND TABLE_NAME.BIGSTRING IS NOT NULL)
    Best regards
    Pavo

    Leave a comment:


  • Isomorphic
    replied
    We did indeed previously use parameterized statements for long text values in Oracle, but it had limitations when performing substring filtering. It was changed at the end of January / beginning of February to use precisely the technique the OP suggests - ie, carving long text values up into 4000-char chunks and concatenating. Testing insert of > 4000-char values into an Oracle database with the current codebase shows this to be working as intended, so this is probably just a case of needing to get the latest build.

    pavo123, please try your use case with the current build of 12.0 or 12.1 and let us know if you still see the issue.

    Leave a comment:


  • pavo123
    replied
    Hi Blama ,

    you're right. This is definitly a bug. CLOB worked that way before (using v11.1p_2019-01-17/PowerEdition Deployment (built 2019-01-17)).

    Best regards
    Pavo
    Last edited by pavo123; 18 Feb 2019, 02:25.

    Leave a comment:


  • Blama
    replied
    Hi MarcellKehmstedt,

    parameter binding for everything is a suggestion I made here.
    W.r.t to the problem I'm pretty sure that this should already use parameter binding and is a bug, as BLOB already works this way and I also think that CLOB worked this way before (not sure, though).

    Best regards
    Blama

    Leave a comment:


  • MarcellKehmstedt
    replied
    As far as I can comprehend the situation, the datatype of the db column is correct with CLOB as well as the field type with "text".
    But the mapper, that generates the insert DML Statement, shall use parameterized statements and insert the text as a parameter instead of including it as a string literal in the DML statement. Since string literals are limited to 4000 bytes. String parameters do not have that limitation, since the JDBC Driver does translate them to the correct database type.

    My Question (as a complete newbie in smartgwt) would be: is there a configuration option for the datasource mapper to make it use parameterized statements? Or do we need to wait for some fix/workaround?

    Leave a comment:


  • pavo123
    started a topic Saving CLOB data

    Saving CLOB data

    Hi Isomorphic,

    I declared field like this:
    Code:
            <field name="BIGSTRING" length="100000" type="text" escapeHTML="true" />
    When text field is declared as "length>4000", a CLOB is automatically used. That is clear.
    When I try to save String value > 4000, I get Oracle DB error:
    Code:
    ORA-01704: string literal too long
    So is it possible that you change logic about saving CLOB data to be like:
    Code:
    insert into <table> (clob_column)
      values
      (
          to_clob(' <=4000 symbols ')
        ||to_clob(' <=4000 symbols ')
        ||to_clob(' <=4000 symbols ')
        ...
        ||to_clob(' <=4000 symbols ')
      );
    INHO that would solve all possible problems with a CLOB data while inserting in every DB.

    Best regards
    Pavo
    Last edited by pavo123; 14 Feb 2019, 02:59.
Working...
X