Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Samir H.
  Where is Samir H.?
 Yogyakarta
 Indonesia
 Samir H.
 To: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 Tags
Subject: RE: SQL query problem
Thread ID: 268724 Message ID: 268781 # Views: 25 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Errors & Debugging
Date: Wednesday, July 14, 2010 4:02:02 PM         
   


> >
> >
> > Thanks Anil.
> >
> > Cast function is working properly.
> >
> > Nadeem Iqbal
>
> Calling a UDF (UserDefined Function) is quite slow in SQL queries; you should put those different search conditions and result strings in an ICASE() structure instead.
>
> -Anders

Hi Anders
Such a ICASE() can become very complex (or/and large). Is there a point where you switch to a UDF because of readability?

edited
I could replace the simple udf I had easily. I want to ask also: when it gets into complicated UDFs, would you split it into smaller UDF?
SELECT IIF(field1=1,smallerUDF(),"Income") as Desc, field2 ...

Or is performance lost the same once we call any UDF?

Regards
Samir

ENTIRE THREAD

SQL query problem Posted by Nadeem Iqbal @ 7/14/2010 9:34:01 AM
RE: SQL query problem Posted by Martin Krivka @ 7/14/2010 9:36:41 AM
RE: SQL query problem Posted by Nadeem Iqbal @ 7/14/2010 9:47:03 AM
RE: SQL query problem Posted by Anil Sharma @ 7/14/2010 9:42:34 AM
RE: SQL query problem Posted by Nadeem Iqbal @ 7/14/2010 9:47:53 AM
RE: SQL query problem Posted by Anders Altberg @ 7/14/2010 1:00:13 PM
RE: SQL query problem Posted by Samir H. @ 7/14/2010 4:02:02 PM
RE: SQL query problem Posted by Anders Altberg @ 7/15/2010 3:06:12 PM