-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: DB2 "null as" should be "cast (null as [type]
PostPosted: Wed Apr 01, 2009 10:20 am 
Newbie

Joined: Wed Apr 01, 2009 9:34 am
Posts: 1
Working with DB2 (on z/OS) with DB2400Dialect (and I presume DB2 UDB with DB2Dialect).

When using union-subclass where some tables have additional columns, NHibernate correctly adds the missing columns to the other tables and attempts to set them to null using:

SELECT null as <column>

For DB2, this is invalid syntax and should be:

SELECT cast(null as <type>) as <column>

I noticed some logic in the Oracle dialect and copied it to the DB2 dialect:

public override string GetSelectClauseNullString(SqlType sqlType)
{
return "cast(null as " + GetTypeName(sqlType) + ")";
}

Now my problem is fixed, but is there any possibility of getting this into the main build so I don't have to keep updating. I'm not sure what the process is.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.