Thread: ask syntax sql to get length of field

ask syntax sql to get length of field

From
Mariya Yuniarti
Date:
Here Question :<br /><br />I have table A with structure :<br /><br />       Number        Character(20),<br />      
Description  Character(50)<br /><br />I want to get length of field Number (20)<br /><br />What is syntax sql to get
lengthof field ?<br /><br />thx<br /><p><hr size="1" /><a
href="http://us.rd.yahoo.com/mail_us/taglines/postman3/*http://us.rd.yahoo.com/evt=39666/*http://beta.messenger.yahoo.com">Yahoo!
Messengerwith Voice.</a> PC-to-Phone calls for ridiculously low rates. 

Re: ask syntax sql to get length of field

From
Bruno Wolff III
Date:
On Thu, Apr 20, 2006 at 00:37:08 -0700, Mariya Yuniarti <mariya_yuniarti@yahoo.com> wrote:
> Here Question :
> 
> I have table A with structure :
> 
>         Number         Character(20),
>        Description   Character(50)
> 
> I want to get length of field Number (20)
> 
> What is syntax sql to get length of field ?

Are you looking to get 20 or the length of a particular string in that column?
If you are looking for the maximum length (20), that should be available in
the catalogs. For the string length you can look in the string functions
section of the document. I am not sure whether or not trailing spaces are
counted in char columns. varchar makes more sense if you actually have
variable length strings.