asp和vb应该大同小异吧?
请参考:
http://www.vbip.com/books/1861001789/chapter_1789_10.asp
http://www.vbip.com/books/1861001789/chapter_1789_11.asp

解决方案 »

  1.   

    谢谢KingSunSha(弱水三千)提供的网址,内容非常好,我正需要。
    但是不幸的是,我按照上面的例子(一个输入参数,一个输出参数)
    做时还是不成功。
    然后我稍加改动,去掉了输入参数,就一切OK了。跟以前的问题一样!!!cry有没有人在用asp+oracle啊,帮我解决了可以再加100分
      

  2.   

    是这样的,根据例子稍加改动,我现做了个过程。代码是,CREATE OR REPLACE PACKAGE test1 AS
    TYPE thewbname IS TABLE OF flag6.wbname%TYPE 
    INDEX BY BINARY_INTEGER;
    PROCEDURE get_wbname
    (theid IN flag6.wbid%TYPE,thename OUT thewbname);
    END test1;
    /
    =================CREATE OR REPLACE PACKAGE BODY test1 IS
    PROCEDURE get_wbname
    (theid IN flag6.wbid%TYPE,thename OUT thewbname) IS
    CURSOR get_wbname IS
    SELECT wbname from flag6 WHERE wbid = theid;
    table_index NUMBER := 1;
    BEGIN
    FOR Get_wbname_cur IN get_wbname LOOP
    thename (table_index) := Get_wbname_cur.wbname;
    table_index := table_index + 1;
    END LOOP;
    END;
    END test1;
    /然后再asp中调用,代码是<!--#include file="adovbs.inc"-->
    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.open "Driver={Microsoft ODBC for Oracle};Server=oracle;Uid=wb;Pwd=123456;" 
    Set CMD = Server.CreateObject("ADODB.Command") SQLstr = "{call test1.get_wbname(?{resultset 10000,thename})}" Set CMDTheId = CMD.CreateParameter("thewbid",adVarChar,adParamInput,6,"xsw001")
    CMD.Parameters.Append CMDTheId
    CMD.ActiveConnection = Conn 
    CMD.CommandType = adCmdText
    CMD.CommandText = SQLstrSet RS = Server.CreateObject("ADODB.RecordSet")
    set RS = CMD.Execute
    ....
    ...
    显示set rs = CMD.Execute 出错。于是我对过程稍作修改,去掉了输入参数。在过程中直接付值CREATE OR REPLACE PACKAGE test1 AS
    TYPE thewbname IS TABLE OF flag6.wbname%TYPE 
    INDEX BY BINARY_INTEGER;
    PROCEDURE get_wbname(thename OUT thewbname);
    END test1;=================CREATE OR REPLACE PACKAGE BODY test1 IS
    PROCEDURE get_wbname(thename OUT thewbname) IS
    CURSOR get_wbname IS
    SELECT wbname from flag6 WHERE wbid = 'xsw001';
    table_index NUMBER := 1;
    BEGIN
    FOR Get_wbname_cur IN get_wbname LOOP
    thename (table_index) := Get_wbname_cur.wbname;
    table_index := table_index + 1;
    END LOOP;
    END;
    END test1;在调用就没错,可以显示结果。
    asp 也没改什么只把
    SQLstr = "{call test1.get_wbname(?{resultset 10000,thename})}" 
    改成
    SQLstr = "{call test1.get_wbname({resultset 10000,thename})}" 注销掉
    'set CMDTheId = CMD.CreateParameter("thewbid",adVarChar,adParamInput,6,"xsw001")
    'CMD.Parameters.Append CMDTheId过程就是这样,请大家帮忙
      

  3.   

    SQLstr = "{call test1.get_wbname(?{resultset 10000,thename})}" 在?号后面少了一个,号,一个?号表示一个输入参数,{resultset...}表示输入记录集参数,参数之间用,号分隔
      

  4.   

    SQLstr = "{call test1.get_wbname(?{resultset 10000,thename})}" 在?号后面少了一个,号,一个?号表示一个输入参数,{resultset...}表示输入记录集参数,参数之间用,号分隔
      

  5.   

    SQLstr = "{call test1.get_wbname(?{resultset 10000,thename})}" 在?号后面少了一个,号,一个?号表示一个输入参数,{resultset...}表示输入记录集参数,参数之间用,号分隔