Skip to main content
Participating Frequently
July 21, 2008
Question

Creating a Lottery Application

  • July 21, 2008
  • 2 replies
  • 596 views
Hi all,
I am trying to create a lottery application using coldfusion and oracle but so far have had no luck. Has anyone developed such an application and if so could you please direct me in the right direction. The primary purpose of the Lottery is to select all applicants from a table then randomly select a few winners from all applicants based on the number of prizes available.

Your help will be greatly appreciated.

Thank you

2 replies

Participant
January 15, 2025

I've worked on something similar before! To achieve this, you could use ColdFusion's Rand() function for random selection and Oracle SQL for managing your applicant data. Break it into steps: fetch all applicants, shuffle them, and select winners based on available prizes. Moreover you can check the previous results on my site Lunchtime to use the data.

Inspiring
July 21, 2008
My approach would be:

Select the count from the table, not all the records. I'm not sure, but you might have to add 1 to this number to make the last record eligible.

Use randrange to get your random numbers.

Select the records where the row number corresponds to those numbers. If you google "oracle row number" you should find the necessary sql.