Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Oracledump function correctly

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to correctly use the Oracledump function, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

1. Function standard format:

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

When there are 4 basic parameters, the minimum number of parameters that can be filled is 0. When there are no parameters at all, return null directly. The other three parameters also have their own default values:

Expr: this parameter is the expression to be parsed (numbers, strings, etc., which can be values of various types)

Return_fmt: refers to the format of the returned parameter, which can be used in five ways:

1) 8: returns the value of the result in octal

2) 10: returns the value of the result in decimal (default)

3) 16: returns the result value in hexadecimal

4) 17: returns the value of the result as a single character

5) 1000: the above four plus 1000 means to add the current character set to the return value

Start_position: the character position returned at the beginning of the process

Length: the length of characters to be returned

2. Examples

SYS@ tsid > select dump ('abc') from dual

DUMP ('ABC')

--

Typ=96 Len=3: 97,98,99

SYS@ tsid > select dump ('abc',16) from dual

DUMP ('ABC',16)

--

Typ=96 Len=3: 61,62,63

SYS@ tsid > select dump ('abc',1016) from dual

DUMP ('ABC',1016)

-

Typ=96 Len=3 CharacterSet=ZHS16GBK: 61,62,63

SYS@ tsid > select dump ('abc',17,2,2) from dual

DUMP ('ABC',17,2,2

-

Typ=96 Len=3: b,c

The format of the result is generally similar: Typ=96 Len=3 [CharacterSet=ZHS16GBK]: 61jue 62jue 63

1 、 type

Typ represents the type of the current exp value. For example, 2 means NUMBER,96 means CHAR.

CODE TYP

1 VARCHAR2

2 NUMBER

8 LONG

12 DATE

23 RAW

24 LONG RAW

69 ROWID

96 CHAR

112 CLOB

113 BLOB

114 BFILE

180 TIMESTAMP

181 TIMESTAMP WITH TIMEZONE

182 INTERVAL YEAR TO MONTH

183 INTERVAL DAY TO SECOND

208 UROWID

231 TIMESTAMP WITH LOCAL TIMEZONE

2 、 len

Len represents the number of bytes occupied by the value.

For Chinese characters, it takes 2 bytes for ZHS16GBK to encode a Chinese character and 3 bytes for UTF8.

SQL > select dump ('Duoduo', 1010) from dual

DUMP (Duoduo, 1010)

Typ=96 Len=6 CharacterSet=UTF8: 229164154229164154

SQL > select dump ('Duoduo', 1010) from dual

DUMP (Duoduo, 1010)

Typ=96 Len=4 CharacterSet=ZHS16GBK: 182224182224

3 、 Value

The specific stored value. The returned value is Oracle's own internal value for the previous expr that is worth storing. For the ordinary string of non-Chinese characters, it can be understood as its ASCII code. Give an example to prove:

SYS@ tsid > select dump ('ajar 5') from dual

DUMP ('Awareness 5')

-

Typ=96 Len=4: 97,61,63,53

SYS@ tsid > select chr (97), chr (61), chr (63), chr (53) from dual

C C C C

--

A =? 5

SYS@ tsid > select ascii ('a'), ascii ('='), ascii ('?), ascii ('5') from dual

ASCII ('A') ASCII ('=') ASCII ('?) ASCII ('5')

--

97 61 63 53

ASCII code table:

ASCII value

Control character

ASCII value

Control character

ASCII value

Control character

ASCII value

Control character

0

NUT

thirty-two

(space)

sixty-four

@

ninety-six

one

SOH

thirty-three

!

sixty-five

A

ninety-seven

A

two

STX

thirty-four

"

sixty-six

B

ninety-eight

B

three

ETX

thirty-five

#

sixty-seven

C

ninety-nine

C

four

EOT

thirty-six

$

sixty-eight

D

one hundred

D

five

ENQ

thirty-seven

%

sixty-nine

E

one hundred and one

E

six

ACK

thirty-eight

&

seventy

F

one hundred and two

F

seven

BEL

thirty-nine

seventy-one

G

one hundred and three

G

eight

BS

forty

(

seventy-two

H

one hundred and four

H

nine

HT

forty-one

)

seventy-three

I

one hundred and five

I

ten

LF

forty-two

*

seventy-four

J

one hundred and six

J

eleven

VT

forty-three

+

seventy-five

K

one hundred and seven

K

twelve

FF

forty-four

seventy-six

L

one hundred and eight

L

thirteen

CR

forty-five

-

seventy-seven

M

one hundred and nine

M

fourteen

SO

forty-six

.

seventy-eight

N

one hundred and ten

N

fifteen

SI

forty-seven

/

seventy-nine

O

one hundred and eleven

O

sixteen

DLE

forty-eight

0

eighty

P

one hundred and twelve

P

seventeen

DCI

forty-nine

one

eighty-one

Q

one hundred and thirteen

Q

eighteen

DC2

fifty

two

eighty-two

R

one hundred and fourteen

R

nineteen

DC3

fifty-one

three

eighty-three

X

one hundred and fifteen

S

twenty

DC4

fifty-two

four

eighty-four

T

one hundred and sixteen

T

twenty-one

NAK

fifty-three

five

eighty-five

U

one hundred and seventeen

U

twenty-two

SYN

fifty-four

six

eighty-six

V

one hundred and eighteen

V

twenty-three

TB

fifty-five

seven

eighty-seven

W

one hundred and nineteen

W

twenty-four

CAN

fifty-six

eight

eighty-eight

X

one hundred and twenty

X

twenty-five

EM

fifty-seven

nine

eighty-nine

Y

one hundred and twenty one

Y

twenty-six

SUB

fifty-eight

:

ninety

Z

one hundred and twenty two

Z

twenty-seven

ESC

fifty-nine

ninety-one

[

one hundred and twenty three

{

twenty-eight

FS

sixty

ninety-four

^

one hundred and twenty six

~

thirty-one

US

sixty-three

?

ninety-five

-

one hundred and twenty seven

DEL

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 264

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report