Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a limit for selexec()?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01317869
Message ID:
01317882
Vues:
7
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform