Randomize Query results?

2009-10-13 Thread Yuliang Ruan
I have a Query of Query right now that I'd like to have the results sort order randomized. Any ideas? I've seen examples dependent on the dbms for producing a random randomization, but is there any way to do that within QofQ? The base query that my QoQ is operating on is a cached Oracle

Re: Randomize Query results?

2009-10-13 Thread Dave Watts
I have a Query of Query right now that I'd like to have the results sort order randomized.  Any ideas?   I've seen examples dependent on the dbms for producing a random randomization, but is there any way to do that within QofQ?   The base query that my QoQ is operating on is a cached

Re: Randomize Query results?

2009-10-13 Thread Barney Boisvert
If you're picking one item from a query, you can just do: myQuery.myColumn[randRange(1, myQuery.recordCount)] That'll be way more efficient than reordering the whole query. cheers, barneyb On Tue, Oct 13, 2009 at 2:53 PM, Yuliang Ruan yuliangr...@hotmail.com wrote: I have a Query of Query

RE: Randomize Query results?

2009-10-13 Thread Paul Vernon
Also brainstorming for other alternatives. It's a simple round robin load balancer. I'd rather not have the first unit just by database index order selected all the time. This is what I did... VacancyID is a primary key... cfset theVacancyID = q.VacancyID[RandRange(1, q.recordcount)]

Re: Randomize Query results?

2009-10-13 Thread Rick Root
What about adding a blank column to your query results select '' as foo, othercols from table cfloop query=qry cfset querySetCell(qry,foo,rand(),currentrow /cfloop and then select * from qry order by foo Maybe something like that would work. Rick

randomize

2005-03-25 Thread CFDEV
Hi, I have a query and i want to display the results randomize at each load of the page. query : select questID from quest order by questID There is 50 questID. I'm under CF5 for this one. Thanks Pat ~| Discover

Re: randomize

2005-03-25 Thread Barney Boisvert
randomize at each load of the page. query : select questID from quest order by questID There is 50 questID. I'm under CF5 for this one. Thanks Pat -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites

RE: randomize

2005-03-25 Thread CFDEV
Great thanks Barny, it works great and performance is perfect Pat -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: March 25, 2005 12:56 To: CF-Talk Subject: Re: randomize Like pick one record at random, or display all 50 in a random order? I'm thinking

RE: randomize

2005-03-25 Thread Adrian Lynch
: randomize Hi, I have a query and i want to display the results randomize at each load of the page. query : select questID from quest order by questID There is 50 questID. I'm under CF5 for this one. Thanks Pat -- No virus found in this outgoing message. Checked by AVG Anti-Virus

Re: randomize

2005-03-25 Thread Sam Farmer
randomize at each load of the page. query : select questID from quest order by questID There is 50 questID. I'm under CF5 for this one. Thanks Pat ~| Logware (www.logware.us): a new and convenient web-based time

Re: randomize()

2004-01-26 Thread Christian Cantrell
On Friday, January 23, 2004, at 03:24PM, Tony Weeg wrote: does randomize do anything for randRange(), or ONLY for rand() Here's a lot more information than you probably wanted to know: http://www.markme.com/cantrell/archives/004256.cfm Christian [Todays Threads] [This Message

RE: randomize()

2004-01-26 Thread Tony Weeg
excellent christian. thanks. tony -Original Message- From: Christian Cantrell [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 10:25 AM To: CF-Talk Subject: Re: randomize() On Friday, January 23, 2004, at 03:24PM, Tony Weeg wrote: does randomize do anything for randRange

RE: randomize()

2004-01-26 Thread Tony Weeg
so do you hardcode your min/max at the top of the cfc? you don't pass them in right? tony -Original Message- From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 10:41 AM To: CF-Talk Subject: RE: randomize() excellent christian. thanks. tony -Original

Re: randomize()

2004-01-26 Thread Christian Cantrell
They should be passed in.The hardcoded zeros are defaults which actually result in the next() function returning any number within the range of an integer.The component is meant to be used like this: cfset rng = createObject(component, com.macromedia.util.Random)/ cfset rng.setBounds(1, 52)/

randomize()

2004-01-23 Thread Tony Weeg
does randomize do anything for randRange(), or ONLY for rand() thanks. ...tony tony weeg senior web applications architect navtrak, inc. www.navtrak.net [EMAIL PROTECTED] 410.548.2337 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

RE: randomize()

2004-01-23 Thread Samuel R. Neff
When either rand() or randRange() is used for the first time in a request, a random number generator is instantiated using the value of getTickCount() as the seed.This same random number generator is used for all rand(), randRange(), and randomize() calls for the remainder of the request. So

Re: randomize()

2004-01-23 Thread Jim McAtee
:24 PM Subject: randomize() does randomize do anything for randRange(), or ONLY for rand() thanks. ...tony tony weeg senior web applications architect navtrak, inc. www.navtrak.net [EMAIL PROTECTED] 410.548.2337 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe

RE: randomize()

2004-01-23 Thread Tony Weeg
:[EMAIL PROTECTED] Sent: Friday, January 23, 2004 6:18 PM To: CF-Talk Subject: RE: randomize() When either rand() or randRange() is used for the first time in a request, a random number generator is instantiated using the value of getTickCount() as the seed.This same random number generator is used

using Randomize(GetTickCount())

2003-08-14 Thread Mike Mertsock
Hi folks, We suddenly encountered an interesting problem with using GetTickCount() to initialize random number generation. We have this line of code at the top of many files that endeavour to use random numbers: cfset Randomize(GetTickCount()) GetTickCount() returns a different number every

RE: using Randomize(GetTickCount())

2003-08-11 Thread Ryan Emerle
yup, you need to shrink the number used in the Randomize function to less than the size of an integer. Try taking the Right() of getTickCount() or dividing/subracting it by a large number to reduce its size. I recommend just using the Right() function or by simply subtracting a larger number

Re: using Randomize(GetTickCount())

2003-08-10 Thread Kim Brown
it and resubscribe if you want to get this info THANK YOU... I'll give you one day to get this message then delete the account. - Original Message - From: Mike Mertsock [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, August 08, 2003 8:59 PM Subject: using Randomize(GetTickCount

Randomize

2000-11-27 Thread paul smith
The following works in CFAS 4.01 but not CFAS 4.51: CFSET TMP = Randomize(OrderID) Changing to: CFSET TMP = Randomize("#OrderID#") is no help. Any suggestions? best, paul ~~ Structure your ColdFusion code with Fusebox. Get the off

Re: Randomize

2000-11-27 Thread paul smith
Yep! CFAS 4.5.1 also pukes on Randomize("OrderID"). best, paul At 03:33 PM 11/27/00 -0500, you wrote: Have you tried putting quotation marks around OrderID without the # signs? e.g. CFSET TMP = Randomize("OrderID") - - - Jeanne - Original Message - From:

RE: Randomize

2000-11-27 Thread Dave Watts
The following works in CFAS 4.01 but not CFAS 4.51: CFSET TMP = Randomize(OrderID) Changing to: CFSET TMP = Randomize("#OrderID#") What error does it return? That code works fine for me on CF 4.5.1 SP2. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202

RE: Randomize

2000-11-27 Thread paul smith
nd I was able to see that CFAS 4.5.1 said OrderID generated as above was not an integer. Switching to CFSET OrderID = TimeFormat(Now(), "hhmmss") worked fine. best, paul At 04:48 PM 11/27/00 -0500, you wrote: The following works in CFAS 4.01 but not CFAS 4.51: CFSET TMP = R