Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert problem in a table
Message
From
25/05/2006 17:00:00
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01125013
Message ID:
01125077
Views:
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 think the problem is with SQL and quote in the data.

If he's working with VFP tables it's not the quote inside the string. His statement
insert into table city(id,cityname) values (1,'vald'or')
shows only single quotes. He didn't specify any reason why the code didn't work, but I assumed he was getting a Syntax Error because of the mis-matched quotes.

If he's working with a back-end database and building a string to be passed to SQLEXEC() then something like
lcSql = "insert into table city(id,cityname) values (1,'vald''or')"
would be appropriate. (I don't work with SQL Server but I think that is the way you put a quotation mark into a string).
Previous
Reply
Map
View

Click here to load this message in the networking platform