It's not a secret anymore!
The moose likes Oracle/OAS and the fly likes how to select random record from cursor Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Reply Bookmark "how to select random record from cursor" Watch "how to select random record from cursor" New topic
Author

how to select random record from cursor

pravin karne
Ranch Hand

Joined: Jul 26, 2007
Posts: 31
Hi,

i want to select random record from cursor

for example
CURSOR c1
IS
SELECT ADLIST
FROM SH_KEY_ADSLIST
WHERE CATEGORY=10 and AGE=-1 and TIME=-1
ORDER BY MO_NUM;

now cursor is contain 10 rows

now i want only one record from it but that should be random

another question is
can i find how many rows in the cursor are?

reply
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to select random record from cursor
 
Similar Threads
Calling Oracle Stored Procedure which has parameter as CURSOR
Check if record exists in database
help me plz
Refresh Cursor in Stored proc Oracle
Question on Cursors