Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query challenge 5 - fill in the holes
Message
De
26/06/1998 10:44:02
 
 
À
26/06/1998 09:38:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00111733
Message ID:
00111924
Vues:
13
Hi Edward ---

Doesn't your solution kinda violate the "suggestion" by MS that you avoid UDFs in SELECT statements?



>
>Scan wouldn't be worse, but if you want Select-SQL, ok:
>
>use d:\vfp5test\table3
>select recno() as recno, * from table3 into cursor tmp1 nofilter
>select getnewfield(recno,'field1') as f1, getnewfield(recno,'field2') as f2,getnewfield(recno,'field3') as f3 from tmp1 into cursor tmp2 nofilter
>brow
>return
>
>function getnewfield
>parameter nRecno,cFieldname
>select table3
>go nRecno
>if isnull(eval(cFieldname))
> do while isnull(eval(cFieldname))
>  skip -1
>  if bof()
>   return 0
>  endif
> enddo
>endif
>return eval(cFieldname)
>return
>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform