How use parameters with same name in html forms pl/sql

227 views Asked by At

PL/SQL DEVELOPER<------->version:10.0.5.1710

When we use owa_util.choose_date three select tag with the same name are generated....

htp.formopen(curl => 'package.procedure_prube');
owa_util.choose_date(p_name => 'date');
htp.formsubmit(cvalue => 'send');
htp.formclose;

if for example procedure_prube have this structure to print the three options selected in the next web page.....

procedure procedure_prube(date in varchar2)
as
begin
htp.htmlopen;
htp.p('<p>'||date||'</p>');
htp.htmlclose;
end procedure_prube;

This code only print the first option.

I know when the user press the submit button if the form method is get the url have this structure....

http://localhost/dad_name/package.procedure_prube?date=12&date=jen&date=2021

                                                -------------------------------
                                                            query

The query has three parameters with the same name and Oracle captures the first one and the others are discarded. This is the problem I can not resolve.



THIS IS ANOTHER SIMILAR QUESTION

Is there any method to capture some undefined parameter in the procedure? for example

query---->param1=potato&param2=tomato&param3=carrot

 procedure procedure_prube(param1 in varchar2,param2 in varchar2)
    as
    begin
    htp.htmlopen;
    htp.p('<p>'||param1||'</p>');
    htp.p('<p>'||param2||'</p>');
    **--I want to print the param3**
    htp.htmlclose;
    end procedure_prube;

Thanks for your attention.

1

There are 1 answers

0
doberkofler On
  1. Please do not ask multiple questions but open separate ones

  2. You can pass multiple parameter with the same name by either use an array or flexible parameter passing. See the documentation.

    http://www.acme.com/pls/mydad/my_proc?val=john&val=sally

    PROCEDURE my_proc (val IN owa_util.ident_arr);

    http://www.acme.com/pls/mydad/!scott.my_pkg.my_proc?x=a&y=b&x=c

    PROCEDURE my_proc ( name_arr IN owa.vc_arr, value_arr IN owa.vc_arr, p_name IN VARCHAR2, p_start IN PLS_INTEGER DEFAULT 0 )

  3. I am not sure what an “undefined parameter” is, but you most likely can also use flexible parameter passing.