Home » SQL & PL/SQL » SQL & PL/SQL » selecting multiple values from a select list
selecting multiple values from a select list [message #126808] Wed, 06 July 2005 14:01 Go to next message
marks20101
Messages: 74
Registered: May 2005
Member
This is almost similar to "Placing a String variable in place of an ID" topic at least the form is.

I have a list box:
htp.FORMSELECTOPEN(cname=>'p_co_id', cattributes=>'size="25%" multiple="multiple" ');

-- OPTION VALUE OUTSIDE OF LOOP, 0 USED AS DUMMY NUMBER TO PASS 'ALL'
htp.p('<option value=" '|| 0 ||' ">' ||'ALL'||' </option> ');
for a1 IN C_COMPANY loop
htp.p('<option value=" '|| a1.co_id||' ">' ||a1.co_cd||' - '|| a1.co_nm||' </option> ');
end loop;

It is set to select multiple selections, but how can I return
these values if a user selectes multiple items?. i.e. 001755, 002787, 003523, 003612. << these are varchar2 datatype
Should I use an array, and if so, how can I go about this?

Thanks,
Mark.........../forum/fa/277/0/
image is attached for a visual of list box and its selected values.
  • Attachment: lb.jpg
    (Size: 37.24KB, Downloaded 1176 times)

[Updated on: Wed, 06 July 2005 14:18]

Report message to a moderator

Re: selecting multiple values from a select list [message #127076 is a reply to message #126808] Fri, 08 July 2005 08:19 Go to previous messageGo to next message
Frank Naude
Messages: 4590
Registered: April 1998
Senior Member
Yes, use something like this:

create or replace package my_package as
  type web_arr is table of varchar2(2000) index by binary_integer;
  empty_web_arr   web_arr;

  procedure get_data_from_form(p_co_id web_arr := empty_web_arr);
  ...


Best regards.

Frank
Re: selecting multiple values from a select list [message #197038 is a reply to message #127076] Mon, 09 October 2006 12:19 Go to previous messageGo to next message
tomatumw
Messages: 1
Registered: October 2006
Location: Fredericksburg, VA
Junior Member
Frank,
Please tell me what the "procedure" represents in your response. Is it the calling procedure to the list creation or is it the resulting procedure from the list creation - thus returning the multiple values selected? I have tried both and still nothing works to return the multiple values.
Many thanks.
TomY.
Re: selecting multiple values from a select list [message #197061 is a reply to message #197038] Mon, 09 October 2006 18:36 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
demo package attached...
  • Attachment: DEMO_PKG.PKS
    (Size: 1.87KB, Downloaded 457 times)
  • Attachment: DEMO_PKG.PKB
    (Size: 7.75KB, Downloaded 454 times)
Previous Topic: sql query books
Next Topic: explain plan error
Goto Forum:
  


Current Time: Sat Feb 08 07:58:26 CST 2025