Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create SQL View (embed variable) best way q
Message
De
13/03/2008 11:34:19
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01301700
Message ID:
01301766
Vues:
13
>>>>Macro substitution sadly does not work and the string length is too long for concat process.
>>>>How would you create my view with my vars?
>>>
>>>text to lcSQLCmd textmerge noshow
>>> ... substitute all variables with <<var>>
>>>endtext
>>>
>>>then
>>>
>>>&lcSQLCmd
>>>
>>>Or if the length of lcSQLCmd exceeds 8K:
>>>
>>>execscript(lcSQLCmd)
>>
>>Not working
>>lcSQLCmd variable does not exist at macro attempt
>>execscript is not an option in VFP6
>>
>>I defined lcSQLCmd but the macro still fails.
>>
>>What am I missing here?
>
>text to unfortunately was introduced in VFP8 version. I guess you would have to create your lcSQLCommand in pieces then, or use textmerge command slightly different way.
>
>Or just generate it into file and then run it.


Two suggestions
(1) I use &?par in views for a where clause. Might work
(2) The sql command can be in one piece provided you put a few markers in it
eg

stmt = [select * from table where (name = "%%name%%")]
stmt = strtran(m.stmt, [%%name%%], [Nadya])
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform