What is the use of the DUMP function

Hi friends,

What is the Dump function? What is the use of dump? where can I use dump?

ex:

Select (sysdate) dump of double;

Please expline with good example,


By,.
Symph.

Sometimes you can have data in your database that you expect to be returned or excluded by a query, but you do not know why it does not work as expected. With the help of DUMP, you can examine the contents of the byte-by-byte data to help identify issues...

SQL> with t as (select '&data' as dta from dual)
  2  --
  3  -- end of test data
  4  --
  5  select dta, dump(dta), dump(dta,16) from t;
Enter value for data: Fred Smith
old   1: with t as (select '&data' as dta from dual)
new   1: with t as (select 'Fred Smith' as dta from dual)

DTA
----------
DUMP(DTA)
---------------------------------------------------------
DUMP(DTA,16)
---------------------------------------------------------
Fred Smith
Typ=96 Len=10: 70,114,101,100,255,83,109,105,116,104
Typ=96 Len=10: 46,72,65,64,ff,53,6d,69,74,68

So my entry of "Fred Smith" looks like it's just two names separated by a space, but in reality in this example, the 'space' is the character ascii 255 (FF hex). This can be seen in the DUMP information. If it's data to my database, I would now be able to determine why, for example, I wasn't getting it back in my query when you query for "Fred Smith" by using a space character.

There are other options as well, for example, to examine the character set...

SQL> select dump('Fred Smith',1017) from dual;

DUMP('FREDSMITH',1017)
------------------------------------------------------------
Typ=96 Len=10 CharacterSet=WE8MSWIN1252: F,r,e,d, ,S,m,i,t,h

SQL> select dump('Fred Smith',1016) from dual;

DUMP('FREDSMITH',1016)
----------------------------------------------------------------------
Typ=96 Len=10 CharacterSet=WE8MSWIN1252: 46,72,65,64,20,53,6d,69,74,68

Take the result of the DUMP function you can use for all sorts of things based on what your needs are... example...

In binary or hex string conversion...

SQL> ed
Wrote file afiedt.buf

  1  with x as (select 'Fred' as txt from dual)
  2  --
  3      ,t as (select txt, regexp_substr(dump(txt),'[0-9,]*$') as bytes from x)
  4      ,s as (select txt, rownum rn, to_number(regexp_substr(bytes,'[^,]+',1,rownum)) as byte
  5             from   t
  6             connect by rownum <= length(regexp_replace(bytes,'[^,]*'))+1
  7            )
  8      ,b as (select txt, rn, byte, to_char(byte, 'fm0x') as hx
  9                   ,bitand(byte,128)/128||
 10                    bitand(byte,64)/64||
 11                    bitand(byte,32)/32||
 12                    bitand(byte,16)/16||
 13                    bitand(byte,8)/8||
 14                    bitand(byte,4)/4||
 15                    bitand(byte,2)/2||
 16                    bitand(byte,1) as bin
 17             from s)
 18  --
 19  select txt
 20        ,ltrim(sys_connect_by_path(byte,','),',') as bytes
 21        ,replace(sys_connect_by_path(bin,','),',') as bin
 22        ,replace(sys_connect_by_path(hx,','),',') as hx
 23  from b
 24  where connect_by_isleaf = 1
 25  connect by rn = prior rn + 1
 26* start with rn = 1
SQL> /

TXT  BYTES                          BIN                                      HX
---- ------------------------------ ---------------------------------------- --------------------
Fred 70,114,101,100                 01000110011100100110010101100100         46726564

SQL>

or the conversion from the internal representation of a date in binary.

SQL> ed
Wrote file afiedt.buf

  1  with t as (select sysdate as dt, regexp_substr(dump(sysdate),'[0-9,]*$') as bytes from dual)
  2      ,s as (select dt, rownum rn, to_number(regexp_substr(bytes,'[^,]+',1,rownum)) as byte
  3             from   t
  4             connect by rownum <= length(regexp_replace(bytes,'[^,]*'))+1
  5            )
  6      ,b as (select dt, rn, byte
  7                   ,bitand(byte,128)/128||
  8                    bitand(byte,64)/64||
  9                    bitand(byte,32)/32||
 10                    bitand(byte,16)/16||
 11                    bitand(byte,8)/8||
 12                    bitand(byte,4)/4||
 13                    bitand(byte,2)/2||
 14                    bitand(byte,1) as bin
 15             from s)
 16  --
 17  select dt
 18        ,ltrim(sys_connect_by_path(byte,','),',') as bytes
 19        ,replace(sys_connect_by_path(bin,','),',') as bin
 20  from b
 21  where connect_by_isleaf = 1
 22  connect by rn = prior rn + 1
 23* start with rn = 1
SQL> / 

DT                  BYTES                     BIN
------------------- ------------------------- ------------------------------------------------------------------
06/01/2010 08:56:46 218,7,1,6,8,56,46,0       1101101000000111000000010000011000001000001110000010111000000000

If you have a real need for it is another matter, but it is good to know that it is possible.

Tags: Database

