Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert problem in a table
Message
De
25/05/2006 17:17:05
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
25/05/2006 16:18:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01125013
Message ID:
01125085
Vues:
18
>>when i want to make an insert in my city table, my sqltext is like that :insert into table city(id,cityname) values (1,'vald'or'). how can i do it ??? thanks !
>
>INSERT INTO TABLE city (id,cityname) VALUES(1,"vald'or")
>
I assume you're talking SQL server here - and it's two ways. Either you prepare each value to be passed (which in case of strings means doubling each apostrophe, in case of datetimes certain formatting as strings etc etc), or you could let VFP do that:

lnId=1
lcCityName="vald'or"
sqlexec(h, "INSERT INTO TABLE city (id,cityname) VALUES(?lnId, ?lcCityName)")

VFP will then take care of converting your values into properly formatted strings.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform