This is a migrated thread and some comments may be shown as answers.

Oracle CLOB Error

4 Answers 90 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anis
Top achievements
Rank 1
Anis asked on 08 Oct 2010, 03:30 PM
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)"}

4 Answers, 1 is accepted

Sort by
0
Accepted
Thomas
Telerik team
answered on 12 Oct 2010, 09:14 AM
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
0
Anis
Top achievements
Rank 1
answered on 13 Oct 2010, 05:42 PM
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)"}
0
Thomas
Telerik team
answered on 14 Oct 2010, 10:09 AM
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
0
Anis
Top achievements
Rank 1
answered on 15 Oct 2010, 03:08 PM
ok, I've already tried to pass a String.Empty instead of a null and it works.
Thank you
Tags
Databases and Data Types
Asked by
Anis
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Anis
Top achievements
Rank 1
Share this question
or