Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

SSQL:sql_create_x(...): msg#00154

db.mysql.c++

Subject: SSQL:sql_create_x(...)

Hi,
I've tried to use the sql_create_x(...) like example posted but the compiler
gets a lot of errors:
ERRORS:
make: Making C++ object test_mysql_main.o ...
test_mysql_main.cpp:15: parse error before numeric constant
test_mysql_main.cpp:15: parse error before numeric constant
test_mysql_main.cpp:15: missing ';' before right brace
test_mysql_main.cpp: In member function `void stock::set(...)':
test_mysql_main.cpp:15: `p1' undeclared (first use this function)
test_mysql_main.cpp:15: (Each undeclared identifier is reported only once for
each function it appears in.)
test_mysql_main.cpp:15: `p2' undeclared (first use this function)
test_mysql_main.cpp:15: `p3' undeclared (first use this function)
test_mysql_main.cpp:15: `p4' undeclared (first use this function)
test_mysql_main.cpp:15: `p5' undeclared (first use this function)
test_mysql_main.cpp: At global scope:
test_mysql_main.cpp:15: extraneous `char' ignored
test_mysql_main.cpp:15: array size missing in `names'
test_mysql_main.cpp:15: non-member function `
stock_value_list<mysqlpp::quote_type0> value_list()' cannot have `const'
method qualifier
test_mysql_main.cpp: In function `stock_value_list<mysqlpp::quote_type0>
value_list()':
test_mysql_main.cpp:15: conversion from `mysqlpp::value_list_b<char[2],
mysqlpp::do_nothing_type0>' to non-scalar type `
stock_value_list<mysqlpp::quote_type0>' requested
test_mysql_main.cpp: At global scope:
.........

CODE:
#include <mysql++.h>
#include <custom.h>

#include <iostream>
#include <iomanip>
#include <vector>

#include "test_mysql_main.h"
using namespace std;
using namespace mysqlpp;

sql_create_3(stock,1, 5,int,num,int, weight,int, price);


int main()
{
try {
Connection con(use_exceptions);
con.connect("sam_db", "localhost", "root","");

// Get all the rows in the stock table.
Query query = con.query();
query << "select * from db_profili_saefon";
vector<stock> res;
query.storein(res);

if (res.size() > 0) {
// Build a select query using the data from the first row
// returned by our previous query.
/*
query.reset();
query << "select * from stock where " <<
res[0].equal_list(" and ", stock_weight, stock_price);
*/
// Display the finished query.
cout << "Custom query:\n" << query.preview() << endl;
}

return 0;
}
catch (BadQuery& er) {
// Handle any connection or query errors
cerr << "Error: " << er.what() << endl;
return -1;
}
catch (BadConversion& er) {
// Handle bad conversions
cerr << "Error: " << er.what() << "\"." << endl <<
"retrieved data size: " << er.retrieved <<
" actual data size: " << er.actual_size << endl;
return -1;
}
catch (exception& er) {
// Catch-all for any other standard C++ exceptions
cerr << "Error: " << er.what() << endl;
return -1;
}
}


**********************************************************************
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this message
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, or distribution of the message, or any action or
omission taken by you in reliance on it, is prohibited and may be unlawful.
Please immediately contact the sender if you have received this message in
error.

**********************************************************************
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation