Why length()/dump() return different substring length values ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KENNY L. CHEN

    Why length()/dump() return different substring length values ??

    I have a table with a CHAR column which stored a COBOL redefined
    record.
    I tried to retrieve part of the field from the column with Oracle
    substr function.

    Here is one of example: The SQL/result are shown below:
    SQL:
    select
    length(substr(M Y_COLUMN,36,8)) str_length,
    dump(substr(MY_ COLUMN,36,8)) INFO,
    rawtohex(substr (MY_COLUMN,36,8 )) raw_value
    from TABLEX
    Result:
    str_length:8
    INFO :Typ=1 Len=10: 0,0,0,0,7,151,2 37,139,70,89
    rawtohex :000000000797ED 8B4659

    The value returns by length function is 8 which is what I expected.
    The value returns by dump function is with LEN=10 is not what I
    expected.

    Can anyone can explain why the two Oracle functions (length() and
    dump()) return different length values for the same field ?

    THANKS

    KEN
Working...