Oracle PL/SQL/System Packages/utl raw — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 09:55, 26 мая 2010
Содержание
- 1 utl_raw.bit_and
- 2 utl_raw.bit_complement
- 3 utl_raw.bit_or
- 4 utl_raw.bit_xor
- 5 utl_raw.cast_from_binary_integer
- 6 utl_raw.cast_from_number
- 7 utl_raw.cast_to_binary_integer
- 8 utl_raw.cast_to_number
- 9 utl_raw.cast_to_raw
- 10 utl_raw.cast_to_raw( "Cameron" )
- 11 utl_raw.cast_to_varchar2( "43616D65726F6E")
- 12 utl_raw.compare( "010203", "01020304", "04" )
- 13 utl_raw.compare( "01050304", "01020304" )
- 14 utl_raw.concat( "9", "0102", "ff", "0a2b" )
- 15 utl_raw.copies( "010203", 4 )
- 16 utl_raw.length( "43616D65726F6E")
- 17 utl_raw.overlay( "aabb", "010203" )
- 18 utl_raw.overlay( "aabb", "010203", 2 )
- 19 utl_raw.overlay( "aabb", "010203", 2, 1 )
- 20 utl_raw.overlay( "aabb", "010203", 5 )
- 21 utl_raw.overlay( "aabb", "010203", 5, 1, "FF" )
- 22 utl_raw.reverse( "0102030405" )
- 23 utl_raw.substr( "0102030405", 3, 2 )
- 24 utl_raw.translate( "0102030405", "0203", "06" )
- 25 utl_raw.transliterate( "010203040502", "0809", "01020304", "0a" )
- 26 utl_raw.xrange( "01", "11" )
- 27 utl_raw.xrange( "fa", "06" )
utl_raw.bit_and
SQL>
SQL> select utl_raw.bit_and( "01", "0302" ) from dual;
UTL_RAW.BIT_AND("01","0302")
----------------------------------------------------------------------------------------------------
0102
1 row selected.
SQL> --
utl_raw.bit_complement
SQL>
SQL> select utl_raw.bit_complement( "010203" ) from dual;
UTL_RAW.BIT_COMPLEMENT("010203")
----------------------------------------------------------------------------------------------------
FEFDFC
1 row selected.
SQL> --
utl_raw.bit_or
SQL>
SQL> select utl_raw.bit_or( "01", "0302" ) from dual;
UTL_RAW.BIT_OR("01","0302")
----------------------------------------------------------------------------------------------------
0302
1 row selected.
SQL> --
utl_raw.bit_xor
SQL>
SQL> select utl_raw.bit_xor( "01", "0302" ) from dual;
UTL_RAW.BIT_XOR("01","0302")
----------------------------------------------------------------------------------------------------
0202
1 row selected.
SQL> --
utl_raw.cast_from_binary_integer
SQL>
SQL> select utl_raw.cast_from_binary_integer( 12345 ) from dual;
UTL_RAW.CAST_FROM_BINARY_INTEGER(12345)
----------------------------------------------------------------------------------------------------
00003039
1 row selected.
SQL> --
utl_raw.cast_from_number
SQL>
SQL> select utl_raw.cast_from_number( 123.45 ) from dual;
UTL_RAW.CAST_FROM_NUMBER(123.45)
----------------------------------------------------------------------------------------------------
C202182E
1 row selected.
SQL> --
utl_raw.cast_to_binary_integer
SQL>
SQL> select utl_raw.cast_to_binary_integer( "00003039" ) from dual;
UTL_RAW.CAST_TO_BINARY_INTEGER("00003039")
------------------------------------------
12345
1 row selected.
SQL>
SQL> --
utl_raw.cast_to_number
SQL>
SQL> select utl_raw.cast_to_number( "c202182e" ) from dual;
UTL_RAW.CAST_TO_NUMBER("C202182E")
----------------------------------
123.45
1 row selected.
SQL> --
utl_raw.cast_to_raw
SQL>
SQL> select utl_raw.cast_to_raw( "Hello World!" ) data
2 from dual;
DATA
------------------------------------------------------------------------------------------------------------------------------------------------------
48656C6C6F20576F726C6421
1 row selected.
SQL>
SQL> --
utl_raw.cast_to_raw( "Cameron" )
SQL>
SQL> select utl_raw.cast_to_raw( "Cameron" ) from dual;
UTL_RAW.CAST_TO_RAW("CAMERON")
----------------------------------------------------------------------------------------------------
43616D65726F6E
1 row selected.
SQL> --
utl_raw.cast_to_varchar2( "43616D65726F6E")
SQL>
SQL> select utl_raw.cast_to_varchar2( "43616D65726F6E") from dual;
UTL_RAW.CAST_TO_VARCHAR2("43616D65726F6E")
----------------------------------------------------------------------------------------------------
Cameron
1 row selected.
SQL> --
utl_raw.compare( "010203", "01020304", "04" )
SQL>
SQL>
SQL> select utl_raw.rupare( "010203", "01020304", "04" ) from dual;
UTL_RAW.ruPARE("010203","01020304","04")
-----------------------------------------
0
1 row selected.
SQL> --
utl_raw.compare( "01050304", "01020304" )
SQL>
SQL> select utl_raw.rupare( "01050304", "01020304" ) from dual;
UTL_RAW.ruPARE("01050304","01020304")
--------------------------------------
2
1 row selected.
SQL> --
utl_raw.concat( "9", "0102", "ff", "0a2b" )
SQL>
SQL> select utl_raw.concat( "9", "0102", "ff", "0a2b" ) from dual;
UTL_RAW.CONCAT("9","0102","FF","0A2B")
----------------------------------------------------------------------------------------------------
090102FF0A2B
1 row selected.
SQL>
SQL> --
utl_raw.copies( "010203", 4 )
SQL>
SQL> select utl_raw.copies( "010203", 4 ) from dual;
UTL_RAW.COPIES("010203",4)
----------------------------------------------------------------------------------------------------
010203010203010203010203
1 row selected.
SQL> --
utl_raw.length( "43616D65726F6E")
SQL>
SQL>
SQL> select utl_raw.length( "43616D65726F6E") from dual;
UTL_RAW.LENGTH("43616D65726F6E")
--------------------------------
7
1 row selected.
SQL> --
utl_raw.overlay( "aabb", "010203" )
SQL>
SQL>
SQL> select utl_raw.overlay( "aabb", "010203" ) from dual;
UTL_RAW.OVERLAY("AABB","010203")
----------------------------------------------------------------------------------------------------
AABB03
1 row selected.
SQL> --
utl_raw.overlay( "aabb", "010203", 2 )
SQL>
SQL>
SQL> select utl_raw.overlay( "aabb", "010203", 2 ) from dual;
UTL_RAW.OVERLAY("AABB","010203",2)
----------------------------------------------------------------------------------------------------
01AABB
1 row selected.
SQL> --
utl_raw.overlay( "aabb", "010203", 2, 1 )
SQL>
SQL> select utl_raw.overlay( "aabb", "010203", 2, 1 ) from dual;
UTL_RAW.OVERLAY("AABB","010203",2,1)
----------------------------------------------------------------------------------------------------
01AA03
1 row selected.
SQL> --
utl_raw.overlay( "aabb", "010203", 5 )
SQL>
SQL>
SQL> select utl_raw.overlay( "aabb", "010203", 5 ) from dual;
UTL_RAW.OVERLAY("AABB","010203",5)
----------------------------------------------------------------------------------------------------
01020300AABB
1 row selected.
SQL> --
utl_raw.overlay( "aabb", "010203", 5, 1, "FF" )
SQL>
SQL> select utl_raw.overlay( "aabb", "010203", 5, 1, "FF" ) from dual;
UTL_RAW.OVERLAY("AABB","010203",5,1,"FF")
----------------------------------------------------------------------------------------------------
010203FFAA
1 row selected.
SQL> --
utl_raw.reverse( "0102030405" )
SQL>
SQL> select utl_raw.reverse( "0102030405" ) from dual;
UTL_RAW.REVERSE("0102030405")
----------------------------------------------------------------------------------------------------
0504030201
1 row selected.
SQL> --
utl_raw.substr( "0102030405", 3, 2 )
SQL>
SQL>
SQL> select utl_raw.substr( "0102030405", 3, 2 ) from dual;
UTL_RAW.SUBSTR("0102030405",3,2)
----------------------------------------------------------------------------------------------------
0304
1 row selected.
SQL> --
utl_raw.translate( "0102030405", "0203", "06" )
SQL>
SQL>
SQL> select utl_raw.translate( "0102030405", "0203", "06" ) from dual;
UTL_RAW.TRANSLATE("0102030405","0203","06")
----------------------------------------------------------------------------------------------------
01060405
1 row selected.
SQL> --
utl_raw.transliterate( "010203040502", "0809", "01020304", "0a" )
SQL>
SQL> select utl_raw.transliterate( "010203040502", "0809", "01020304", "0a" ) from dual;
UTL_RAW.TRANSLITERATE("010203040502","0809","01020304","0A")
----------------------------------------------------------------------------------------------------
08090A0A0509
1 row selected.
SQL> --
utl_raw.xrange( "01", "11" )
SQL>
SQL> select utl_raw.xrange( "01", "11" ) from dual;
UTL_RAW.XRANGE("01","11")
----------------------------------------------------------------------------------------------------
0102030405060708090A0B0C0D0E0F1011
1 row selected.
SQL> --
utl_raw.xrange( "fa", "06" )
SQL>
SQL> select utl_raw.xrange( "fa", "06" ) from dual;
UTL_RAW.XRANGE("FA","06")
----------------------------------------------------------------------------------------------------
FAFBFCFDFEFF00010203040506
1 row selected.
SQL> --