Home » SQL & PL/SQL » SQL & PL/SQL » URGENT!! Lenght of the data
URGENT!! Lenght of the data [message #21641] Wed, 21 August 2002 04:10 Go to next message
Karri
Messages: 33
Registered: May 2001
Member
Hi,
I have column(varchar2(200). There is different kind of data, (lenght between 3...150). How I can Select lenght of the each data row. I try LEN and LEGHT, but it didn't work.
BR Karri
Re: URGENT!! Lenght of the data [message #21643 is a reply to message #21641] Wed, 21 August 2002 05:14 Go to previous messageGo to next message
Mike T
Messages: 32
Registered: August 2002
Member
If you are getting 200 back for a length, the field may be padded with spaces. Use:

LTRIM(RTRIM(LENGTH(field_name)))

to trim off the leading and trailing spaces.
Re: URGENT!! Lenght of the data [message #21659 is a reply to message #21641] Wed, 21 August 2002 14:11 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
I guess Mike means LENGTH(LTRIM(RTRIM(field_name))) if there are leading or trailing spaces in the field. In 8i you can just use trim()
Re: URGENT!! Lenght of the data [message #21677 is a reply to message #21641] Thu, 22 August 2002 06:02 Go to previous message
Mike T
Messages: 32
Registered: August 2002
Member
d'oh!!! What he said!

; )
Previous Topic: Deleting A Column
Next Topic: Can you help with this simple SQL query?
Goto Forum:
  


Current Time: Fri Apr 19 18:23:11 CDT 2024