Home » Developer & Programmer » Forms » random selection (Forms 6i)
random selection [message #598994] Mon, 21 October 2013 05:14 Go to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

i have a parameter form where user will input from item to item and items within this range will be come as output , but i want an option to select the random items from the list, like i may not select all the items from 1 to 10 , but instead i want to pick or select randomly , i may opt for 1,3,4 and 7.
Re: random selection [message #598996 is a reply to message #598994] Mon, 21 October 2013 05:20 Go to previous messageGo to next message
John Watson
Messages: 4610
Registered: January 2010
Location: Global Village
Senior Member
orclz> select * from emp sample(20);

     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7521 WARD       SALESMAN        7698 1981-02-22 00:00:00       1250        500         30
      7698 BLAKE      MANAGER         7839 1981-05-01 00:00:00       2850                    30

orclz> select * from emp sample(20);

     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7521 WARD       SALESMAN        7698 1981-02-22 00:00:00       1250        500         30
      7844 TURNER     SALESMAN        7698 1981-09-08 00:00:00       1500          0         30
      7876 ADAMS      CLERK           7788 1987-05-23 00:00:00       1100                    20
      7902 FORD       ANALYST         7566 1981-12-03 00:00:00       3000                    20

orclz> select * from emp sample(20);

     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7521 WARD       SALESMAN        7698 1981-02-22 00:00:00       1250        500         30
      7566 JONES      MANAGER         7839 1981-04-02 00:00:00       2975                    20

orclz>
Re: random selection [message #598999 is a reply to message #598996] Mon, 21 October 2013 05:28 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

can you explain john , what exactly i want is like , i dont want to use between clause , instead use a pick from list.
Re: random selection [message #599000 is a reply to message #598999] Mon, 21 October 2013 05:37 Go to previous messageGo to next message
John Watson
Messages: 4610
Registered: January 2010
Location: Global Village
Senior Member
You don't seem to read your own questions, never mind my answer. You wanted random rows, and Ive demonstrated the syntax to do this. Now you are talking about BETWEEN. Perhaps someone else can make sense of this. I can't.
Re: random selection [message #599047 is a reply to message #599000] Mon, 21 October 2013 15:31 Go to previous message
mughals_king
Messages: 351
Registered: January 2012
Location: pakistan
Senior Member
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3181424400346795479

http://stackoverflow.com/questions/17449999/generate-a-random-date-in-oracle-with-dbms-random

http://birijan.com.np/?q=getting+random+number+string++date+and+random+rows

http://www.techrepublic.com/article/use-dbms-random-to-generate-text-and-date-values/

select * from dual where dbms_random.value = dbms_random.value;



Hope you will get something from these links


Regard
Mughal



Previous Topic: How can i know what records are showed in data_block
Next Topic: Replace in Oracle Forms
Goto Forum:
  


Current Time: Tue Sep 30 16:38:24 CDT 2014

Total time taken to generate the page: 0.12076 seconds