Home » SQL & PL/SQL » SQL & PL/SQL » Create Cursor for List Box
Create Cursor for List Box [message #198976] Thu, 19 October 2006 08:29 Go to next message
deongee
Messages: 8
Registered: October 2006
Junior Member
Hi All,
I'm trying to create a cursor in PL/SQL Oracle Portal for a drop down list box.

I've created it already but I have to type each name in making it tedious.

Here is my code:

 
  procedure draw_filter_menu is
    v_url varchar2(100);
	v_url_rpt varchar2(100);
	v_url_rpt2 varchar2(100);
	v_url_hist1 varchar2(100);
	v_url_hist2 varchar2(100);
	v_call_date3 varchar2(10);
	
  begin
  
    v_url := '/p/development_folder/deon_folder/dk_help_desk';
    v_url_rpt := '/p/development_folder/deon_folder/help_desk_report';
    v_url_rpt2 := '/p/development_folder/deon_folder/help_desk_report_test';
 	v_url_hist1 := '/p/development_folder/deon_folder/histogram_1week';	
 	v_url_hist2 := '/p/development_folder/deon_folder/histogram_1month';
	
		
	htp.p (cl_base.cl$box_util.draw_begin (
           p_box_style => 3,
           p_width => '90%',
           p_title => 'Filter Data By')
          );
    htp.p ('<table width="250"><ul class="style2">
	
		
    <form name="banner_form" method="post" action="">
	<tr>
		<td height="30"><font size="-2" style="font-weight:600">ASSIGNEE</font></td><td height="30">
		
	<select name="p_keyareas" class="banner_poplist" onChange="goToURL(this)">
		<option value="NOOP"><b>Select Assignee ...</b>
		<option value="' || v_url_rpt || '?staff_id=DBALLARD&status=ALL&dept_code=ALL">Dan Ballard
		<option value="' || v_url_rpt || '?staff_id=ABENNETT&status=ALL&dept_code=ALL">Angela Bennett
		<option value="' || v_url_rpt || '?staff_id=CHANBOYD&status=ALL&dept_code=ALL">Chantay Boyd
		<option value="' || v_url_rpt || '?staff_id=BBROOKS&status=ALL&dept_code=ALL">Brick "Phil" Brooks
		<option value="' || v_url_rpt || '?staff_id=EDDILUGO&status=ALL&dept_code=ALL">Ed Dilugo
		<option value="' || v_url_rpt || '?staff_id=JGAUCHEL&status=ALL&dept_code=ALL">Joseph Gauchel
		<option value="' || v_url_rpt || '?staff_id=TLAI&status=ALL&dept_code=ALL">Ted Lai
		<option value="' || v_url_rpt || '?staff_id=PPAULETT&status=ALL&dept_code=ALL">Patrick Paulett
		<option value="' || v_url_rpt || '?staff_id=DEBSACHS&status=ALL&dept_code=ALL">Deb Sachs
		<option value="' || v_url_rpt || '?staff_id=MRICHTER&status=ALL&dept_code=ALL">Marion Richter
		
	</select>
	    </td>
	</tr>
	
	<tr>
		<td width="100" height="30"><p class="halfspaced">
	<font size="-2" style="font-weight:600">DEPARTMENT</font></td><td height="20">
	<select name="p_keyareas" class="banner_poplist" onchange="goToURL(this)">
			<option value="NOOP"><b>Select Department...</b>
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=AAG">AAG
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM">ADM
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-BFP">ADM-BFP
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-CMU">ADM-CMU
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-ET">ADM-ET
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-EXO">ADM-EXO
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-FSS">ADM-FSS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-GIS">ADM-GIS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-ITFM">ADM-ITFM
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-ITM">ADM-ITM
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-JT">ADM-JT
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-PPS">ADM-PPS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ADM-REC">ADM-REC
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=AFO">AFO
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=APP">APP
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=CCS">CCS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=CCU">CCU
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=CEOS">CEOS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=CES">CES
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=CFTF">CFTF
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=CTS">CTS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=DSS">DSS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=DSS-HS">DSS-HS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ECU">ECU
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ELU">ELU
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FAR">FAR
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FARA">FARA
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FIR">FIR
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FLTF">FLTF
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FOIA">FOIA
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FRBC">FRBC
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FRD">FRD
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FRD-ETFDC">FRD-ETFDC
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FRD-ETFH">FRD-ETFH
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FRD-GENRE">FRD-GENRE
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=FRD-KAT">FRD-KAT
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=GEN">GEN
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=GLL">GLL
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=HAJ">HAJ
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=HBT">HBT
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=HUMANTR">HUMANTR
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ICI">ICI
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ICI-ITFM">ICI-ITFM
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ISSG">ISSG
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=JMD">JMD
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=JPS">JPS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=JRC">JRC
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=LLU">LLU
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=LSU">LSU
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=MLK">MLK
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=NDD">NDD
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=NDD-SOD">NDD-SOD
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=NDD-WIRE">NDD-WIRE
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=NSD-AAG">NSD-AAG
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OCD">OCD
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OCR">OCR
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OEO">OEO
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OIA">OIA
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OPD">OPD
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OPL">OPL
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OPM">OPM
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=OSI">OSI
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=PAS">PAS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=PER">PER
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=PIN">PIN
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=POL">POL
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ROM">ROM
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=RUS">RUS
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=SDTF">SDTF
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=ST">ST
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=SU">SU
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=TTF">TTF
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=TVCSTF">TVCSTF
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=WCT">WCT
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=WIT">WIT
			<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=WSU">WSU
	</select></td></tr>
	
	<tr>
		<td width="100" height="30"><p class="halfspaced">
	<font size="-2" style="font-weight:600">STATUS</font></td><td height="30">
	<select name="p_keyareas" class="banner_poplist" onChange="goToURL(this)">
		<option value="NOOP"><b>Select Current Status ...</b>
		<option value="' || v_url_rpt || '?staff_id=ALL&status=OPEN&dept_code=ALL">Open
		<option value="' || v_url_rpt || '?staff_id=ALL&status=CLOSED&dept_code=ALL">Closed
		<option value="' || v_url_rpt || '?staff_id=ALL&status=INPROG&dept_code=ALL">In Progress
		
	</select></td></tr>
	<tr>
		<td width="100" height="30"><p class="halfspaced">
	<font size="-2" style="font-weight:600">HISTORY</font></td><td>
	<select name="p_keyareas" class="banner_poplist" onChange="goToURL(this)">
		<option value="NOOP">Select Histogram View...
		<option value="' || v_url_hist1 || '">One Week
		<option value="' || v_url_hist2 || '">One Month
	</select>
	</td></tr>
	</table><br>
	<hr style="color:#336699" width="250" align="center">
	<table width="100%">
	<tr>
		<td><p class="halfspaced"><p class="halfspaced"><center>
		<a href="' || v_url || '"><font size="-2" style="font-weight:600" style="text-decoration:none"><br>
	BACK TO DK HELP DESK MAIN PAGE</font></a></center></td></tr></table>');
    htp.p (cl_base.cl$box_util.draw_end);
  end draw_filter_menu;

end;
/
Re: Create Cursor for List Box [message #198988 is a reply to message #198976] Thu, 19 October 2006 09:14 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I'd recommend storing that information in a table somewher, and writing yourself a function that will return
<option value="' || v_url_rpt || '?staff_id=ALL&status=ALL&dept_code=xxx">xxx
for a given row in the table.
icon12.gif  Re: Create Cursor for List Box [message #199002 is a reply to message #198976] Thu, 19 October 2006 10:23 Go to previous message
deongee
Messages: 8
Registered: October 2006
Junior Member
Just did that and it works well. Thanks for your help Smile
Previous Topic: hmac-sha256
Next Topic: blob
Goto Forum:
  


Current Time: Fri Dec 09 13:55:49 CST 2016

Total time taken to generate the page: 0.18597 seconds