HELP!! can't select with cursor!!

From: Dan Dan <dand_at_cs.uq.oz.au>
Date: 18 Sep 1994 10:22:27 GMT
Message-ID: <35h4d3$4bi_at_uqcspe.cs.uq.oz.au>


I have a problem with select statements when using cursor. eg:

  DECLARE
  cursor c1 is select column_name from T1 where column_name in('A2', 'A3');   col varchar(5);
   ...
  BEGIN
    for c1rec in c1 LOOP

      col:= c1rec.column_name;
      insert into T2(column_value)
      select distinct &&col from T3 where A1=6;
    end loop;
  END;
/   

The program works only for the first column (A2). ie, there is no value inserted for A3 and the value is inserted for A2 twice.

Could somebody please give me some advice?

Shannen Dan
dand_at_uqcspe.cs.uq.oz.au

dept comp science uni of queensland
~ Received on Sun Sep 18 1994 - 12:22:27 CEST

Original text of this message