国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

ASP調用ORACLE存儲過程并返回結果集

2019-11-18 19:30:40
字體:
來源:轉載
供稿:網友

asp 調用 Oracle存儲過程并返回結果集

看過網上好多ASP調用ORACLE的方法,但是沒有特好特直接的東西,所以總結各家的東西最后得出的一個自己需要的方法,感覺也比較大眾所以特此發布

###################################################
oracle的存儲過程
###################################################

--創建包頭
create or replace package pck_as
as
  type t_PRoduct_id is table of number
  index by binary_integer;
  type t_serial_no is table of varchar(300)
  index by binary_integer;
  type t_buy_date is table of date
  index by binary_integer;
 
  procedure allsfc
  (
   product_id out t_product_id,
   serial_no out t_serial_no,
   buy_date out t_buy_date
  );
 
  --procedure allsfc1;
end pck_as;


--創建包體
create or replace package body pck_as
as
  procedure allsfc
  (
   product_id out t_product_id,
   serial_no out t_serial_no,
   buy_date out t_buy_date
  )
  is
    cursor cur_sfc_tbl_product_reg is
    select product_id,serial_no,buy_date from sfc_tbl_product_reg;
   
    i number default 1;
   
  begin
       for onrecord in cur_sfc_tbl_product_reg
       loop
            product_id(i) := onrecord.product_id;
            serial_no(i) := onrecord.serial_no;
            buy_date(i) := onrecord.buy_date;
            i := i + 1;
       end loop;
  end;
end;

 


###################################################
ASP的調用
###################################################
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>無標題文檔</title>
</head>

<body>
<%
dim str_ora
dim objconn_ora
str_ora = "Driver={Microsoft ODBC for Oracle};Server=ora192;uid=dwuser;pwd=family.samsung.com.cn"
set objconn_ora = server.CreateObject("adodb.connection")
objconn_ora.connectionstring = str_ora
objconn_ora.CursorLocation = 3
objconn_ora.open

dim strsql
set rs1 = server.CreateObject("ADODB.RecordSet")
strsql = "{call pck_as.allsfc({resultset 90000, product_id, serial_no, buy_date})}"
set objcomm1 = server.CreateObject("adodb.command")
objcomm1.activeconnection = objconn_ora
objcomm1.commandtype = 1
objcomm1.commandtext = strsql
set rs1 = objcomm1.execute


while not rs1.eof
 response.Write(rs1(0) & "|" & rs1(1) & "|" & rs1(2) & "|<BR>")
 rs1.movenext
wend
%>
</body>
</html>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 武强县| 隆安县| 永仁县| 当雄县| 永平县| 瑞金市| 沧州市| 古田县| 壤塘县| 凌海市| 屏南县| 栖霞市| 浦城县| 禹州市| 太康县| 织金县| 乐至县| 马尔康县| 石首市| 日喀则市| 高清| 保康县| 贵南县| 南靖县| 西贡区| 柳州市| 新晃| 磐石市| 黔西县| 华容县| 黔西| 东山县| 阿鲁科尔沁旗| 西华县| 宝山区| 高雄县| 军事| 宜阳县| 当雄县| 西和县| 喀喇沁旗|