Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending a String with Single Quote Using SPT
Message
 
 
À
29/09/2009 15:56:21
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01426727
Message ID:
01426729
Vues:
93
This message has been marked as the solution to the initial question of the thread.
>I am trying to write '56230','62214' to a character field in a db2 table. I have tried every syntax combo I can think of including the following but nothing works. I need help.
>
>
>
>bl = "'56230','62217'"
>testString = "Update webprddt7.resmngta7 Set attribval = '" + bl + "' Where attribname = 'HeadCou
>
>
Try to double the quote, e.g.
bl = strtran(bl,['],[''])

testString = "Update webprddt7.resmngta7 Set attribval = '" + bl + "' Where attribname = 'HeadCountBadgeExclusions'
Also, if possible, use parameters instead of string concatenation to avoid this problem, e.g.
bl = "'56230','62217'"

testString = "Update webprddt7.resmngta7 Set attribval =?m.bl  Where attribname = 'HeadCountBadgeExclusions'
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform