Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    7

    Unanswered: value_error while inserting data using a cursor

    the code I am using to concatenate a multiple row/value result set to one name values pair inserted into a table.

    declare
    vdescription varchar2(200);
    prevcase_id number;

    cursor cur1 is
    select a.case_id,b.description from case_classifications a, lm_Case_classification b where a.classification_id = b.classification_id
    order by case_id,description;

    begin
    prevcase_id:=0;
    vdescription:='';
    delete rpt_classifications;

    for cur1_rec in cur1 loop
    if prevcase_id = 0 then
    vdescription:=cur1_rec.description;
    else if cur1_rec.case_id= prevcase_id then
    vdescription:=vdescription||'/'||cur1_rec.description;
    else
    insert into rpt_classifications values (prevcase_id,vdescription);
    end if;

    end if;
    prevcase_id:= cur1_rec.case_id;
    end loop;

    end;
    Last edited by janjir; 04-28-04 at 18:03. Reason: delete

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    duplicate thread, please close
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •