Oracle CLOB Error

5 posts, 1 answers
  1. Anis
    Anis avatar
    6 posts
    Member since:
    Oct 2010

    Posted 08 Oct 2010 Link to this post

    Hi,
    When I try to insert a null value in a CLOB field, I have 
    the following error. the error only occurs for null. can someone help me ?
    Thanks
     

    {"Error setting parameters on PreparedStatement for insert of '2087813165-0':\nTelerik.OpenAccess.RT.sql.SQLException: SQL: Type #2005 not nullable!\r\n   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.setNull(PreparedStatement ps, Int32 index, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.set_Renamed(PreparedStatement ps, Int32 index, Object val, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalGenericState.setParams(PreparedStatement ps, Int32[] stateFieldNos, Int32 firstFieldNo, Int32 lastFieldNo, Int32 firstParam, PersistGraph pGraph, Int32 tableNo)\r\n   at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)\nINSERT INTO \"CAPTAGE_PROD\".\"Int_Contact\" (\"Date_Naissance\", \"ID_Contact\", \"ID_Service\", \"ID_Civilite\", \"Nom\", \"Note\", \"Photo\", \"Prenom\", \"Sexe\") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\n(set event logging to all to see parameter values) Telerik.OpenAccess.RT.sql.SQLException: SQL: Type #2005 not nullable!\r\n   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.setNull(PreparedStatement ps, Int32 index, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.set_Renamed(PreparedStatement ps, Int32 index, Object val, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalGenericState.setParams(PreparedStatement ps, Int32[] stateFieldNos, Int32 firstFieldNo, Int32 lastFieldNo, Int32 firstParam, PersistGraph pGraph, Int32 tableNo)\r\n   at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)"}
  2. Answer
    Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 12 Oct 2010 Link to this post

    Hello Anis,

    I've tried to repro this issue, but had no luck, and the exception does not show up here. Did you store multiple instances of  IntContact in one transaction? Which database are you using ?

    Sincerely yours,
    Thomas
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Anis
    Anis avatar
    6 posts
    Member since:
    Oct 2010

    Posted 13 Oct 2010 Link to this post

    The version is Oracle 10g express edition
    I have store one instance of  IntContact in one transaction

    this is the script of create table:

    create table Int_Contact  (
    ID_Contact
    INTEGER ,
    Nom Varchar2(70),
    Note CLOB
    constraint PK_INT_CONTACT primary key (ID_Contact)
    );

    when i want to bind this table in radgrid I use this template:
    <table id="Table1" cellspacing="1" cellpadding="1" width="250" border="0">
                            <tr>
                                <td>
                                    ID:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox1" Text='<%# Bind( "ID_CONTACT") %>' runat="server">
                                    </asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Nom:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox1" Text='<%# Bind( "nom") %>' runat="server">
                                    </asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Note:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox11" Text='<%# Bind( "Note") %>' runat="server">
                                    </asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Prenom:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox2" Text='<%# Bind( "PRENOM") %>' runat="server">
                                    </asp:TextBox>
                                </td>
                            </tr>
                            <tr>
    <Table>

    And i receve the exeption:
    {"Error setting parameters on PreparedStatement for insert of '2087813165-0':\nTelerik.OpenAccess.RT.sql.SQLException: SQL: Type #2005 not nullable!\r\n   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.setNull(PreparedStatement ps, Int32 index, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.set_Renamed(PreparedStatement ps, Int32 index, Object val, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalGenericState.setParams(PreparedStatement ps, Int32[] stateFieldNos, Int32 firstFieldNo, Int32 lastFieldNo, Int32 firstParam, PersistGraph pGraph, Int32 tableNo)\r\n   at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)\nINSERT INTO \"CAPTAGE_PROD\".\"Int_Contact\" (\"Date_Naissance\", \"ID_Contact\", \"ID_Service\", \"ID_Civilite\", \"Nom\", \"Note\", \"Photo\", \"Prenom\", \"Sexe\") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)\n(set event logging to all to see parameter values) Telerik.OpenAccess.RT.sql.SQLException: SQL: Type #2005 not nullable!\r\n   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.setNull(Int32 parameterIndex, Int32 sqlType, Int32 length, Int32 scale, Boolean isUnicode)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.setNull(PreparedStatement ps, Int32 index, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalUtils.set_Renamed(PreparedStatement ps, Int32 index, Object val, Int32 javaTypeCode, Int32 jdbcType, RelationalColumn col)\r\n   at OpenAccessRuntime.Relational.RelationalGenericState.setParams(PreparedStatement ps, Int32[] stateFieldNos, Int32 firstFieldNo, Int32 lastFieldNo, Int32 firstParam, PersistGraph pGraph, Int32 tableNo)\r\n   at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)"}
  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 14 Oct 2010 Link to this post

    Hi Anis,

    ok, I can see now how this is produced. However, looking at your actual model where the Note column is not nullable, this indicates also another issue, because  the value that gets passed is actually null.  Please check that your data binding is actually correct and/or pass a String.Empty value instead of a null.
    This issue will be fixed in the next version (not the build from yesterday).

    Regards,
    Thomas
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Anis
    Anis avatar
    6 posts
    Member since:
    Oct 2010

    Posted 15 Oct 2010 Link to this post

    ok, I've already tried to pass a String.Empty instead of a null and it works.
    Thank you
Back to Top
DevCraft banner