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:
01317882
Views:
6
>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 creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform