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

2 posts, 0 answers
  1. Kyaw Zayar Han
    Kyaw Zayar Han avatar
    1 posts
    Member since:
    Jul 2009

    Posted 27 Aug 2009 Link to this post

    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 ...
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 27 Aug 2009 Link to this post

    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.
  3. DevCraft banner
Back to Top