Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verification on IIF() in SQL clause
Message
 
 
À
16/03/2003 11:33:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00766260
Message ID:
00766318
Vues:
31
>>I ran a test in VFP7 and VFP8 and don't see any difference between them.
>
>My function was run the number of times as per the number of records in Temp. It's just that it was being called even when the Type=2, which is wasn't suppose to.

Michel,

It wasn't called for type=2 but was called in the stage where VFP determines the size of the field. Looks like VFP evaluates both expressions in IIF() to get correct size of a field. Here's another test wich demonstartes that.
SELECT *, ;
		PADR(IIF(1=1, "1", myudf("2",RECNO())),1) ;
	FROM test
* z.z
2 1
As you can see myudf shouldn't be ever executed but it is for record #1. And again I see the same result in VFP7 and 8.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform