Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert problem in a table
Message
De
25/05/2006 17:00:00
 
 
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:
01125077
Vues:
23
>>>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).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform