Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unable to get random generation with OleDb
Message
De
17/09/2006 19:08:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
17/09/2006 18:44:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01154512
Message ID:
01154516
Vues:
11
>That's the problem. In OleDb, each call is within in its own environment. Thus, that's why it always gives the same result. I don't know how to adjust the SQL so within it, such command could be invoked.

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().
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform