2 Replies Latest reply: Dec 9, 2012 7:51 AM by O.Developer RSS

    problem with duplaicate records

    Naamas
      Hi all
      i have dat block base on tables areas.
      DESC AREAS
      AREA_ID P.K
      AREA_CODE NUMBER,
      AREA_UNIT NUMBER;
      select * from areas ;
      AREA_ID  |AREA_CODE |AREA_UNIT
      1             |   10           |     'A'
      2             |   10           |     'B'
      3             |   20           |     'C'
      4             |   20           |     'D'
      --------------------------------
      the items in my data block are
      AREA_CODE
      AREA_UNIT

      i'm running a procedure to fetch the data for this block like this :
      procedure fetch_data
      is
      v_where VARCHAR2(2000) :='1=1 ';
      begin
      v_where:=v_where ||'and area_code in ( '||:parameter.area_unit ||')';

      SET_BLOCK_PROPERTY('areas',DEFAULT_WHERE,v_where);

      GO_BLOCK('AREAS);
      EXECUTE_QUERY;
      i want that in the are_code i'll get a distinct values
      10
      20
      and not:
      10
      10
      20
      20
      how can i do this ?
      Thanks In Advanced
      Naama