Oracle dump函數
DUMP
文法
DUMP(expr[, return_fmt
[, start_position [, length ] ]
]
)
用途
DUMP returns a VARCHAR2 value containing the datatype code, length in bytes, and internal representation of expr. The returned result is always in the database character set.
DUMP返回一個包含資料類型代碼,位元組長和內部運算式的VARCHAR2類型值。
The argument return_fmt specifies the format of the return value and can have any of the following values:
Return_fmt參數指定傳回值的格式,包含以下值:
8 返回8進位數
10 返回10進位數
16 返回16進位數
17 returns each byte printed as a character if and only if it can be interpreted as a printable character in the character set of the compiler—typically ASCII or EBCDIC. Some ASCII control characters may be printed in the form ^X as well. Otherwise the character is printed in hexidecimal notation. All NLS parameters are ignored. Do not depend on any particular output format for DUMP with return_fmt 17.
每一個位元組如果可翻譯為列印字元位元組則作為列印字元返回,否則字元以16進位資料返回。所有NLS參數將被忽略。不要指望著使用DUMP 17來輸出專屬的格式。
By default, the return value contains no character set information. To retrieve the character set name of expr, add 1000 to any of the preceding format values. For example, a return_fmt of 1008 returns the result in octal and provides the character set name of expr.
The arguments start_position and length combine to determine which portion of the internal representation to return. The default is to return the entire internal representation in decimal notation.
預設的,函數傳回值不包含字元集資訊。可對return_fmt加1000來實現返回字元集資訊。例如, 1008返回8進位數並提供運算式的字元集名稱。
參數start_position和length一起決定了該返回那一部分內部運算式。預設是返回全部。
If expr is null, then this function returns NULL.
如果運算式為NULL則函數返回NULL。
This function does not support CLOB data directly. However, CLOBs can be passed in as arguments through implicit data conversion.
此函數不直接支援CLOB資料。然而,CLOB可以作為參數通過隱式轉換傳入。
例子
SELECT DUMP('abc', 1016)
FROM DUAL;
DUMP('ABC',1016)
------------------------------------------
Typ=96 Len=3 CharacterSet=WE8DEC: 61,62,63
SELECT DUMP(last_name, 8, 3, 2) "OCTAL"
FROM employees
WHERE last_name = 'Hunold'
ORDER BY employee_id;
OCTAL
-------------------------------------------------------------------
Typ=1 Len=6: 156,157
SELECT DUMP(last_name, 10, 3, 2) "ASCII"
FROM employees
WHERE last_name = 'Hunold'
ORDER BY employee_id;
ASCII
--------------------------------------------------------------------
Typ=1 Len=6: 110,111