Re: LENGTH function and trailing spaces
Posted in 1995
Topics: General Discussion
Sorry.. I didn't mean the dictionary length. I meant the length for each row. i.e. the length of a column as stored on disk. If I store 'KIRK ' and 'KIRK' I'd expect length(name) to give me 4 in both cases (cause it ignores trailing spaces) but I'd like to know if there is a SQL expression I can use to return 5 and 4. i.e. the length I would get if I fetched this column into a C program. Kerry Sainsbury (kerry@kcbbs.gen.nz) wrote: : In article <3lscrr$3q3@dcsun4.us.oracle.com>, : kbradley@130.35.1.6 (Kirk Bradley - Mainframe and Integration Technologies) wrote: : > : > Length is documented as returning the length of a character column, : > not including the trailing spaces. What method do I use IN SQL to : > get the REAL length of character column? i.e. what size would be : > available to a program that fetched that column : Try (approximately): : SELECT syscolumns.colsize FROM syscolumns, systables : WHERE syscolumns.tabid = systables.tabid : AND systables.tabname = "YOURTABLE" : AND syscolumns.colname = "YOURCOLUMN" : "colsize" might be "collength" or something similar. : > Kirk Bradley : > Oracle Corporation : ??????! : - Kerry S : PS: Kenny Everet is dead. I hope the funeral is "in the best possible taste!" : --------------------------------------,------------------------------------- : Kerry Sainsbury, kerry@kcbbs.gen.nz | THE INFORMIX FAQ : Quanta Systems, Auckland, New Zealand | kcbbs.gen.nz:/informix/* : | mathcs.emory.edu:/pub/informix/faq/* : +64 9 377-4473 (work) 279-3571 (home) | http://www.garpac.com/informix.html -- Kirk Bradley Oracle Corporation Mainframe and Integration Technologies Group