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

From: KENNY L. CHEN <kenny_60559_at_yahoo.com>
Date: 2 Nov 2003 20:08:41 -0800
Message-ID: <83f59352.0311022008.d4afe02_at_posting.google.com>


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(MY_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,237,139,70,89	
rawtohex  :000000000797ED8B4659

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 Received on Mon Nov 03 2003 - 05:08:41 CET

Original text of this message