Re: LENGTH function and trailing spaces
Posted in 1995
Kirk Bradley - Mainframe and Integration Technologies (kbradley@130.35.1.6) wrote: : Right.. it gives their DEFINED lengths not the actual : lengths (forVARCHAR at least) as stored for a given : row. It sounds like nobody that uses Informix (at least : on this forum ;-)) uses length() for this purpose and : so the fact that you can't do this: : INSERT INTO VT(VARCOLUMN) VALUES ('Kirk ') : SELECT * FROM VT WHERE LENGTH(VARCOLUMN) = 7 : and have the SELECT return that row. : Correct? Correct, I guess. Why would you want either 'Kirk' or 'Kirk ' to be returned as having length of 7? IMHO most users would ask for length of 4 if they wanted that row, and that's what Informix would do. : p.s. I'm getting this info from the 5.0 SQL ref that says : that TRAILING SPACES ARE STORED in VARCHAR columns. If : that isn't true then all bets are off I guess. Only if you put them there. But why would you, except by mistake? : -- : Kirk Bradley : Oracle Corporation : Mainframe and Integration Technologies Group -- graeme -- Disclaimer: The author's opinions are his own, and not necessarily those of Pyramid Technology Ltd. or Pyramid Technology Inc. --------------------------------------------------------------------------- -m------- Graeme Sargent Voice: +44 (0)252 373035 ---mmm----- Senior Database Consultant Fax : +44 (0)252 373135 -----mmmmm--- Pyramid Technology Ltd. Telex: Tell who??? -------mmmmmmm- Farnborough, Hants GU14 7PL Email: graeme@pyra.co.uk --------------------------------------------------------------------------- We have the technology. The tricky bit is learning how to use it.