PREFIX VARCHAR2(1) := 'a';
q_str varchar2(2000) := '';
total_cols integer ;
/************ only change this : define a new array *******************/
type col_array IS VARRAY(5) OF VARCHAR2(100);
col_nms col_array := col_array('name', 'resrce_id', 'addr', 'home_phn', 'mobile_phn');
BEGIN
total_cols := col_nms.count;
FOR i in 1 .. total_cols LOOP
case
when (i=1) then
q_str := PREFIX || '.' || col_nms(i) || ',';
when (i=total_cols) then
q_str := q_str || PREFIX || '.' || col_nms(i);
else
q_str := q_str || PREFIX || '.' || col_nms(i) || ',';
end case;
END LOOP;
dbms_output.put_line('Query String: ' || q_str);
END DOARRAY;
No comments:
Post a Comment