Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql dynamic
Message
De
17/10/2011 15:16:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Sql dynamic
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01526661
Message ID:
01526661
Vues:
94
hi all, I need help with this, I want to do a consultation with several parameters in a stored procedure but these parameters do not always have values, but which depends on parameters chosen by the user in vfp I do by creating a variable with the possible selection conditions as follows
cond= cond + "and x condition" and end of the WHERE I put the & cond. but not how to do something the same or similar in sql editor in stored procedure

for example
cond=''
if !empty(thisform.txtfecha1.value)
       mfecha=dtos(thisform.txtfecha.value)
	condi=condi+[ and fecha>=']+mfecha1+[']
        sql=[select * from tabla where x>0 &cond]
endif
Jose Manuel Ramirez
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform