pl/sql 代码:
create or replace package "scott"."pkg_test" as
type myrctype is ref cursor;
function get(strbarcode varchar) return myrctype;
end pkg_test;
create or replace package body "scott"."pkg_test" as
function get(strbarcode in varchar) return myrctype is
rc myrctype;
begin
open rc for strbarcode;
return rc;
end get;
end pkg_test;
--------------------------------------------------------------------------------------------------------
vb 代码:
private sub command1_click()
on error goto cursorerr:
dim cnn as new adodb.connection
dim rst as new adodb.recordset
dim cmd as new adodb.command
cnn.connectionstring = "provider=oraoledb.oracle.1;password=tiger;persist security info=true;user id=scott;data source=oraany;extended properties=plsqlrset=1"
cnn.open
with cmd
.activeconnection = cnn
.commandtype = adcmdtext
.commandtext = "{call scott.pkg_test.get(?)}"
.parameters.append .createparameter("strbarcode", advarchar, adparaminput, 100, "select * from tab")
end with
rst.cursortype = adopenstatic
rst.locktype = adlockreadonly
set rst.source = cmd
rst.open
msgbox rst.recordcount
set rst = nothing
set cmd = nothing
exit sub
cursorerr:
set cmd = nothing
set rst1 = nothing
msgbox err.description
end sub
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器