PLSQL | DUMP Function

The PLSQL DUMP function is used to return a varchar2 value that contains the datatype code, the length in bytes, and the internal representation of the expression.
The PLSQL DUMP function accepts an expression as a parameter, if the expression value is NULL, then the DUMP function returns NULL.

Syntax:

DUMP( expression [, return_format] [, start_position] [, length] )

Parameters Used:



  1. expression –
    It is used to specify the expression to be analysed.
  2. return_format –
    It is an optional parameter which determines the format of the return value.
  3. start-position –
    It is an optional parameter which is used to specify the start position in the internal representation to return.
  4. length –
    It is an optional parameter which is used to specify the length in the internal representation to return.

The return_format parameter accepts the following values:

  • 8 : octal notation
  • 10 : decimal notation
  • 16 : hexadecimal notation
  • 17 : single characters
  • 1008 : octal notation with the character set name
  • 1010 : decimal notation with the character set name
  • 1016 : hexadecimal notation with the character set name
  • 1017 : single characters with the character set name

Return Value:
The DUMP function returns a VARCHAR2 value but if the return_format, start_position and length parameters are omitted, the DUMP function will return the entire internal representation in decimal notation.

Supported Versions of Oracle/PLSQL:

  1. Oracle 12c
  2. Oracle 11g
  3. Oracle 10g
  4. Oracle 9i
  5. Oracle 8i

Example-1:

SELECT DUMP('Geeksforgeeks') FROM dual 

Output:




Example-2:

SELECT DUMP('Geeksforgeeks', 10) FROM dual 

Output:




Example-3:

SELECT DUMP('Geeksforgeeks', 16) FROM dual 

Output:




Example-4:

SELECT DUMP('Geeksforgeeks', 17) FROM dual 

Output:




Example-5:

SELECT DUMP('Geeksforgeeks', 1008) FROM dual 

Output:



My Personal Notes arrow_drop_up

I am a technology enthusiast who has a keen interest in programming I am pursuing Engineering in Computer Science from GEU, Dehradun I like to unwind by watching movies and English sitcomsI have a keen interest in music

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.