Hi, Below describes what I'm trying to do. I'm not trying to write an
object to the database, but
I simply want the SSQLS tshares definition (tshares shr) moved to the
header file of the class,
and therefore need to move the tshares definition. I'm trying to
develop some demonstration classes
which utilize various features of mysql++.
Thanks, Don
The SSQLS usage as shown is taken directly from examples/custom3
..... SSQLS declared in class.cp
sql_create_20(tshares.... <===SSQLS
..... in member function...
res = query.store(acct, sfx);
if (res.empty()) {
throw Acct_error(acct, sfx);
}
//because only one row can be returned
//shr = res[0]; <====would like tshares shr delcared as
class member,
tshares shr = res[0]; // using local <===rather than this local def.
..... and later to perform update ... <===this update would be in
another member function,
tshares shr2 = shr; <===thus the need for shr to be a class
member as well
// Test simple update
shr.balance += tranamt; <==== simple, rather than row numeric ref
or name lookup
query.update(shr2, shr);
Warren Young wrote:
Quote:
don thompson wrote:
like to define 'tshares row' as a member of this class.
If I understand you correctly, you are trying to store instances of a
C++ class into columns of the MySQL database. This will not work;
MySQL is not an object-oriented database. You can only use primitive
types (int, float, char*...), or types like std::string which can be
readily converted to primitives.
Also, please don't reply to an existing thread in order to post to the
list. It messes up mail readers that can do threaded reading. Make a
fresh post instead. |
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw