1

I am working on a asp+oracle web project, and I need a multiple user select function.

1, use javascript build up a string array :

 var userArray = ["Simon","Sheng","Cheng"];

2, pass it by ado parameter object,but I don't know how to fill Parameter ojbect :

var cmd = Server.CreateObject("ADODB.Command");
var param = cmd.CreateParameter("par",????????????)<--I don't know how to fill;

3, create store procedure in oracle

    create or replace package demo_pkg
    as
       type charArray is table of varchar2(255) index by binary_integer;
       type t_cursor is ref cursor;
    procedure p_test(p_id in charArray,p_cursor out t_cursor );
    end;

    create or replace package body demo_pkg
    as
    procedure p_test (p_id in charArray,p_cursor out t_cursor )
    AS
v_cursor t_cursor;
    BEGIN
open v_cursor for
      select last_name from employees where last_name in (select * from table(cast(p_id as charArray)))
p_cursor := s_test;
    end;
    end;

After 3 days google, I still here, so who can help me?

2
  • Please focus your question what is causing you problems here ? Is it using ADO to pass a value to a Oracle stored procedure, if so simplify your example an remove the parts you don't have a problem with (unless its all three of course) then maybe you should split it into multiple questions Commented Jul 10, 2012 at 21:58
  • yes,maby I ask oracle store procedure first. Commented Jul 11, 2012 at 14:31

1 Answer 1

0

The format is:

CreateParameter( name, type, direction, size, value )

The values you'll need are:

adVarChar = 200
AdArray = 0x2000
adParamInput = 1

And you'll call it like:

var param = cmd.CreateParameter( 'par', adVarChar + AdArray, adParamInput, 255, userArray )
Sign up to request clarification or add additional context in comments.

2 Comments

I’d guess that he is using classic ASP with JScript as server-side language. That means he can use all the ASP objects, including Server.
first, yes,I am using classic ASP with JScript as server-side language.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.