List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:June 20 2007 12:15pm
Subject:Re: Quoting mis-understanding
View as plain text  
tazatek wrote:
> 
> I load data from a CSV file into a table.
> The fields are unquoted.  I then read back parts of this table to create a
> new table.

You need to separate these two issues.  I doubt the problem is really 
because you're both using CSV imports and having quoting issues.  It's 
one or the other.  Find out which.

>              // notice the required backticks 
> 	      q << "`" << row.at(2) << "` varchar(" << row.at(3)
> << ") NOT NULL

Why fight with manual quoting when MySQL++ can do it for you?

	q << mysqlpp::quote << row.at(2) << ....

"quote" might not be the right manipulator for your situation.  There 
are several other related manipulators:

http://tangentsoft.net/mysql++/doc/html/userman/tutorial.html#id3428287

Once you figure out which one is correct, you can just start using it 
reflexively instead of memorizing quoting rules.
Thread
Quoting mis-understandingtazatek19 Jun
  • Re: Quoting mis-understandingWarren Young20 Jun