+ Reply to Thread
Page 1 of 7 1 2 3 ... LastLast
Results 1 to 10 of 65

How to find actual LENGTH of a CHAR string

  1. How to find actual LENGTH of a CHAR string

    Hi,
    I am using DB2 version 8.2 on Windows XP platform.

    I have a table 'EMP' with one field named 'NAME' of type CHAR , size
    80.

    Also , I have a record with NAME='john'

    Now, when I try to find the length of the this name field DB2 returns
    80 . Can someone tell me how do I find the actual length of this NAME
    field value ('john') without making use of RTRIM.

    I say without using RTRIM because, I want to be able to find out the
    length of char strings like ' john ' as well .
    Thanks in advance
    mailar


  2. Re: How to find actual LENGTH of a CHAR string

    In article <1106028963.012207.83870@c13g2000cwb.googlegroups.com>,
    (mailar@gmail.com) says...
    > Hi,
    > I am using DB2 version 8.2 on Windows XP platform.
    >
    > I have a table 'EMP' with one field named 'NAME' of type CHAR , size
    > 80.
    >
    > Also , I have a record with NAME='john'
    >
    > Now, when I try to find the length of the this name field DB2 returns
    > 80 . Can someone tell me how do I find the actual length of this NAME
    > field value ('john') without making use of RTRIM.
    >
    > I say without using RTRIM because, I want to be able to find out the
    > length of char strings like ' john ' as well .
    > Thanks in advance
    > mailar
    >
    >


    You could make it a varchar or fill the remaining part of the column
    with a special character.

  3. Re: How to find actual LENGTH of a CHAR string

    In article <1106028963.012207.83870@c13g2000cwb.googlegroups.com>,
    (mailar@gmail.com) says...
    > Hi,
    > I am using DB2 version 8.2 on Windows XP platform.
    >
    > I have a table 'EMP' with one field named 'NAME' of type CHAR , size
    > 80.
    >
    > Also , I have a record with NAME='john'
    >
    > Now, when I try to find the length of the this name field DB2 returns
    > 80 . Can someone tell me how do I find the actual length of this NAME
    > field value ('john') without making use of RTRIM.
    >
    > I say without using RTRIM because, I want to be able to find out the
    > length of char strings like ' john ' as well .
    > Thanks in advance
    > mailar
    >
    >


    You could make it a varchar or fill the remaining part of the column
    with a special character.

  4. Re: How to find actual LENGTH of a CHAR string

    In article <1106028963.012207.83870@c13g2000cwb.googlegroups.com>,
    (mailar@gmail.com) says...
    > Hi,
    > I am using DB2 version 8.2 on Windows XP platform.
    >
    > I have a table 'EMP' with one field named 'NAME' of type CHAR , size
    > 80.
    >
    > Also , I have a record with NAME='john'
    >
    > Now, when I try to find the length of the this name field DB2 returns
    > 80 . Can someone tell me how do I find the actual length of this NAME
    > field value ('john') without making use of RTRIM.
    >
    > I say without using RTRIM because, I want to be able to find out the
    > length of char strings like ' john ' as well .
    > Thanks in advance
    > mailar
    >
    >


    You could make it a varchar or fill the remaining part of the column
    with a special character.

  5. Re: How to find actual LENGTH of a CHAR string

    In article <1106028963.012207.83870@c13g2000cwb.googlegroups.com>,
    (mailar@gmail.com) says...
    > Hi,
    > I am using DB2 version 8.2 on Windows XP platform.
    >
    > I have a table 'EMP' with one field named 'NAME' of type CHAR , size
    > 80.
    >
    > Also , I have a record with NAME='john'
    >
    > Now, when I try to find the length of the this name field DB2 returns
    > 80 . Can someone tell me how do I find the actual length of this NAME
    > field value ('john') without making use of RTRIM.
    >
    > I say without using RTRIM because, I want to be able to find out the
    > length of char strings like ' john ' as well .
    > Thanks in advance
    > mailar
    >
    >


    You could make it a varchar or fill the remaining part of the column
    with a special character.

  6. Re: How to find actual LENGTH of a CHAR string

    In article <1106028963.012207.83870@c13g2000cwb.googlegroups.com>,
    (mailar@gmail.com) says...
    > Hi,
    > I am using DB2 version 8.2 on Windows XP platform.
    >
    > I have a table 'EMP' with one field named 'NAME' of type CHAR , size
    > 80.
    >
    > Also , I have a record with NAME='john'
    >
    > Now, when I try to find the length of the this name field DB2 returns
    > 80 . Can someone tell me how do I find the actual length of this NAME
    > field value ('john') without making use of RTRIM.
    >
    > I say without using RTRIM because, I want to be able to find out the
    > length of char strings like ' john ' as well .
    > Thanks in advance
    > mailar
    >
    >


    You could make it a varchar or fill the remaining part of the column
    with a special character.

  7. Re: How to find actual LENGTH of a CHAR string

    In article <1106028963.012207.83870@c13g2000cwb.googlegroups.com>,
    (mailar@gmail.com) says...
    > Hi,
    > I am using DB2 version 8.2 on Windows XP platform.
    >
    > I have a table 'EMP' with one field named 'NAME' of type CHAR , size
    > 80.
    >
    > Also , I have a record with NAME='john'
    >
    > Now, when I try to find the length of the this name field DB2 returns
    > 80 . Can someone tell me how do I find the actual length of this NAME
    > field value ('john') without making use of RTRIM.
    >
    > I say without using RTRIM because, I want to be able to find out the
    > length of char strings like ' john ' as well .
    > Thanks in advance
    > mailar
    >
    >


    You could make it a varchar or fill the remaining part of the column
    with a special character.

  8. Re: How to find actual LENGTH of a CHAR string

    Hi,
    I do not want to make it a VARCHAR field.

    Also , my application does not make sense if I fill the remaining part
    with some other characters.

    Is there a way by which I can figure out what value the user has
    entered in the column and know the length of this value without
    including the remaining white spaces padded by DB2.


  9. Re: How to find actual LENGTH of a CHAR string

    Hi,
    I do not want to make it a VARCHAR field.

    Also , my application does not make sense if I fill the remaining part
    with some other characters.

    Is there a way by which I can figure out what value the user has
    entered in the column and know the length of this value without
    including the remaining white spaces padded by DB2.


  10. Re: How to find actual LENGTH of a CHAR string

    Hi,
    I do not want to make it a VARCHAR field.

    Also , my application does not make sense if I fill the remaining part
    with some other characters.

    Is there a way by which I can figure out what value the user has
    entered in the column and know the length of this value without
    including the remaining white spaces padded by DB2.


+ Reply to Thread
Page 1 of 7 1 2 3 ... LastLast