Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to get random generation with OleDb
Message
From
17/09/2006 19:14:01
 
 
To
17/09/2006 19:08:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01154512
Message ID:
01154517
Views:
10
>Sorry. I wanted to clarify this point, just in case you didn't know.
>
>Testing repeatedly for rand(-1) will give you the same "random" number several times in a row, before goint to the next one, so that can probably be discarded.
>
>Is it possible to call a UDF from the SELECT statement? If yes, a workaround might be to declare a global variable, to figure out whether the UDF was already invoked before. If the answer is "no", initialize the random number generator (rand(-1)). In any case, just return rand().

This is a one call with the OleDb provider. So, I need to find a way to achieve that within the SQL. Yes, RAND(-1), within the SQL is a no go. As you said, it always return the same random generator for each record so this doesn't bring me any further. With OleDb provider, I don't know if it is possible to set the RAND(-1) in memory before launching any SQL calls into it.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform