Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equivalent of VFP INLIST with string of values
Message
 
À
27/11/2007 16:16:24
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01271536
Message ID:
01271633
Vues:
16
Hey Charles:

>In VFE I have the ability to using dynamic view parameters in remote views. Basically the framework will build SQL statements on the fly depending on the params passed with a great amount of control at the DBCX level for how the comparison will be done. I was looking for a TSQL syntax trick in the WHERE that would give me the equivalent to the inline function in VFP with INLIST where no other cursor is required.

On the VFP side, I think you can create a view parameter behavior class and do something like the following in the GetSqlExpression() method - this code actual came from our friend Dan Goodwin...
LPARAMETERS 	tlVFPSQL AS Boolean
LOCAL lcvalue, lcreturn

lcvalue=this.value
lcreturn=""

IF !EMPTY(lcvalue) 
	lcfield=ALLTRIM(this.oproperties.mcompareto)
	IF !EMPTY(lcfield)
		lcreturn=lcfield+" in ("+lcvalue+")"
	endif	
ENDIF

RETURN lcreturn
If you are working with Jeff, he should have this and related code in his i-layer. Check out iMover_dynamicvp of ivpMover.vcx which Dan helped me with while I was working at Blencowe. This is part of the code where we put a mover in a view parameter container to allow users to select multiple regions to select records with. The mover populates This.Value referenced above with a comma separated list.
Del
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform