Re: Type casting qustion
Posted in 1998
Damir Kropf wrote: > > Hello, > > Suppose you created table 't1' with only one column - 'c1' of type > smallint. Insert some data into table (e.g. 1,2,3,4 ...). > > Following SQL statement returnted all values from the table in Informix > version 5, while Informix 7.x returns no rows: > > sql select * from t1 where c1 <> '' > > As we have a number of similar SQL statements in a number of > applications is there a way to revert SQL cast behaviour in Informix 7 > to that of Informix 5 ? > > All the best, > Damir Kropf It's the typed null problem. Write a stored procedure that returns a null smallint and then write sql select * from t1 where c1 <> null_int You will need to do the same for the date type. Why Informix cannot allow a constant NULL in this context I do not know. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 Mail: Peter.Lancashire.PL1@bayer.co.uk --- My Internet plumbing does not allow me to mail and post news together. Sorry. All opinions are my own and not those of Bayer plc. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/