Re: LENGTH function and trailing spaces
Posted in 1995
> > Maybe I'm not phrasing this right. If I store 10 characters > into a column and 3 of them are trailing spaces and ask > for the LENGTH of the column via SQL I get 7. This is because > LENGTH() will not include the trailing spaces in the returned > value. When I fetch that same column into a 20 byte host variable > (say the database column was defined as 15 bytes) I will (I hope) > get an indication that only 10 bytes were stored into my application > program. The question is, how can I get the number 10 in a SQL > statement? Is it possible? This would represent the size I would > need to allocate for this 1 column/row (let's make it easy and > assume a 1 row 1 column table) in my host program. > > Is that clearer? Is it something anybody ever needs/wants to do? Why not back up for a minute and tell us what you're trying to do. What you've asked to date hasn't really made much sense. cheers j. _____________________________________________________________________________ Jack Parker - Hewlett Packard, BSMC Boise, Idaho, USA jparker@hpbs3645.boi.hp.com _____________________________________________________________________________ "A thing is bigger for being shared" - Gaelic _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________