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

Null-Exception raises even for Fields with String.Empty on Oracle Database

1 Answer 40 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.
Kyaw Zayar Han
Top achievements
Rank 1
Kyaw Zayar Han asked on 27 Aug 2009, 10:25 AM
Hi,

We use Telerik ORM Q2 2009 with Oracle DB. When we persist object with fields which have string.empty into database, Not Null exception is raised. we need help, please.

Regards 

More Info, 
Mapping:
<field name="fieldOne"null-value="exception" />

DB:
 fieldOne NOT NULL VARCHAR2(255)

Exception: 
{"Insert of '626420686-101' failed:Telerik.OpenAccess.RT.sql.SQLException: ORA-01400: cannot insert NULL into ...

1 Answer, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 27 Aug 2009, 12:13 PM
Hello Kyaw Zayar Han,
The problem is that oracle cannot distinguish between null and empty strings, both are stored as null. This means even if you try to store an empty string oracle takes it as null and throws the exception.

Sincerely yours,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Databases and Data Types
Asked by
Kyaw Zayar Han
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or