dbTalk Databases Forums  

sql_create_x and Type issues

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss sql_create_x and Type issues in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dan Wez
 
Posts: n/a

Default sql_create_x and Type issues - 12-14-2006 , 05:31 PM






--_4af95b8d-bf10-4a86-abc4-f22101bb69d4_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I have been searching for the past 3 days for an answer to my problem but c=
an't seem to find an answer: while running: #include <mysql++.h>#include <c=
ustom.h> sql_create_3(user, 1, 0, mysql=
pp::sql_int, id, mysqlpp::sql_varchar, username, =
mysqlpp::sql_varchar, pin) I receive this error: g++ -I/usr/local=
/mysql-current/include/mysql -I/usr/local/include/mysql++ mysql++example.cp=
p -o mysqlex -lmysqlppIn file included from mysql++example.cpp:9:util.cpp: =
In function `void print_stock_row(const mysqlpp::Row&, int)':util.cpp:178: =
error: conversion from `const mysqlpp::ColData' to non-scalar type `mysqlpp=
::sql_varchar' requestedutil.cpp:180: error: invalid initialization of refe=
rence of type 'const mysqlpp::sql_char&' from expression of type 'int'util.=
h:44: error: in passing argument 1 of `void print_info_row(const mysqlpp::s=
ql_char&, mysqlpp::sql_bigint, mysqlpp::sql_double, mysqlpp::sql_double, co=
nst mysqlpp::sql_date&)' Trying to get this to work has been a huge hassle.=
Please help me! Thanks. Dan
__________________________________________________ _______________
All-in-one security and maintenance for your PC.=A0 Get a free 90-day trial=
!
http://www.windowsonecare.com/purcha...d=3Dwl_wlmail=

--_4af95b8d-bf10-4a86-abc4-f22101bb69d4_--

Reply With Quote
  #2  
Old   
Eric C. Anderson
 
Posts: n/a

Default Re: sql_create_x and Type issues - 12-14-2006 , 06:46 PM






It may be small condolence, but I have not had any luck with those
sql_create_x macros either. They seem to generate code that refuses to
compile, no matter what you do. I have abandoned them, after wasting an e=
ntire
day on it.

What is odd, however, is that there is an example in the examples directo=
ry
that uses sql_create_6 and it compiles just fine.

I'd love an answer too, but in the meantime I am just working around the
problem.

Best,
Eric C. Anderson
Cambridge Scientific Abstracts

------ Original Message ------
Received: 14/12/2006 18:30 EST
From: Dan Wez <wesiman (AT) hotmail (DOT) com>
To: <plusplus (AT) lists (DOT) mysql.com>
Subject: sql_create_x and Type issues

Quote:
I have been searching for the past 3 days for an answer to my problem b=
ut
can't seem to find an answer: while running: #include <mysql++.h>#include=

<custom.h> sql_create_3(user, 1, 0, =

mysqlpp::sql_int, id, mysqlpp::sql_varchar, username, =
=

mysqlpp::sql_varchar, pin) I receive this error: g++
-I/usr/local/mysql-current/include/mysql -I/usr/local/include/mysql++
mysql++example.cpp -o mysqlex -lmysqlppIn file included from
mysql++example.cpp:9:util.cpp: In function `void print_stock_row(const
mysqlpp::Row&, int)':util.cpp:178: error: conversion from `const
mysqlpp::ColData' to non-scalar type `mysqlpp::sql_varchar'
requestedutil.cpp:180: error: invalid initialization of reference of type=