Similar Questions

  • What is the oracle function should be used?

    Hi all

    I use oracle 10g.

    create the table:
     
    create table testing (
    modalnumber  number)
    Insert:
    insert into testing values (-144.99)
    insert into testing values (-44.99)
    insert into testing values (44.99)
    insert into testing values (144.99)
    insert into testing values (449)
    insert into testing values (3)
    insert into testing values (-3)
    select * from testing;
    output
    MODALNUMBER
    -144.99
    -44.99
    44.99
    144.99
    449
    3
    -3
    power required:
    * the output field should be 14 bytes
    * '-' should be at the top if the line contains a negative value
    * two digit decimal needed
    -0000000144.99
    -0000000044.99
    00000000044.99
    00000000144.99
    00000000449.00
    00000000003.00
    -0000000003.00
    Thanks in advance
    select to_char(modalnumber, '0000000000.00') from testing;
    
  • What is the JavaScript function to determine if a page number is present?

    I need to perform operations of JavaScript (classic) to count the number of pages in the active document, and to determine if page 6 (for example) is present.

    TIA,

    -RFH

    this.numPages returns the number of pages in the document. If the number

    6 or higher, this would mean that page 6 is present, I presume.

  • analytical function and the aggregate function

    What are the analytical function and the aggregate function. What is the difference between them?

    Hello

    Analytic Functions : -.

    Analytical functions calculate a value of aggregation based on a group of lines. They differ from aggregate functions because they return several rows for each group. The Group of rows is called a window and is defined by the analytic_clause. For each line, a sliding window of lines is defined. The window determines the range of lines used for the calculations for the current line. Window sizes can be based on a physical number of rows or a logic as the time interval.
    Analytical functions are the last set of operations performed in a query with the exception of the last ORDER BY clause. Every joint and every WHERE, GROUP BY and HAVING clauses are met before the analytical functions are handled. As a result, analytic functions can only appear in the select list or the ORDER BY clause.
    Analytical functions are commonly used to calculate cumulative aggregates, moving, centered and considered.

    Aggregate functions : -.

    Aggregate functions return a line of single result based on the groups of lines, rather than on the unique lines. Aggregate functions can appear in selection lists, as well as in the HAVING and ORDER BY clauses. They are commonly used with the GROUP BY clause in a SELECT statement, where Oracle Database splits the rows in a table when asked or seen in groups. In a query that contains a GROUP BY clause, the select list items can be aggregation functions, GROUP BY constant expressions or expressions involving one of them. Oracle applies the functions of aggregation for each group of rows and returns a single result for each group line.
    If you omit the GROUP BY clause, Oracle then applies any aggregate functions in the select list for all rows in the table queried or the view. You use aggregate functions in the HAVING clause to eliminate groups of the output based on the results of aggregate functions, rather than the values of the individual lines of the queried table or view.

    Let me know if you feel any problem understanding.
    Thank you.

    Published by: varun4dba on January 27, 2011 15:32

  • What is alternative for j2me for blackberry function setclip.

    Hello

    What is the alternative function for setclipe method to blackberry J2ME?

    Thank you

    I get the SNA. Use g.setBitmap () function and give the x and y cordinates. and then to see the result.

    Thank you and best regards,

    Ajay

  • What is the difference this 2 examples of photos? Use function IMAQ detect circles to detect the GREEN button.

    Hi all

    Please refer to the attached 2 pictures, they are similar, just the size is defferent. (pass PNG, 5478 pass. PNG).

    But now I try to use IMAQ detect circles to catch the GREEN button. For the PNG pass, it works very well, but for another example, it is still does not detect this button.

    I also try to change the curve settings and note that entry, but still no. Another way, I also try to use function IMAQ find circles , but the result is worse that IMAQ detect circles, so give up.

    The code is detect the circles.png, copy of block diagram.

    So what is the root cause? Thanks for help.

    Hi colinzhang,

    The extraction of curve so it uniform mode, you can get the result.

    -Suggestion, if you want to use the entire image area as KING should get the size of the image, get the rectangle and convert it to the descriptor of KING. (I think this is unnecessary)

    -Be careful with the extraction of the plane, u use default color which is the Red plan. In this example, it is fine. but make sure you know what aircraft you are extracting.

    s ' Please find vi saved in the 2010 version.

  • When I use the function "cut", the line of results more sharpness compared to the original files. For example, {A: "file.psd"-&gt; cultures 4x6inch, 300 dpi-&gt; B: "cropped file.psd} then the results are as described as a first step. What s the problem.

    When I use the function "cut", the line of results more sharpness compared to the original files. For example, {A: "file.psd"-> cultures 4x6inch, 300 dpi-> B: "cropped file.psd} then the results are as described as a first step. What s the problem. (Photoshop CC, windows7)

    I'm a Retoucher of photpfile have used the CS2 version for many years, and fuction 'Harvest' is an important and frequent tree tools myself. The result of the broke lines drive me annoying cause my feeling touch Sofete are all blown away. Please help me.

    I think you're talking about using the crop tool? If you're cropping with a size and resolution that involves interpolation of the image, the crop tool will use your preference for the Interpolation of the Image. By default, bicubic is automatic, which can easily result in a sharp file. Change your preference (in general) to bicubic and you shouldn't see any sharpening.

    I hope it works for your situation.

  • (1) now I use Lightrom 5.7 How to level 6 or CC? (2) what is the difference between the 6 and CC vercion? (3) when I used lightromm 3, inEXIF the distance in metres to the object that I took, in the virsions later that the function has disappeared, I coul

    (1) now I use Lightrom 5.7 How to level 6 or CC?

    (2) what is the difference between the 6 and CC version?

    (3) when I used lightromm 3, I could see in EXIF distance in metres to the object that I took, in the virsions later that the function is missing, it is very sad I am stiil waiting and I hope it would be possibble in new versions. Or this indication may possible by setting?

    (1) now I use Lightrom 5.7 How to level 6 or CC?

    Buy the standalone update from here: products

    Download CC version here: Adobe explore desktop apps | Adobe Creative Cloud

    (2) what is the difference between the 6 and CC version?

    See this comparison chart: Lightroom compare versions. Adobe Photoshop Lightroom CC

    (3) when I used lightromm 3, I could see in EXIF distance in metres to the object that I took, in the virsions later that the function is missing, it is very sad I am stiil waiting and I hope it would be possibble in new versions. Or this indication may possible by setting?

    Plugin ExifMeta of Rob Cole displays the distance between the subject field (and much more).  Unfortunately, his Web site seems to be down again.  He has been very active here, but he has not posted in several months.

  • I want to rename and move files from a shoot 5 d. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    I want to rename and move files from a shoot 5 d on a new drive. I would like to use the functionality of the increment to count, but since I have to get out of each file to the following file, it starts again at 1. What is the best way to do it?

    HI -.

    As a prelude to 2014.0, we have added a feature allowing you to choose what number to start the increment of.  Look in the section ingest Rename dialog and change your preset. When you click the button, you should see the option "Custom Auto Increment". This will allow you to choose what number to start on.  We've also added a few newspapers to try to remember where let prelude last successfully interfere the operation by using this option. So, in theory, to remember the number for you. But if it isn't (maybe you want multiple kickoff ingested at the same time) you can always manually set the number to start with.

    Check that out and let me know how it works for you.

    Kind regards

    Michael

  • What language he used in the functions of triggered

    What language he used in the functions of triggered

    Animate the engine behind the edge is powered by javascript.

    Darrell

  • What is the function local folders are used in TB? When should I use/non use?

    What is the 'local folders' function does TB? How is it related to the 'archives '. 2015 archives disappear after 2015 or 2016 pop up? Why not just add subfolders Archives rather than 2015 Archives? Documentation on these topics?

    Archives and local folders are not related. You can create an Archive folder under "Local folders" account however.

    See http://kb.mozillazine.org/Local_Folders and https://support.mozilla.org/en-US/kb/archived-messages for more information.

  • What is the function is used to read the form of angular Position a task?

    I created a task DAQmx in MAX. This task configures a counter on a PCI-6259 to counties of A and B of a coder with the angular Position. Which function to use to read the value since I am more counties of reading I read the position?

    Thank you in advance for any advice!

    Hi Izzy,

    I created the task UP. The task takes in the counter of an encoder input and converts it to angular position. Always use the DAQmxReadCounterF64 function to read the meter? I'm guessing that I made and that the function returns the angular position, rather than the raw numbers. Not sure if.

    Thank you for taking the time to answer.

    Regards-

    John o ' c

  • What happened to the insertion function. It was on the same line as file

    What happened to the insertion function? It was on the same line as the files, tools, etc. He's gone. If you want to insert a jpg you sent as an attachment. I have read through the help files and that you can't find the answer. I want my old Thunderbird back! Newer is not always better.

    I suspect that you have lost the Mail composition toolbar. Open an entry window, press and hold the < alt > key, type v and check the box for the mail toolbar. I would also allow the Menu bar while you are there.

    Another possibility, if the Insert option is missing in the mail toolbar, is that it is spent in composition in plain text mode. Open the settings page of the account assigned by right-clicking on the account in the left pane, select Composition & addressing and tick the box labelled "Dial using the HTML format".

  • How doi send texts using the speech function without hitting the Send button?

    using the speech function in texting, how to send the text without actually pushing the Send button? When I say 'send' or 'send message' he just keeps typing

    "Hey, Siri, send a message to Bob. Siri will then ask you what you want text Bob. Once you stop dictating, Siri will ask then if you're ready to send the message. Say, "Yes." It's really very nice.

    If you are already in the message app and using speech-to-text, you must press the Send button.

  • What happened to the 'Reply' function for e-mail messages? How to do that now?

    The new Firefox is not easy to use. The former had the possibilities of action listed for easy access. Now, we have to hit a drop down selection menu that adds additional steps to perform the desired actions. There is also no place that allows the 'Reply' function for messages. Why is it that were eliminated?
    Experts in software, why they do things easier when everything they do is complicate its use for common people?

    Thank you. It was the answer to the problem. Why must it be grounded if secretly for novices must go through this process to get assistance to the fulfilment of the tasks? I know that's not your problem, what the site does, but I'm glad that you were able to help me and solve the problem.
    Thanks again for your expertise.

Maybe you are looking for