Question : foxpro sql insert data with comma in text

Is ther a way to insert a charter field that has comma's in it. as can be seen the sql statment data is seperated with commas.
INSERT INTO CustomerTmp (AccountNo,Title,) VALUES ('AMAZT1','A MAZE'N THINGS TOURIST PARK')
is the some type of escape charecter to be used?
at the moment i will be replacing the ' with - but this will cause confusion with the end users

 

Answer : foxpro sql insert data with comma in text

Lets start by saying that the  '   character in   MAZE'N  is not a comma.  
It is an apostrophe (also called a Single Quote)

You have not told us what type of data table you are trying to do the INSERT into - a VFP data table or something else such as  SQL Server.

For now I'll assume that it is a VFP data table.

The VFP language can use either double quotes or single quotes on character values.
You merely have to start and end the character string with the same type.

Example:
    "You can't do this"    <-- note use of double quotes outside of character string
    'Say "HI" to Bill'  <- single quotes around string.

Both of those character strings would work and the quotes used INSIDE the string would be retained.

Good Luck
   

Random Solutions  
 
programming4us programming4us