Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Storing a SQL statement within a char variable
Message
From
05/08/2005 10:44:32
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Storing a SQL statement within a char variable
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01038883
Message ID:
01038883
Views:
61
Depending on the options selected on the front-end, a selection criteria is build. In the end the cSelect, cWhere and cRest is combined into a variable cSQL.

-----------------
cSelect = 'SELECT pa_code,pa_pocode,SUM(lh_rnetkg) net,SUM(lh_bales) bales,SUM(ct_chg1) omchg,lh_rxdate ' + ;
'FROM bkwppacc LEFT JOIN bkwplot ON pa_code=lh_pcode LEFT join bkwpcor ON lh_recno=ct_lhrecno '
cWhere = 'WHERE BETWEEN(pa_code,"5A%","5Z%") ' + ALLTRIM(cCriteria)
cRest = 'ORDER BY 1,2,6 DESC GROUP BY 1,2,6 INTO CURSOR cntrcurs noconsole '

cSQL = cSelect + cWhere + cRest
&cSQL
-----------------

It looks like the variable cSQL cannot store the entire info. What can I use if the characters to store is greater than 254?

Irene
Next
Reply
Map
View

Click here to load this message in the networking platform