'const mysqlpp::sql_char&' from expression of type 'int'util.h:44: error:=
in
passing argument 1 of `void print_info_row(const mysqlpp::sql_char&,
mysqlpp::sql_bigint, mysqlpp::sql_double, mysqlpp::sql_double, const
mysqlpp::sql_date&)' Trying to get this to work has been a huge hassle. P=
lease
help me! Thanks. Dan
Quote:
__________________________________________________ _______________
All-in-one security and maintenance for your PC. Get a free 90-day tri=
al!
http://www.windowsonecare.com/purcha...id=3Dwl_wlmail



--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
don thompson
 
Posts: n/a

Default Re: sql_create_x and Type issues - 12-15-2006 , 09:24 AM



I have used sql_create_x for many, many months without problems. I
think it's central to mysql++.
I believe you need to change your third parameter to 3. I think this
must match the x in sql_create_x. See docs.
good luck, Don

Dan Wez wrote:

Quote:
I have been searching for the past 3 days for an answer to my problem bu=
t can't seem to find an answer: while running: #include <mysql++.h>#inclu=
de <custom.h> sql_create_3(user, 1, 0, =
mysqlpp::sql_int, id, mysqlpp::sql_varchar, username,=
mysqlpp::sql_varchar, pin) I receive this error: g++ -=
I/usr/local/mysql-current/include/mysql -I/usr/local/include/mysql++ mysq=
l++example.cpp -o mysqlex -lmysqlppIn file included from mysql++example.c=
pp:9:util.cpp: In function `void print_stock_row(const mysqlpp::Row&, int=
)':util.cpp:178: error: conversion from `const mysqlpp::ColData' to non-s=
calar type `mysqlpp::sql_varchar' requestedutil.cpp:180: error: invalid i=
nitialization of reference of type 'const mysqlpp::sql_char&' from expres=
sion of type 'int'util.h:44: error: in passing argument 1 of `void print_=
info_row(const mysqlpp::sql_char&, mysqlpp::sql_bigint, mysqlpp::sql_doub=
le, mysqlpp::sql_double, const mysqlpp::sql_date&)' Trying to get this to=
work has been a huge hassle. Please help me! Thanks. Dan
Quote:
__________________________________________________ _______________
All-in-one security and maintenance for your PC. Get a free 90-day tria=
l!
http://www.windowsonecare.com/purcha...id=3Dwl_wlmail
=20



--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Warren Young
 
Posts: n/a

Default Re: sql_create_x and Type issues - 12-15-2006 , 02:46 PM



Dan Wez wrote:
Quote:
#include
mysql++.h>#include <custom.h> sql_create_3(user,
1, 0, mysqlpp::sql_int, id,
mysqlpp::sql_varchar, username,
mysqlpp::sql_varchar, pin)
As you can see, your code didn't come through very well. You might try
attaching it instead of pasting it inline into the email message. Also,
a complete compilable example would have been more helpful.

Quote:
I receive this error: g++
-I/usr/local/mysql-current/include/mysql -I/usr/local/include/mysql++
mysql++example.cpp -o mysqlex -lmysqlppIn file included from
mysql++example.cpp:9:util.cpp: In function `void
print_stock_row(const mysqlpp::Row&, int)':util.cpp:178: error:
conversion from `const mysqlpp::ColData' to non-scalar type
`mysqlpp::sql_varchar' requestedutil.cpp:180: error: invalid
It seems that you're trying to mix custom code with existing example
code and running into type conversion issues. Unless you changed
print_stock_row() to accept your new SSQLS type, you're going to run
into problems.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Warren Young
 
Posts: n/a

Default Re: sql_create_x and Type issues - 12-15-2006 , 02:48 PM



Eric C. Anderson wrote:
Quote:
It may be small condolence, but I have not had any luck with those
sql_create_x macros either. They seem to generate code that refuses to
compile, no matter what you do.
Many people use SSQLS every day successfully, including me, the
library's maintainer. SSQLS is finicky -- which is one reason we're
playing with ideas for replacements -- but it is undeniably useful as-is.

Quote:
I have abandoned them, after wasting an entire
day on it.
Okay, but you'll waste more than one day writing SQL code by hand by
avoiding them.

Perhaps you need to study the user guide more carefully. There are
several subtleties in declaring a SSQLS that are non-obvious.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #6  
Old   
Warren Young
 
Posts: n/a

Default Re: sql_create_x and Type issues - 12-15-2006 , 02:56 PM



don thompson wrote:
Quote:
I believe you need to change your third parameter to 3. I think this
must match the x in sql_create_x.
It doesn't need to match, but sometimes fiddling with this value does
help. Sometimes unfortunate combinations of SSQLS member types and
orderings combine badly with the signatures of the generated member
functions. When that happens, you can change one or the other of these
values to get a different set of member functions, which works around
the problem.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.