Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL / SQL HtmlForm
"Sandra Auerhammer" <jane21_at_gmx.de> wrote in message
news:cecf4f50.0309022248.708e6f33_at_posting.google.com...
> HI.
>
>
> i need a construct like
> <select>
> <option ...>
> <option ...>
> <option ...>
> <option ...>
> </select>
>
> the option tags should be filled by a query like
> select name form Person;
>
>
> how do i get it?
> i must declare the variables which i know only AFETER the select statement
>
>
>
> hto.formOpen
>
> htp.formSelectOpen
> htp.SelectOption
> htp.SelectOption
> htp.SelectOption
> htp.formSelectClose
> htp.formClose
Sandra,
declare a cursor for the query then loop through the records returned by the cursor to populate the select options in the htlm form e.g.
DECLARE
CURSOR person_names IS
SELECT name
FROM person;
BEGIN
htp.formOpen;
htp.formSelectOpen;
FOR c_rec IN person_names LOOP
htp.SelectOption(c_rec.name);
END LOOP;
htp.formSelectClose;
htp.formClose;
Paul Dixon Received on Wed Sep 03 2003 - 03:37:22 CDT
![]() |
![]() |