SAK }‘ŠÙ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

Oracle PL/SQL •Ò12 - BASE64 ƒGƒ“ƒR[ƒhAutl_encodeAbase64_encode

¡UTL_ENCODE (Oracle9i - 9.0.1 ˆÈ~)

  EUTL_ENCODE ‚ł́ABASE64 ‚È‚Ç‚Ì•¶ŽšƒR[ƒhŒ`Ž®‚̃Gƒ“ƒR[ƒhAƒfƒR[ƒh‚ª
    ‚Å‚«‚éBUTL_ENCODE ‚ɂ́A
      utl_encode.base64_encode            BASE64 Œ`Ž®ƒGƒ“ƒR[ƒh
      utl_encode.base64_decode            BASE64 Œ`Ž®ƒfƒR[ƒh
      utl_encode.uuencode                 uuencode Œ`Ž®ƒGƒ“ƒR[ƒh
      utl_encode.uudecode                 uuencode Œ`Ž®ƒfƒR[ƒh
      utl_encode.quoted_printable_encode  ˆø—p•„•t‚«Œ`Ž®ƒGƒ“ƒR[ƒh
      utl_encode.quoted_printable_decode  ˆø—p•„•t‚«Œ`Ž®ƒfƒR[ƒh
    ‚ª‚ ‚éB
    E-mail ‚Ì“ú–{ŒêƒGƒ“ƒR[ƒh‚È‚Ç‚ÉŽg—p‚·‚éB

¡base64_encode

  Eraw •¶Žš—ñ‚ð raw BASE64 ƒR[ƒh‚ɃGƒ“ƒR[ƒh‚·‚éB

  rawret := utl_encode.base64_encode(rawpara);
  |                                  |_ ˆø”(in raw)
  |_ –ß‚è’l(raw)

¡base64_decode

  Eraw BASE64 ƒR[ƒh‚©‚ç raw •¶Žš—ñ‚ɃfƒR[ƒh‚·‚éB

  rawret := utl_encode.base64_decode(rawpara);
  |                                  |_ ˆø”(in raw)
  |_ –ß‚è’l(raw)

set serveroutput on;

declare
  str     varchar2(2000) := '‚ ‚¢‚¤‚¦‚¨';
  base64  varchar2(2000);
begin

-- BASE64 ƒGƒ“ƒR[ƒh
  base64 := utl_raw.cast_to_varchar2(
    utl_encode.base64_encode(utl_raw.cast_to_raw(str))
    );

-- BASE64 ƒfƒR[ƒh
  str := utl_raw.cast_to_varchar2(
    utl_encode.base64_decode(utl_raw.cast_to_raw(base64))
    );

  dbms_output.put_line ('-- ˆ—Œ‹‰Ê --');
  dbms_output.put_line ('BASE64 ƒGƒ“ƒR[ƒh = ' || base64);
  dbms_output.put_line ('BASE64 ƒfƒR[ƒh   = ' || str);

end;
/

-- ˆ—Œ‹‰Ê --
BASE64 ƒGƒ“ƒR[ƒh = gqCCooKkgqaCqA==
BASE64 ƒfƒR[ƒh   = ‚ ‚¢‚¤‚¦‚¨

¡UTL_RAW

  EUTL_RAW ‚ɂ́Araw Œ^ƒLƒƒƒXƒg‚âƒoƒCƒg‘€ì‚̊֐”‚ª‚ ‚éB
    UTL_SMTPAUTL_ENCODE ‚ðŽg‚¤ã‚Å•K—v‚Æ‚È‚éB
    (Oracle9i - 9.0.1 ‚Å‹@”\Šg’£‚ ‚è)

  utl_raw.cast_from_binary_integer  binary_integer ¨ raw
  utl_raw.cast_from_number          number ¨ raw
  utl_raw.cast_to_binary_integer    raw ¨ binary_integer
  utl_raw.cast_to_number            raw ¨ number
  utl_raw.cast_to_raw               varchar2 ¨ raw
  utl_raw.cast_to_varchar2          raw ¨ varchar2
  utl_raw.concat                    raw ˜AŒ‹
  utl_raw.length                    raw ƒoƒCƒg’·
  utl_raw.substr                    raw ƒoƒCƒgØ‚èo‚µ
  utl_raw.translate                 raw ƒoƒCƒg•ÏŠ·
  utl_raw.transliterate             raw ƒoƒCƒg•ÏŠ·
  utl_raw.overlay                   raw ƒoƒCƒgƒI[ƒoƒŒƒC
  utl_raw.copies                    raw ƒRƒs[
  utl_raw.xrange                    raw ”͈Í
  utl_raw.reverse                   raw ”½“]
  utl_raw.compare                   raw ”äŠr
  utl_raw.convert                   raw •ÏŠ·
  utl_raw.bit_and                   raw ƒrƒbƒg˜_—Ï
  utl_raw.bit_or                    raw ƒrƒbƒg˜_—˜a
  utl_raw.bit_xor                   raw ƒrƒbƒg”r‘¼˜_—˜a
  utl_raw.bit_complement            raw ƒrƒbƒg•â”

  Eblob(ƒoƒCƒiƒŠƒ‰[ƒWƒIƒuƒWƒFƒNƒg) €–Ú‚ð SQL*Plus ‚Å•\Ž¦‚·‚邱‚Æ‚Í
    o—ˆ‚È‚¢B
    ƒoƒCƒiƒŠƒf[ƒ^‚Å‚Í‚È‚­•¶Žš—ñ‚ð blob ‚ɃZƒbƒg‚µ‚ăeƒXƒg‚·‚éê‡‚́A
      utl_raw.cast_to_raw('abc012')
    ‚ŃZƒbƒg‚µA
      utl_raw.cast_to_varchar2(€–Ú–¼)
    ‚Å select ‚·‚ê‚Î SQL*Plus ‚Å‚à•\Ž¦‚͉”\‚Å‚ ‚éB
    ®AADO ‚Å‚Í GetChunkAActualSize ‚ðAoo4o ‚Å‚Í offsetAPollingAmountA
    SizeAReadAStatusAORALOB_NEED_DATA ‚щ[ƒWƒIƒuƒWƒFƒNƒg‚ð“ǂށB

¡cast_to_raw

  Evarchar2 •¶Žš—ñ‚ð raw •¶Žš—ñ‚ÉŒ^ƒLƒƒƒXƒg‚·‚éB

  rawret := utl_raw.cast_to_raw(str);
  |                             |_ ˆø”(in varchar2)
  |_ –ß‚è’l(raw)

¡cast_to_varchar2

  Eraw •¶Žš—ñ‚ð varchar2 •¶Žš—ñ‚ÉŒ^ƒLƒƒƒXƒg‚·‚éB

  ret := utl_raw.cast_to_varchar2(rawstr);
  |                               |_ ˆø”(in raw)
  |_ –ß‚è’l(varchar2)

declare
  str  varchar2(2000) := '‚ ‚¢‚¤‚¦‚¨';
  bin  raw(2000);
begin

-- varchar2 ‚ð raw ‚ÉŒ^ƒLƒƒƒXƒg
  bin := utl_raw.cast_to_raw(str);

-- raw ‚ð varchar2 ‚ÉŒ^ƒLƒƒƒXƒg
  str := utl_raw.cast_to_varchar2(bin);

end;
/

¡Oracle PL/SQL •ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ



Copyright (C) 1999-2017 Y.SAK