Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a limit for selexec()?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01317869
Message ID:
01317885
Views:
10
>>Hi Koen,
>>
>>A string literal in VFP is limited to 255 characters. It's better to build only SQL command with text-merge. The macro substitution will go away as well.
>>Also you should check return value after SQLEXEC() to make sure that it completed successfully.
>>
>>lcSql = ""
>>text TO lcSql noshow
>>select myPrimaryId, mySecondayId,cDtTitle,
>>	cEnTitle, cDtMaterial, cEgMaterial,ceDtFormat, ceEgFormat,
>>	coalesce(DtPrtcopy,'') as DtPrtcopy,
>>	coalesce(EgPrtcopy,'') as EgPrtcopy,
>>	coalesce(DtSPrice,'') as DtSPrice
>>  from HORSART_WORKS
>>endtext
>>sqltxt = CHRTRAN(lcSql, CHR(13), CHR(10), '')
>>lcResult = sqlexec(lnRet, lcSql,"curHorsart_Works")
>>IF lcResult < 0
>>  * Error
>>ENDIF
>>
>>>
>
>Sergey,
>
>PMFJI. How is the text-merge different from using a variable? For example,
>
>
>cSqlCommand = "select myPrimaryId, mySecondayId,cDtTitle, " + ;
>"cEnTitle, cDtMaterial, cEgMaterial,ceDtFormat, ceEgFormat, " + ;
>"coalesce(DtPrtcopy,'') as DtPrtcopy, " + ;
>"coalesce(EgPrtcopy,'') as EgPrtcopy, " + ;
>"coalesce(DtSPrice,'') as DtSPrice " + ;
>" from HORSART_WORKS "
>
>
>It seem like eithre method is limited 255 characters. Correct?

The textmerge method makes code easier to read, maintain and troubleshhot. For example, you can copy a query between TEXT...ENDTEXT into QA or SSMS and run with litle modifications.

I'm not sure what 255 charaters limit for the textmerge you cite.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform