Home » Developer & Programmer » Forms » Display duplicate values just once (oracle forms 10g)
Display duplicate values just once [message #554344] Sun, 13 May 2012 03:45 Go to next message
furqan
Messages: 115
Registered: January 2012
Location: Hyderabad
Senior Member
hi all...

i have master-detail form.in master my bill_id gets generated when new form is open and i copy the
same bill_id in detail(tabular)for each item.all the items which i enter in detail form get save
the same bill_id which got generated.

in another form(which is tabular) i want to display bill_id's from detail form.but in detail form
there are same bill_id's more than once.but i want to display those bill_id's which are more than once only once.


thanks..in advance.
Re: Display duplicate values just once [message #554345 is a reply to message #554344] Sun, 13 May 2012 04:13 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is what you have:
SQL> select deptno, ename, job, sal from emp order by deptno;

    DEPTNO ENAME      JOB              SAL
---------- ---------- --------- ----------
        10 CLARK      MANAGER         2450
        10 KING       PRESIDENT       5000
        10 MILLER     CLERK           1300
        20 JONES      MANAGER         2975
        20 FORD       ANALYST         3000
        20 ADAMS      CLERK           1100
        20 SMITH      CLERK            800
        20 SCOTT      ANALYST         3000
        30 WARD       SALESMAN        1250
        30 TURNER     SALESMAN        1500
        30 ALLEN      SALESMAN        1600
        30 JAMES      CLERK            950
        30 BLAKE      MANAGER         2850
        30 MARTIN     SALESMAN        1250

This is what you want:
SQL> break on deptno
SQL> select deptno, ename, job, sal from emp order by deptno;

    DEPTNO ENAME      JOB              SAL
---------- ---------- --------- ----------
        10 CLARK      MANAGER         2450
           KING       PRESIDENT       5000
           MILLER     CLERK           1300
        20 JONES      MANAGER         2975
           FORD       ANALYST         3000
           ADAMS      CLERK           1100
           SMITH      CLERK            800
           SCOTT      ANALYST         3000
        30 WARD       SALESMAN        1250
           TURNER     SALESMAN        1500
           ALLEN      SALESMAN        1600
           JAMES      CLERK            950
           BLAKE      MANAGER         2850
           MARTIN     SALESMAN        1250

Is that correct?

If so, then - from my point of view - Forms is a wrong tool to do that. Breaks can't be set in Forms. You could do that in Reports, though.

On the other hand, you might create a view and base tabular form on that view. Here's an example: you would NOT display DEPTNO column, but DEPTNO_DISPLAY instead.
SQL> select
  2    rank() over (partition by deptno order by ename) rn,
  3    deptno,
  4    case when rank() over (partition by deptno order by ename) = 1 then deptno
  5         else null
  6    end deptno_display,
  7    ename,
  8    job,
  9    sal
 10  from emp
 11  order by deptno, ename;

        RN     DEPTNO DEPTNO_DISPLAY ENAME      JOB              SAL
---------- ---------- -------------- ---------- --------- ----------
         1         10             10 CLARK      MANAGER         2450
         2         10                KING       PRESIDENT       5000
         3         10                MILLER     CLERK           1300
         1         20             20 ADAMS      CLERK           1100
         2         20                FORD       ANALYST         3000
         3         20                JONES      MANAGER         2975
         4         20                SCOTT      ANALYST         3000
         5         20                SMITH      CLERK            800
         1         30             30 ALLEN      SALESMAN        1600
         2         30                BLAKE      MANAGER         2850
         3         30                JAMES      CLERK            950
         4         30                MARTIN     SALESMAN        1250
         5         30                TURNER     SALESMAN        1500
         6         30                WARD       SALESMAN        1250
You understand that such a form should not be updateable (because you can't modify DEPTNO value).
Previous Topic: Scrollbar is not working properly....
Next Topic: How to: Read a range of excel by webutil?
Goto Forum:
  


Current Time: Fri Jul 05 22:18:27 CDT 2024