I am getting an error in the following query:
insert into ProductStone ( Pieces, Weight, CutChg, LotID,
CatID, OrnID, StoneID, ShadeID, CutID, ChgType, SetID)
values ( '10', '0.3', 'null', '601', 'H', '101',
'S', '0', '13', 'null', '4' ).
Problem is that I am creating my query at runtime . Please tell how I can check whether the value is null or not at run time.
Part of my code which I use to build dynamic query at runtime is as follows. I changed my previous code but in some cases it is working and some cases not working with null values.
if ((updatedData.elementAt(r).get(c).get(1)==null) ||
(updatedData.elementAt(r).get(c).get(1).equals("")))
{
updatedData.elementAt(r).get(c).set(1,"0");
}
else if (!(updatedData.elementAt(r).get(c).get(1).toString().equalsIgnoreCase("null") ))
{
updatedData.elementAt(r).get(c).set(1,"0");
}
My problem is being solved by putting two validations