|
|
| <prev next> |
Choosing A Webhost: |
SSQL:sql_create_x(...): msg#00154db.mysql.c++
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> |
|---|---|---|
| Previous by Date: | Re: VC++ users: new proposed requirement for GNU make, Thomas Werth |
|---|---|
| Next by Date: | RE: Solaris 8 issues, Jeff Schweiger |
| Previous by Thread: | error loading mysql++ library, Stephen Povilaitis |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |