List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:December 16 2004 9:31am
Subject:Re: escaping, quoting, and nulls
View as plain text  
Chris Frey wrote:

> If someone convinces me, I'm not
> against switching, but it should be good. :-)

query.insert(my_record) is a pretty good reason, to me.  :)

For what it's worth, I only use these SSQLS structures for dealing with 
the database, and that is isolated within a database access library. 
All the rest of my code uses a parallel set of C++ classes with more 
functionality.  Code to translate between the two type systems is within 
the database library.  It sounds like a lot of work to maintain this, 
but it really isn't.  It makes a lot of sense given the history of this 
program, which has been through a few database system transitions in the 
past.

> Currently I'm kluding things with a custom manipulator like:
> 
> 	q << "SELECT * FROM USERS WHERE USERID = " << sqlquote(UserID);

There's already a true quote manipulator in MySQL++, called 'quote'. 
There are also escape manipulators and others; see manip.h.  To use it, 
you say:

	q << "mumble mumble " << quote << UserID;
Thread
escaping, quoting, and nullsChris Frey15 Dec
  • Re: escaping, quoting, and nullsWarren Young16 Dec