Parsing Through the Multi Selection Values in a PL/SQL Procedure
cloakedNov 1 2011 — edited Nov 1 2011Greetings,
This should be an easy one for one of you PL/SQL experts. I'm not, so I am unsure how to code this up.
I have a Multi Selection page item and am passing the value of it to a PL/SQL routine as a parameter. I am able to use the value if I only pass my procedure one value, so I have it working. Just not with multi-values I need the code in the procedure to loop through the values. How do I code that up? The procedure is relatively short and is included below. p_cell is the multi-value parameter.
Oh yes... You probably need to know this. The values are coming in like this - 1-3:2-3:3-3:5:6
Also, the values are the x-y coordinates of a grid I have over an image on the page. The routine removes certain cells (1-3, etc.) from the grid. The grid is created using HTML, so I have to remove lines of HTML to remove a cell from the grid. Just in case that is helpful.
Thx, Tony
= = = = = = =
create or replace
procedure qcis_remove_grid_cell(p_id IN NUMBER,p_cell IN VARCHAR2) as
v_position number;
v_position_from_end number;
v_line_start number;
v_line_end number;
v_length number;
v_html clob;
BEGIN
BEGIN
select imagemap_html into v_html from qcis_im_template_draft
where header_id = p_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_html := NULL;
END;
v_length := length(v_html);
v_position := INSTR(v_html,'alt="'||p_cell||'"');
v_position_from_end := (v_length - v_position) * -1;
v_line_start := INSTR(v_html,'<area shape',v_position_from_end) - 1;
v_line_end := INSTR(v_html,'/>',v_position) +2;
v_html := substr(v_html,1,v_line_start) || substr(v_html,v_line_end);
UPDATE qcis_im_template_draft SET imagemap_html = v_html WHERE header_id = p_id ;
END qcis_remove_grid_cell;
Edited by: cloaked on Nov 1, 2011 8:01 AM