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

populating years in a drop down menu in PL/SQL

From: <happyardy_at_gmail.com>
Date: 2 Aug 2006 09:15:53 -0700
Message-ID: <1154535353.073764.207240@h48g2000cwc.googlegroups.com>


Guys,
I am new to PL/SQL. I am trying to have a drop down menu with years from 1980-2006 etc. How do I write this? So far I have the following..

CURSOR inst_years IS
  SELECT EXTRACT(YEAR FROM SYSDATE) 'year'   FROM DUAL;
// This cursur just returns 2006. What I am looking for is actually all
years from 1980
// to 2006 in my drop down menu. I'll need to modify the cursor. Please
let me know how I
// can do this. But that is just the part of my problem, What I dont
know is how do I get the
// value into my loop below since I dont know the actual name of the
field.

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.<What do I put here?>,NULL,
                                'VALUE=' || year_rec.<What do I put
here>);
         END LOOP;

htp.p('</TD>');

thanks

Received on Wed Aug 02 2006 - 11:15:53 CDT

Original text of this message

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