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: populating years in a drop down menu in PL/SQL

Re: populating years in a drop down menu in PL/SQL

From: <happyardy_at_gmail.com>
Date: 2 Aug 2006 11:33:18 -0700
Message-ID: <1154543598.446209.171540@75g2000cwc.googlegroups.com>


VOILA !!!
G Quesnel, you were bang on target. I changed it to upper case and it worked fine. Thanks a lot for that.

Daniel & Frank, thanks for suggesting the pipelined table functions etc. I am still a lot new to all of this. I'll take a look. We are on Oracle 9i here.

regards

G Quesnel wrote:
> > CURSOR inst_years IS
> > Select 1979+rownum "MyYear"
> > from all_objects
> > where rownum < extract(YEAR from sysdate)-1979+1;
> >
> >
> > htp.p('<TD>');
> > htp.formSelectOpen('p_inst',NULL,'1');
> > htp.formSelectOption('Not listed',NULL,'VALUE=XX');
> >
> > FOR year_rec IN inst_years LOOP
> > htp.formSelectOption(year_rec.MyYear,NULL,
> > 'VALUE=' || year_rec.MyYear);
> > END LOOP;
> >
> > htp.p('</TD>');
> >
> > It doesnt work when I do that. If I comment out the "For loop", it
> > doesnt give me an error atleast. Would you know what is wrong ?
> >
> This is just a shot in the dark as I have never used htp...
> but the column name could be causing you an error ("MyYear" <> MyYear).
> Could you try to remove the double quotes, and use upper case for the
> column name, in the cursor definition and the FOR loop;
> CURSOR inst_years IS
> Select 1979+rownum MYYEAR
> from all_objects
> where rownum < extract(YEAR from sysdate)-1979+1;
> and
> htp.formSelectOption(year_rec.MYYEAR,NULL,
> 'VALUE=' || year_rec.MYYEAR);
Received on Wed Aug 02 2006 - 13:33:18 CDT

Original text of this message

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