I am working inside of a package to display data on a webpage.
I have been utilizing the owa_util.listprint procedure to generate an HTML select list form. Before, I was only allowing for one selection from the list. The datatype of the items in the select list were VARCHAR2.
I want to now open up the select list for multiple selection. Code is as follows
PROCEDURE p_get_param IS
htp.tableRowOpen;
htp.tableData ( 'Select Class Year: ',
cattributes => 'style="text-align:right;"' );
twbkfrmt.P_TableDataOpen ( cattributes => 'style="text-align:left;"' );
OWA_UTIL.LISTPRINT ( p_theQuery => 'SELECT distinct class_description, class_description, null'
||' FROM MY_STUDENT_TABLE'
||' order by 1',
p_cname => 'p_class_year',
p_nsize => 5,
p_multiple => true);
twbkfrmt.P_TableDataClose;
htp.tableRowClose;
END;
PROCEDURE p_display_report(p_class_year IN VARCHAR2) IS
CURSOR applicant_info IS
SELECT o.pidm AS pidm,
o.id AS ID,
o.last_name AS last_name,
o.first_name AS first_tname,
o.middle_initial AS middle_initial,
o.class_description AS class_year
FROM MY_STUDENT_TABLE o
WHERE o.class_description in p_class_year
ORDER BY o.last_name;
END;
From my web page, when I select multiple entries from the select list (via holding CTRL and clicking) I am only able to capture the first value selected. In other words, my query results only reflect one value selected. I am trying to figure out a way to do this. I have changed the datatype to string but that doesn't work either. I guess I am looking for a comma delimited datatype, perhaps. I need a way to capture the multiple values selected into a variable and utilize them in my query cursor.
Any help or ideas on this would be greatly appreciated. Thanks in advance.