Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2003
    Posts
    5

    Question Unanswered: About Return Value of right() function

    I use DB2 V8.1 ESE.
    Someday, I test right() function of SQL statement.

    In Command Line Processor,
    It returned VARCHAR(4000).
    so to speak, length(result set except of space) + space (maybe space is filled with result set) is VARCHAR(4000).

    But,
    In Query Result of Command Center,
    Exactly it returned that the value was Length(result set).

    sample)
    CREATE TABLE TESTSEQ ( SEQ CHAR(9) );
    SELECT SEQ FROM TESTSEQ;

    SEQ
    -------------------
    200307001
    200307002
    200307003
    200307004
    :

    select right(rtrim(('0'||char(int(max(substr(seq,7,3))) + 1))),3) from TESTSEQ;

    1) DB2 CLP window
    1 (maybe length is 4000 byte..)
    ---------------------------------------------------------------------------
    001(o/w is space)
    ----------------------------------------------------------------------------
    space

    2) DB2 Command Center
    Query Resut (only length is 3 : table type)
    001


    Why did it the different value or length that it was result of two enviroment?

    Please, I want your good answer !!
    Last edited by JHS4232; 08-21-03 at 23:04.

Posting Permissions

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