I'm trying to write a generic proc that can loop through the elements in a single record, concatenating each to a variable. An example will help :
TYPE T_OUTPUT_ROW IS RECORD (
v_Field_01 CHAR(3),
v_Field_02 CHAR(50));
r_OutputRow T_OUTPUT_ROW;
...
LOOP
FETCH c_Select
INTO r_OutputRow;
...
FOR i in 1.. XXX LOOP
v_Line := v_Line || r_OutputRow.YYY;
END LOOP;
Can this be done? - ie. the XXX and YYY "bits" above. I want to be able to specify my record in on place - in the type declaration (this will change across lots of similar procs), and then not have to change anything else in the procs, so loop through all elements in the record (the XXX above) and somehow reference the field name or number to spit it out into the OutputLine.
Am I going about this in the wrong way? Any thoughts would help - I know what I want to do but can't find a way of actually making it happen!
cheers,
George
TYPE T_OUTPUT_ROW IS RECORD (
v_Field_01 CHAR(3),
v_Field_02 CHAR(50));
r_OutputRow T_OUTPUT_ROW;
...
LOOP
FETCH c_Select
INTO r_OutputRow;
...
FOR i in 1.. XXX LOOP
v_Line := v_Line || r_OutputRow.YYY;
END LOOP;
Can this be done? - ie. the XXX and YYY "bits" above. I want to be able to specify my record in on place - in the type declaration (this will change across lots of similar procs), and then not have to change anything else in the procs, so loop through all elements in the record (the XXX above) and somehow reference the field name or number to spit it out into the OutputLine.
Am I going about this in the wrong way? Any thoughts would help - I know what I want to do but can't find a way of actually making it happen!
cheers,
George