Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> populating years in a drop down menu in PL/SQL
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
![]() |
![]() |