文章导航PC6首页软件下载单机游戏安卓资源苹果资源

pc软件新闻网络操作系统办公工具编程服务器软件评测

安卓新闻资讯应用教程刷机教程安卓游戏攻略tv资讯深度阅读综合安卓评测

苹果ios资讯苹果手机越狱备份教程美化教程ios软件教程mac教程

单机游戏角色扮演即时战略动作射击棋牌游戏体育竞技模拟经营其它游戏游戏工具

网游cf活动dnf活动lol周免英雄lol礼包

手游最新动态手游评测手游活动新游预告手游问答

您的位置:首页技术开发ASP技巧 → ASP调用ORACLE存储过程并返回结果集

ASP调用ORACLE存储过程并返回结果集

时间:2004/11/7 4:12:00来源:本站整理作者:蓝点我要评论(0)

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的调用
###################################################



无标题文档



<%
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) & "|
")
 rs1.movenext
wend
%>


相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 VB.NET 2005编写定时关 Jquery get/post下乱码解决方法 前台gbk gb如何使用数据绑定控件显示数据ASP脚本循环语句ASP怎么提速

人气排行 轻松解决"Server Application Error"和iis"一起学习DataGridView调整列宽用ASP随机生成文件名的函数Jquery get/post下乱码解决方法 前台gbk gbODBC Drivers错误80004005的解决办法返回UPDATE SQL语句所影响的行数的方法用Javascript隐藏超级链接的真实地址两个不同数据库表的分页显示解决方案