Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP: URL contains multiple items with the same name. How to read ?

Re: HELP: URL contains multiple items with the same name. How to read ?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 30 Jun 1998 13:50:05 GMT
Message-ID: <3598ec79.2267510@192.86.155.100>


A copy of this was sent to "Patrick Baanvinger" <pbr_at_bikker.nl> (if that email address didn't require changing) On Tue, 30 Jun 1998 14:48:10 +0200, you wrote:

>Hi,
>
>I am writing a HTML form. When I post this form ( to a pl/sql function), I
>can read al the items in the function through parameters. There is one 1 to
>many relation. This can be solved with a selection list or checkboxes.
>This works great except when I submit my form the parameters are submitted
>like this:
>
>url?param1=Value?param2=Value?param2=Value1?param2=Value2?param3=Value
>
>where param2 represents the 1 to many relation.
>
>Any suggestions ???????
>
>thnxs in advance,
>Patrick Baanvinger
>
>
>

the way to do this is via pl/sql tables. I like to create a package that contains the definition of my array (rather then using the owa.vc_arr or owa_util.ident_arr. the reason is that I like to have a way to default my tables and in order to do that we need to declare an 'EMPTY' one...)

SQL> create or replace package types
  2 as

  3     type array is table of varchar2(255) index by binary_integer;
  4     empty_array array;

  5 end;
  6 /

Package created.

Then, you can create a procedure such as:

procedure demo_list( p_list in types.Array default types.empty_Array ) as
begin

        htp.uListOpen;
        for i in 1 .. 100000 loop
        begin
                htp.listItem( p_list(i) );
        exception
                when no_data_found then exit;
        end;
        end loop;
        htp.uListClose;
        htp.formOpen( 'demo_list' );
        htp.formSelectOpen( cname=>'p_list', nsize => 5, 
                            cattributes=>'Multiple');
        for x in ( select username from all_users where rownum < 100 ) loop
                htp.formSelectOption( x.username );
        end loop;
        htp.formSelectClose;
        htp.formSubmit;
        htp.formClose;

end;

This will let you pick as many items from the list as you want and then pass them in and print them....  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Tue Jun 30 1998 - 08:50:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US