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 |

ASP VB Script oo4o + SQL ‰ž—p•Ō10 oo4o ƒXƒgƒAƒh - CreatePLSQLDynaset

oo4o ‚́AOracle RDBMS ‚Å‚ÝŽg—p‰Â”\‚Å‚·B

ĄƒXƒgƒAƒhƒpƒbƒP[ƒW

  EŽŸ‚Ė‚æ‚Ī‚ɃJ[ƒ\ƒ‹‚ð•Ô‚·ƒXƒgƒAƒhƒpƒbƒP[ƒW‚Š‚ ‚é‚Æ‚ĩ‚Ü‚·B
    ‚ą‚ę‚ð CreatePLSQLDynaset ‚ÅŽĀs‚ĩ‚āAƒŒƒR[ƒhƒZƒbƒg‚ðŽæ“ū‚ĩ‚Ü‚·B
    (OraDynasetAƒJ[ƒ\ƒ‹Žæ“ū)

create or replace package testp as
  cursor c1 is select * from ƒeƒXƒgm;
  type testmcu is ref cursor return c1%rowtype; 
  procedure GetTestm(key in varchar2, cu in out testmcu);
end;
/

create or replace package body testp is

  procedure GetTestm(key in varchar2, cu in out testmcu) is
  begin 
    open cu for select * from ƒeƒXƒgm where ƒL[ = key;
  end; 

end;
/

ĄŒŧŽĀ“I‚ČƒR[ƒh—á

<%@ Language=VBScript %>
<%
'=======================================================================
'  €”õ
'=======================================================================
  Public Const ORADB_DEFAULT   = &H0
  Public Const ORADYN_DEFAULT       = &H0
  Public Const ORADYN_NO_AUTOBIND   = &H1
  Public Const ORADYN_NO_BLANKSTRIP = &H2
  Public Const ORADYN_READONLY      = &H4
  Public Const ORADYN_NOCACHE       = &H8
  Public Const ORADYN_ORAMODE       = &H10
  Public Const ORADYN_DBDEFAULT     = &H20
  Public Const ORADYN_NO_MOVEFIRST  = &H40
  Public Const ORADYN_DIRTY_WRITE   = &H80
  Public Const ORAPARM_INPUT    = 1
  Public Const ORAPARM_OUTPUT   = 2
  Public Const ORAPARM_BOTH     = 3
  Public Const ORATYPE_VARCHAR2 = 1
  Public Const ORATYPE_NUMBER   = 2
  Public Const ORATYPE_SINT     = 3
  Public Const ORATYPE_FLOAT    = 4
  Public Const ORATYPE_STRING   = 5
  Public Const ORATYPE_VARCHAR  = 9
  Public Const ORATYPE_DATE     = 12
  Public Const ORATYPE_UINT     = 68
  Public Const ORATYPE_CHAR     = 96
  Public Const ORATYPE_CHARZ    = 97
  Public Const ORATYPE_CURSOR   = 102
  dim dbname
  dim cnuser

'** ƒGƒ‰[ƒgƒ‰ƒbƒvŠJŽn
  on error resume next

'** ƒT[ƒrƒXAƒ†[ƒUÝ’č
  dbname = ""
  cnuser = "SAK/SAK"
  '// Oracle ƒT[ƒrƒX–ž(•Ę–ž)Aƒ†[ƒUEƒpƒXƒ[ƒhŽw’č

'** oo4o Ú‘ą
  if isempty(session("OraSession")) then
    Set session("OraSession") = Server.CreateObject("OracleInProcServer.XOraSession")
    if err <> 0 then
      response.write("<P>ƒf[ƒ^ƒx[ƒX‚ɐڑąo—ˆ‚Ü‚đ‚ņB<BR>" _
        & "CreateObject - Oracle oo4o ƒGƒ‰[</P>")
    end if
  end if
  if isempty(session("OraDatabase")) then
    Set session("OraDatabase") = session("OraSession").OpenDatabase(dbname, cnuser, ORADB_DEFAULT)
    if err <> 0 then
      response.write("<P>ƒf[ƒ^ƒx[ƒX‚ɐڑąo—ˆ‚Ü‚đ‚ņB<BR>" _
        & err & ": " & error & "</P>")
    end if
  end if

'** ƒpƒ‰ƒƒ^’Į‰Á
  if isempty(session("ParaAdd")) then
    session("OraDatabase").Parameters.Add "ƒL[", 0, ORAPARM_INPUT
    session("OraDatabase").Parameters("ƒL[").ServerType = ORATYPE_CHAR
    if err <> 0 or session("OraDatabase").LastServerErr <> 0 then
      response.write("<P>ƒpƒ‰ƒƒ^’Į‰Á‚ÉŽļ”s‚ĩ‚Ü‚ĩ‚―B<BR>" _
        & err & ": " & error & "<BR>" _
        & "oo4o: " & session("OraDatabase").LastServerErrText & "</P>")
    else
      session("ParaAdd") = true
    end if
  end if

'** ƒŠƒNƒGƒŠƒŒƒR[ƒhƒZƒbƒgƒI[ƒvƒ“
  if isempty(session("qurs")) then
    set session("qurs") = session("OraDatabase").CreatePLSQLDynaset("Begin testp.GetTestm " _
      & "(:ƒL[, :cu); end;", "cu", ORADYN_DEFAULT)
    if err <> 0 or session("OraDatabase").LastServerErr <> 0 then
      response.write("<P>ƒŠƒNƒGƒŠƒŒƒR[ƒhƒZƒbƒgƒI[ƒvƒ“‚ÉŽļ”s‚ĩ‚Ü‚ĩ‚―B<BR>" _
        & err & ": " & error & "<BR>" _
        & "oo4o: " & session("OraDatabase").LastServerErrText & "</P>")
    end if
  end if

'** ƒGƒ‰[ƒgƒ‰ƒbƒvI—đ
  on error goto 0

'=======================================================================
'  ˆ—
'=======================================================================

'** ƒŠƒNƒGƒŠ
  session("OraDatabase").Parameters("ƒL[").value = "a001"
  session("qurs").Refresh
  if session("qurs").EOF then
    response.write("<P>a001 not found</P>")
  else
    response.write("<P>" & session("qurs")("ƒL[") & "</P>")
  end if

'** ƒŠƒNƒGƒŠ
  session("OraDatabase").Parameters("ƒL[").value = "b002"
  session("qurs").Refresh
  if session("qurs").EOF then
    response.write("<P>b002 not found</P>")
  else
    response.write("<P>" & session("qurs")("ƒL[") & "</P>")
  end if

  response.write("<P>-- I—đ --</P>")
%>

ĄASP VB Script oo4o + SQL ‰ž—p•ŌŽ‘—ŋ
ĄASP VB Script ADO + SQL ‰ž—p•ŌŽ‘—ŋ
ĄASP VB Script Šî‘bŽĀ’n•ŌŽ‘—ŋ
ĄASP VB Script Šî‘b•ŌŽ‘—ŋ
ĄSQL Šî‘b•ŌŽ‘—ŋ
ĄSQL Šî‘bŽĀ’n•ŌŽ‘—ŋ
ĄSQL ƒ`ƒ…[ƒjƒ“ƒO•ŌŽ‘—ŋ
ĄOracle PL/SQL •ŌŽ‘—ŋ
Ą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