Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert problem in a table
Message
From
25/05/2006 17:17:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/05/2006 16:18:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01125013
Message ID:
01125085
Views:
21
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform