Re: htp-package problem

From: Mc Striem <shell.olie_at_12move.nl>
Date: Fri, 26 Oct 2001 00:28:58 +0200
Message-ID: <9ra3qv$srd$1_at_news1.xs4all.nl>


Rüdiger J. Schulz <johannes.schulz_at_web.de> schreef in berichtnieuws 3bd429ba$1_at_netnews.web.de...
> hi all,
>
>
> I have the following procedure:
>
>
> create or replace procedure htp_mult (pval varchar2 := '0')
> as
> begin
> if pval = '0' then
> htp.print('<form>');
> htp.print('<action="http://adress/pls/verk/htp_mult");
> htp.print('method="post">');
> htp.print('<select name="wert" size=3 MULTIPLE>');
> htp.print('<option>one');
> htp.print('<option>two');
> htp.print('<option>three');
> htp.print('</select>');
> htp.print('<br><br><input type="submit" value="submit">');
> htp.print('</form>');
> else
> insert into test (erg, art) values (wert, 'option');
> commit;
> htp.print('Value '||pval||' inserted!');
> end if;
> end;
>
>
> now, if someone choose *more than one* value in the html-form, than I dont
get
> these selected values, or better: I cant evaluate the multiple choice !!
>
> does anybode know, how to make it within a plsql-procedure??
>
> thanks in advance
> Rüdiger J. Schulz
> eMail: rjs_at_berlin.de
> --

It can be done with a few modifications.

- define something like a value for each option.
- add every form field in the parameter list of your procedure
- use a PL/SQL table to pass multiple values for a single parameter. Default
this not with null but with an empty table. An alternative, more complex, option to PL/SQL tables is to 'pack' all selected values with a delimiter into one hidden field using a bit of javascript, assembling it on form post, and to unpack it in your PL/SQL code. This can be used when the underlying database table contains unnormalized fields.

Jan

--
Received on Fri Oct 26 2001 - 00:28:58 CEST

Original text of this message