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

首頁 > 開發(fā) > 綜合 > 正文

vb 調(diào)用 Oracle 函數(shù)返回數(shù)據(jù)集的例子

2024-07-21 02:24:55
字體:
供稿:網(wǎng)友
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
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 大洼县| 平乡县| 珠海市| 阿城市| 东安县| 淳安县| 林芝县| 洛南县| 安化县| 咸丰县| 青河县| 砚山县| 甘肃省| 佳木斯市| 沂源县| 乌兰察布市| 天水市| 岑巩县| 武义县| 吉隆县| 朝阳市| 泰州市| 宜章县| 三台县| 怀柔区| 洪洞县| 黄浦区| 安新县| 股票| 万源市| 犍为县| 高台县| 丹寨县| 新巴尔虎右旗| 北海市| 庆城县| 芦山县| 马山县| 松溪县| 商南县| 涟源市|