Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLPT question
Message
 
 
À
26/07/2002 00:34:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00682865
Message ID:
00682937
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
Hi Alex,

Sql Server may or may not recognize double quote as a string delimiter. It depends on setting of SET QUOTED_IDENTIFIER. The single quote is always recognized. So I recomend that you always use single quote as a string literal delimiter.
n = MyCount([tablename],[fieldname = '] + lc + ['])
>Hi,
>
>A function receives a table name and a where condition and is supposed to count the records that meet the condition in a Sql server database.
>
>(calling function)
>lc = has desired value for fieldname
>n = MyCount([tablename],[fieldname = "] + lc + ["])
>
>FUNCTION MyCount
>LPARAMETERS tcTable,tcCondition
>...
>jc = [SELECT COUNT(*) AS c FROM dbo.] + tcTable + [ ] + tcTable ;
>+ IIF(EMPTY(tcCondition),[],[ WHERE ]+ tcCondition)
>lnRetVal = SQLEXEC(lnHandle,jc)
>...
>
>Problem is lnRetVal = -1 because of tcCondition. If tcCondition were blank, no problem.
>
>Any ideas? TIA,
>
>Alex
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform