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 -> Loop Through array in stored procedure

Loop Through array in stored procedure

From: jpabich <jpabich_at_eisincorporated.com>
Date: 19 Sep 2006 09:39:31 -0700
Message-ID: <1158683971.707388.262340@m73g2000cwd.googlegroups.com>


How can I loop through an array in a stored procedure to get the last value in the array?
Here is my SP so far:

CREATE OR REPLACE PROCEDURE prPM_TIMER_RESULT_ST_TZ (

	i_order_id VARCHAR2,
	i_batch_id VARCHAR2,
	i_timer    VARCHAR2,
	ts OUT VARCHAR2

)
AS
tz VARCHAR2;
STR_ARRAY VARCHAR2(4000);
i INTEGER;

BEGIN

	SELECT STOP_TIMESTAMP INTO tz FROM PM_TIMER_RESULT_ST
	WHERE
	order_id = i_order_id AND
	batch_id = i_batch_id AND
	timer_name = i_timer;


STR_ARRAY := split(tz, '-');

for (i=0;i<count(STR_ARRAY);i++)
{
  ts = STR_ARRAY[i];
}         

END;
/ Received on Tue Sep 19 2006 - 11:39:31 CDT

Original text of this message

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