Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Fooling Oracle with arrays then passing them???

Fooling Oracle with arrays then passing them???

From: navychief_rmc <navychief_rmcNOnaSPAM_at_hotmail.com.invalid>
Date: Fri, 04 Feb 2000 07:14:32 -0800
Message-ID: <132de2d7.0d5ae24b@usw-ex0102-015.remarq.com>


Howdy All,
I'm trying to figure out how to pass an "array" between Procedures. I can pass varchar2s, numbers, etc. but how about what appears to be an array? I have one_update and I want to pass aprop_id_array to update_record. I populate the array and then want to pass it using the form submitt. I can't get formhidden to compile, and when I leave formhidden out the program bombs. I've included some of the code below for further explaination.
Any ideas?
Thanks for any help you can offer.



sample code:
note: all the "." mean other code is here but not included for readability.

create or replace package PTSS_CODE is

        type big_arr is table of varchar2(2024) index by binary_integer;

        prop_id_array big_arr;
.
.
.

        procedure one_update(product_id in number DEFAULT 448500765);
.
.
.

        procedure update_record(button in varchar2, product_id in number, nhtm_link in varchar2,

                                           nndp_cat in varchar2,
ngraph in varchar2,npdf_name in varchar2,

                                        npdf_size in varchar2,
npdf_sizetype in varchar2,nremarks in varchar2,

                                        nstitle in
varchar2,nltitle in varchar2, nsummary in varchar2

					,array_size in integer
					,aprop_id_array in
big_arr
					);



/********************************/

   procedure one_update(product_id in number DEFAULT 448500765) is

	stitle	varchar2(31);
	remarks	varchar2(256);
	mremarks	varchar2(256);

.
.
.
	prop_id_array big_arr;
	prop_type_array big_arr;
	prop_value_array big_arr;
	array_cnt integer;
	

   begin
.
.
.

        SELECT a.STITLE, a.LTITLE, a.HTM_LINK, a.remarks, a.NDP_CAT, a.GRAPH_LINK, b.summary

                INTO stitle, ltitle, htm_link, remarks, NDP_CAT, graph_link, summary

	FROM PTSS.pubhtml A, PTSS.product b
	WHERE a.PROD_ID = product_id and b.PROD_ID = product_id;

.
.

        htp.formOpen
(owa_util.get_owa_service_path||'ptss_code.update_record');
.
.

	htp.TableRowOpen;
	htp.TableData(upper('Short Title:'), 'LEFT');
	htp.TableData(htf.FormText('NSTITLE', 20, 31, upper
(stitle)), 'LEFT');
	htp.TableRowClose;

.
.
.
.
	htp.TableRowOpen;
	htp.TableData(upper('Summary:'), 'LEFT');
    htp.tableData('<textarea name="nsummary" rows=3 cols=70 wrap virtual>' || summary || '</textarea>');

        htp.TableRowClose;

.
. /*htp.tabledata('<input

type="text" name="vc_var" size=fld_size maxlength=max_fld_size >');*/
.
.

	htp.FormHidden('array_size', array_cnt);
	htp.FormHidden('aprop_id_array', null);



	htp.formClose;


end;

procedure update_record(button in varchar2, product_id in number, nhtm_link in varchar2,

                nndp_cat in varchar2, ngraph in varchar2, npdf_name in varchar2,

                npdf_size in varchar2, npdf_sizetype in varchar2,nremarks in varchar2,

                nstitle in varchar2,nltitle in varchar2,nsummary in varchar2

		,array_size in integer
		,aprop_id_array in big_arr
		) is
   begin
	if button = 'Update this Pub Changes' then
		UPDATE PTSS.NWPLIST SET HTM_LINK = nhtm_link,
NDP_CAT = nndp_cat, GRAPH_LINK = ngraph
		where PROD_ID = product_id;

		UPDATE PTSS.PRODUCT SET REMARKS = nremarks,
stitle = upper(nstitle),
		ltitle = upper(nltitle), summary = nsummary
		where PROD_ID = product_id;

		update_pdf_info(product_id, npdf_name,
npdf_size, npdf_sizetype);
		htp.p('Success');
		ptss_code.one_update(product_id);

.
.
.
.

        end if;

   exception

	when others then
		htp.htmlopen;
		htp.p('Problem with update_record, '||SQLERRM);
		htp.htmlclose;

   end;

end;

Received on Fri Feb 04 2000 - 09:14:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US