Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine 2 or more cursors
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00568592
Message ID:
00569277
Views:
40
>Hi Nadya,
>
>I see where you are coming from. You do a SELECT * but if you have one field with exprssion you will need to enter list of fields isn't that. If you have a
>field with one exprssion and you call a UDF to handle that, you may losse optimization in here. I am talking about RushMore.
>
>Regards,
>
>Doron


Doron,

Perhaps you misunderstood, what I was trying to say: No, I never use UDF in a SELECT STATEMENT (though I may), I use UDF to construct a string, which when would be used in Select Statement :) In other words, my program would be like this:
********************************************************************
*  Description.......: MapRefStr
*  Calling Samples...: 
*  Parameter List....: tcOperationType
*  Created by........: Nadya Nosonovsky 04/02/2001 04:21:34 PM 
*  Modified by.......: Nadya Nosonovsky 04/04/2001 11:34:54 AM
********************************************************************
lparameter tcOperationType
local lcRetStr, lcJoinCondition, lcAdditions, lcWhere
lcRetStr='space(1) as ModiType, '+ ;
         'AssrID, Apn, ParcelID, '+ ;
         'MapNum, WardNum, BlockNum, LotNum, UnitNum, MapData, MapRef, '+ ;
         '.f. as Posted, ctot([]) as PostTime, 0 as Error, '  
if !empty(m.tcOperationType) and m.tcOperationType="MAPREF"
     lcAdditions='PropMstr.ccode, PropMstr.FY, PropMstr.town, '+;
                 'AssrMstr.ModiDate, [ASSRMSTR] as ModiTble, space(1) as APNed, '+ ;
                 'space(1) as Parsed, space(1) as PclIDEd'
else
     lcAdditions='PropMstr.*, space(25) as NewMapref, space(1) as MapRefEd, '+ ;
                 'space(8) as ModiTble, "P" as Source, [ ] as Matched'
endif            
lcJoinCondition = ' FROM PropMstr INNER JOIN ASSRMSTR ON PropMstr.PropID=AssrMstr.PropID'
lcWhere=[ where Complevl='P' and PropMstr.town=']+ojc.Town + ;
        [']+iif(!empty(oJC.FY),[ and PropMstr.FY=']+oJC.FY+['],"")+" and InActvFl<>'A'"
return m.lcRetStr+m.lcAdditions+m.lcJoinCondition+m.lcWhere
And I put MaprefStr() in SelectCmd1Exp. Now the code does:
selectCMD1 = evaluate(SelectCMD1Exp), so this long string would be produced

select &SelectCMD1 ;
       &SelectCMD2 ;
       &Into
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform