how to generate random records [message #35607] |
Mon, 01 October 2001 03:23 |
Sangeeta
Messages: 9 Registered: October 2001
|
Junior Member |
|
|
i have a table that stores questions.
i need to generate questions randomly so that each time a student sits for the test he gets a different set of questions each time
i'll be very greatful if anyone could help me.
i tried using the get_hash_value function but didn't achieve the purpose.
the dbms_random package is too inefficient .i need a better solution
----------------------------------------------------------------------
|
|
|
|
Re: how to generate random records [message #35618 is a reply to message #35607] |
Mon, 01 October 2001 14:53 |
oraboy
Messages: 97 Registered: October 2001
|
Member |
|
|
I guess, you can write a simple procedure to pick a random no (with an algorithm which uses time component)
al you need to include a few more lines to ensure same question is not repeated again in the same test
Oraboy
----------------------------------------------------------------------
|
|
|
Re: how to generate random records [message #35620 is a reply to message #35618] |
Mon, 01 October 2001 15:22 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
Why reinvent the wheel? I still don't understand his comment that DBMS_RANDOM is "inefficient". It's sole purpose is to generate random numbers and it does so very efficiently.
----------------------------------------------------------------------
|
|
|
Re: how to generate random records [message #35648 is a reply to message #35607] |
Wed, 03 October 2001 20:35 |
Sangeeta
Messages: 9 Registered: October 2001
|
Junior Member |
|
|
hi todd,
The reason why i feel that dbms_random package is inefficient is that...
"If you need 100 records, get 100 random numbers using dbms_random package and read until the rownum equals the random number".The inefficiency lay in the fact that if your random number generator selected rows 500, 10000 and 2000 you need to read 12500 records to get at those 3 random records. As the number of random records you require gets bigger, the overhead associated with this method becomes massive.
todd i still have no clue of how to decrypt my data(this is what i had asked in my previous query)
hope to hear from u soon
----------------------------------------------------------------------
|
|
|
how can I use the dbms_random package? [message #35744 is a reply to message #35607] |
Thu, 11 October 2001 10:02 |
Bernd
Messages: 2 Registered: October 2001
|
Junior Member |
|
|
I need a function which selects 150000 records from a table with 3Mio records random. How can I do this. Thanx for help!
----------------------------------------------------------------------
|
|
|
|