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?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
  • 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 – Tommy Grovnes Jul 10 '12 at 21:58
  • yes,maby I ask oracle store procedure first. – Simon Sheng Jul 11 '12 at 14:31

1 Answers1

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 )
ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
  • 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`. – Martijn Jul 11 '12 at 11:26
  • first, yes,I am using classic ASP with JScript as server-side language. – Simon Sheng Jul 11 '12 at 14:15