length of a null value
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: length of a null value

  1. #1
    Join Date
    Sep 2001
    Location
    chennai
    Posts
    69
    hi friends

    what is the out put for the following query.

    select length(col1) from my_table.

    where col1 is a varchar2 column of the table and contains ' '( a blank space.)
    i found the answer to be null, but in an exam it is given as 1. is it correct.
    can any one explain this.

    regards
    swaminathan

  2. #2
    Join Date
    Jul 2000
    Location
    india
    Posts
    213
    Hi

    The answer is 1...

    see the follo..
    SQL>CREATE TABLE PRAS(C1 VARCHAR2(5));
    Table created.

    SQL> INSERT INTO PRAS VALUES(' ');

    1 row created.

    SQL> SELECT * FROM PRAS;

    C1
    -----


    SQL> SELECT LENGTH(C1) FROM PRAS;

    LENGTH(C1)
    ----------
    1


    hOPE THIS WILL HELP U...

    Pras

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width