Re: Oracle WebServer

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/08/23
Message-ID: <321dcbf0.7539230_at_dcsun4>#1/1


You can use pl/sql tables to do this easily.  

For example, there are type types owa_util.ident_arr (varchar2(30)) and owa.vc_arr. You can create your procedure:    

create or replace procedure MultiSelect( p_listOfValues in owa.vc_arr ) is
begin  

    for i in 1 .. 1000000 loop

	begin 
		htp.p( 'Value ' || i || ' = ' || p_listOfValues(i) ); 
	exception 
		when no_data_found then exit; 
	end; 

    end loop;
end;  

the oracle web agent will map URL encode data like:    

http://yourHost/youWA/owa/MultiSelect?p_listOfValues=Value1&p_listOfValues=Valu e2  

To a pl/sql table automatically starting at index 1. The trick is to iterate over the array until you hit NO_DATA_FOUND to discover how many there are.  

In the event the user might pick NO selection from the list you must either:  

1.) use a hidden field with a known value to ensure some data always gets passed, for example

   <input type=hidden name=p_listOfValues value="Dummy"> 
   <select name=p_listOfValues multiple> 
   <option> 

   ....
   </select>     

then in your procedure, ignore the array element with Dummy in it.  

2.) create a package as such:  

   create or replace package types

      type vcArray is table of varchar2(2000) index by binary integer; 
      nullvcArray vcArray; 

   end types;  

and in your procedure go:  

create or replace procedure multiSelect( p_listOfValues in types.vcArray default types.nullvcArray )
is
begin

   ....
end;
/  

(note the default, your table will now be defaulted to an empty table).  

hope this helps.

On Fri, 23 Aug 1996 10:21:17 +0200, Mark Huber <mhuber_at_iprolink.ch> wrote:

>hi everybody,
>
>i'm new in the world of oracle, SQL*plus and oracle webserver.
>my little questions is:
>
>if i create a form with multiple selection, the form will be submitted to my procedure, but i
>don't know, to decoding the variable of the multiple selection box with the diffrent values ?
>can you help me ?
>
>i looking forward to other people, how develope Oracle webserver application. please conntact
>me.
>
>--
>HSO Information Engineering Ltd. \\\\\/
> Mark Huber //(.).) Tel: +41-01/316 60 30
> Web-Application Developer _at_ ..\ Fax: +41-01/316 60 40
>Baumackserstr.24, CH-8050 Zurich / \__ / Cellular: +41-079/402 86 14
> Switzerland / \___/ Internet:mhuber_at_hso.ch
> /
>

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com -- Check out our web site! Brand new, uses Oracle Web Server and Database


statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Fri Aug 23 1996 - 00:00:00 CEST

Original text of this message