DBDatabaseDriver line 592 checks for empty string or null and sees those as null (ObjectUtils)
This probably comes from the fact that oracle sees empty strings as null... To me this also seems like an unwanted 'feature' as other databases allow empty string values. Rainer, any objections in removing this '' to NULL logic by creating an extra isNull method in ObjectUtils? Even in oracle you don't need this as the database will do it for you... Shall exxos/me create an issue in the issue tracker? See this test: DBSetExprTest#testAddSQLEmptyString() Cheers, Francis On Mon, Aug 16, 2010 at 2:23 PM, exxos <[email protected]> wrote: > Hello, > > I noticed something probably not correct: > > When you execute the following: > > DBCommand cmd = db.createCommand(); > cmd.set(db.tab.col.to("")); > > You get the SQL below > > INSERT INTO tab (col) VALUES (null); > > whereas it is expected > > INSERT INTO tab (col) VALUES (""); > > In the table defintion there is: > col = addColumn("col", DataType.TEXT, 80, true); > > Could you please advise why you get "null" instead of empty "" ? > > Regards, > exxos. > > > -- http://www.somatik.be Microsoft gives you windows, Linux gives you the whole house.
