Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interactive Query
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00974268
Message ID:
00974274
Vues:
32
This message has been marked as the solution to the initial question of the thread.
>I'm want my users to select the data for processing, and am providing forms to allow them to enter their data selections. The generated SQL select is longer than 254 characters, so I have segmented it and placed it into a memo field in a cursor. I was trying to issue "&mycursor.myselect", but that won't work.
>
>How can I create the SQL select at runtime and execute it without VFP being installed on the user's system?
>

Harry,

The 254 characters limit is for a string literal only. The limit for any VFP commnad including SQL SELECT is 8,192 bytes. You can use EXECSCRIPT() to run code
EXECSCRIPT(mycursor.myselect) 
* or memory variable and macro substitution
lcSQL = CHRTRAN(mycursor.myselect, CHR(13)+CHR(10),"")
&lcSQL
You can also use TEXTMERGE to build a query. It makes code more readable. Something like
TEXT TO lcSQL TEXTMERGE NOSHOW PRETEXT 7
SELECT * FROM Products 
  WHERE eng_name = "<<Thisform.txtProdName>>"
ENDTEXT	
lcSQL = CHRTRAN(lcSQL, CHR(13)+CHR(10),"")
&lcSQL
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform