DUMP function v16

DUMP function returns a VARCHAR2 value which contain the datatype code, length in bytes, and internal representation of expression.

DUMP(expr[, return_fmt [, start_position [, length ] ] ])

Where return_fmt specifies the format of the any of this return values:

  • 8 returns result in octal notation
  • 10 returns result in decimal notation
  • 16 returns result in hexadecimal notation
  • 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.

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.

If expr is null, then it returns NULL.

Examples

SELECT dump('abc', 10);
Output
dump          
------------------------
 Typ=25 Len=3: 97,98,99
(1 row)
SELECT dump('huvudvärke', 1017) FROM dual;
Output
dump                           
----------------------------------------------------------
 Typ=25 Len=11 CharacterSet=UTF8: h,u,v,u,d,v,c3,a4,r,k,e
(1 row)
SELECT dump ('edbpostgres', 8,2,3) FROM dual;
Output
dump            
----------------------------
 Typ=25 Len=11: 144,142,160
(1 row)
SELECT dump(to_timestamp('11-06-2021 12:45:24','MM-DD-YYYY HH:MI:SS'), 1008) FROM dual;
Output
dump                            
-----------------------------------------------------------
 Typ=1184 Len=8 CharacterSet=UTF8: 0,355,12,266,30,163,2,0
(1 row)
SELECT dump(100/4, 10) FROM dual;
Output
dump            
----------------------------
 Typ=1700 Len=4: 0,128,25,0
(1 row)