Help in PL/SQL Add_Group_Row

From: Guoming <n2458918_at_sparrow.qut.edu.au>
Date: Tue, 25 May 1999 13:45:16 +1000
Message-ID: <Pine.OSF.3.93.990525134138.141A-100000_at_sparrow.qut.edu.au>



The below PL/SQL code seems to work find, but when i call it witha LOV, the Add_Group_Row(s) doesn't appear. Is my code wrong?

Procedure order_list IS BEGIN
  DECLARE
    rg_name VARCHAR2(40) := 'orders_list';     rg_id RecordGroup;
    col1 GroupColumn;
    errcode Number;
    row_no Number;
    CURSOR c1 IS
    SELECT order_no from request where order_no NOT IN(     SELECT request.order_no
    FROM request, invoice
    WHERE request.order_no = invoice.order_no);

  BEGIN
    rg_id := Find_Group(rg_name);
    IF ID_Null(rg_id) THEN

      rg_id := Create_Group_From_Query( rg_name, 
                'select distinct r.order_no ' 

||'from shipped_product sp, request r '
||'where r.order_no = sp.order_no and r.product_no = sp.product_no '
||'and sp.ship_total < r.order_qty');
errcode := Populate_Group(rg_id);

    rg_id := Find_Group(rg_name);
    IF ID_Null(rg_id) THEN
      rg_id := Create_Group_From_Query( rg_name, 
                'select distinct r.order_no ' 

||'from shipped_product sp, request r '
||'where r.order_no = sp.order_no and r.product_no =
sp.product_no '
||'and sp.ship_total < r.order_qty');
errcode := Populate_Group(rg_id); -- delete_Group_Row(rg_id, ALL_ROWS); row_no := Get_Group_Row_Count(rg_id); col1 := Find_Column(rg_name||'.order_no1'); IF not ID_Null(col1) THEN FOR c1rec IN c1 LOOP Add_Group_Row(rg_id, END_OF_GROUP); row_no := row_no + 1; Set_Group_Number_Cell(col1, row_no, c1rec.order_no); END LOOP; END IF;

    END IF;
  END;
END; Kok Ming
Undergrad Fac. IT, QUT Brisbane Received on Tue May 25 1999 - 05:45:16 CEST

Original text of this message