Re: Type casting qustion
Posted in 1998
Topics: SQL Development & Query Writing, Stored Procedures & SPL
Thank you for suggestion. Seems that we will have to change all such SQL occurances after all. I was hoping that we can somhow full Informix to behive as in previous versions. All the best, Damir Kropf dkropf@4mate.hr http://www.4mate.hr -- Peter Lancashire wrote: > > 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/ -- +---------------------------------------------------------+ | 4-MATE Information Engineering Inc. | +--------------------------+------------------------------+ | 4-MATE d.o.o. | Tel: +385 (1) 242-116 | | Kosa bb | +385 (1) 242-126 | | 10000 Zagreb | Fax: +385 (1) 242-121 | | Hrvatska (Croatia) | e-mail: dkropf@4mate.hr | | | URL: http://www.4mate.hr | | | http://www.4net.hr | | | http://www.4bank.com | +--------------------------+------------------------------+