Hi Corwin,
Corwin Burgess wrote:
I need to know what the solution is to translate the following Delphi
lines so that they will compile with C++ and be valid SQL statements.
Delphi
sSQL := 'INSERT INTO testtable(Name,OtherID,Number,Notes) VALUES
("Some Name",4,587.6594,"Here are some notes");';
sSQL := 'INSERT INTO testtable(Name,OtherID,Number,Notes) VALUES
("Another Name",12,4758.3265,"More notes");';
The following won' t compile. What do you do about the double-quotes
as in "Some Name", "Here are some notes", "Another Name", and "More
notes"? I can get it to compile if I use \" but that causes a SQL
exception.
BCB6
sSQL = "INSERT INTO testtable(Name,OtherID,Number,Notes) VALUES ("Some
Name",4,587.6594,"Here are some notes");";
sSQL = "INSERT INTO testtable(Name,OtherID,Number,Notes) VALUES
("Another Name",12,4758.3265,"More notes");";
One solution would be to use 'Some Name' and 'Here are some notes' --
the SQL standard says that 'this is a literal string' whereas "this is a
delimited (column) name". See a post to this list by Darren Duncan a
few days back on column names.
HTH
Ulrik
--
Ulrik Petersen, MA, B.Sc.
University of Aalborg, Denmark
Homepage: http://ulrikp.org