Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query challenge 5 - fill in the holes
Message
From
26/06/1998 10:44:02
 
 
To
26/06/1998 09:38:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00111733
Message ID:
00111924
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform