dbTalk Databases Forums  

Understanding sql_create_# / sql_create_basic#

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


Discuss Understanding sql_create_# / sql_create_basic# in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Willy K'
 
Posts: n/a

Default Understanding sql_create_# / sql_create_basic# - 04-18-2005 , 12:02 AM






As I've seen in the tutorial, my understanding to the use of
sql_create_# should be sql_create_N(name_of_struct, A, N,
data_type_1, variable_1, ... , data_type_N, variable_N), where
N is the no of variable and A is a number that I still don't
quite understand. The same should be the same with
sql_create_simple_N. (Please correct if I am wrong)

My questions are:
1: I don't get the meaning of what A do. In another words,
what action did it does and how could I make use of it

2: I want to create a SSQLS with four string variables, to
access another table. So i simply use custom1.cpp and modify
sql_create_5(stock, 1, 5, ...) to sql_create_4(stock, 1,4,
....), which it pumps up a lot of error messages.

3: This is about sql_create_simple_#. For the use of retriving
data, I used sql_create_simple_4(stock, 0, 0,...) instead and
it worked (based on custom1.cpp). However, when I turn to
inserting data with sql_create_simple_4, error messages again.
It says there's not a "set" method in struct stock, which I
saw that there is such a method in the API. What's wrong with it?

4: In custom2.cpp, is print_stock_table used only for the
struct stock? where is it located???

Many Many Many Many Thanks....
Willy K'

--
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
  #2  
Old   
Chris Frey
 
Posts: n/a

Default Re: Understanding sql_create_# / sql_create_basic# - 04-18-2005 , 03:15 AM






On Mon, Apr 18, 2005 at 01:02:24PM +0800, Willy K' wrote:
Quote:
As I've seen in the tutorial, my understanding to the use of
sql_create_# should be sql_create_N(name_of_struct, A, N,
data_type_1, variable_1, ... , data_type_N, variable_N), where
N is the no of variable and A is a number that I still don't
quite understand. The same should be the same with
sql_create_simple_N. (Please correct if I am wrong)

My questions are:
1: I don't get the meaning of what A do. In another words,
what action did it does and how could I make use of it
From examples/custom4.cpp (I know, it's well hidden) :-)

sql_create_5(stock,
1, // This number is used to make a SSQLS less-than-comparable.
// If this number is n then if the first n elements are the
// same the two SSQLS are the same.
// In this case if two two stock's "item" are the same then
// the two stock are the same.
5, // This number should generally be the same as the number of
// elements in the list unless you have a good reason not to.

I think this is most useful when you put a unique ID as the first
column, but I don't have a lot of experience with this yet.


Quote:
2: I want to create a SSQLS with four string variables, to
access another table. So i simply use custom1.cpp and modify
sql_create_5(stock, 1, 5, ...) to sql_create_4(stock, 1,4,
...), which it pumps up a lot of error messages.
Not sure what messages you got, but you'll need to add/remove actual
fields as well.


Quote:
3: This is about sql_create_simple_#. For the use of retriving
data, I used sql_create_simple_4(stock, 0, 0,...) instead and
it worked (based on custom1.cpp). However, when I turn to
inserting data with sql_create_simple_4, error messages again.
It says there's not a "set" method in struct stock, which I
saw that there is such a method in the API. What's wrong with it?
sql_create_simple_# doesn't exist in my tree. Are you using an old version?
Try 1.7.32.


Quote:
4: In custom2.cpp, is print_stock_table used only for the
struct stock? where is it located???
It's in util.cpp.

- Chris


--
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   
Chris Frey
 
Posts: n/a

Default Re: Understanding sql_create_# / sql_create_basic# - 04-18-2005 , 03:25 AM



On Mon, Apr 18, 2005 at 04:08:45AM -0400, Chris Frey wrote:
Quote:
3: This is about sql_create_simple_#. For the use of retriving
data, I used sql_create_simple_4(stock, 0, 0,...) instead and
it worked (based on custom1.cpp). However, when I turn to
inserting data with sql_create_simple_4, error messages again.
It says there's not a "set" method in struct stock, which I
saw that there is such a method in the API. What's wrong with it?

sql_create_simple_# doesn't exist in my tree. Are you using an old version?
Try 1.7.32.
Ahh, you meant sql_create_basic, oops. From my reading of custom-macros.h,
there is no set method in that struct, at least not that takes a Row
object, which is probably what the compiler is complaining about.

Again, I'm no expert on SQLS stuff.

- Chris


--
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: Understanding sql_create_# / sql_create_basic# - 04-18-2005 , 10:40 AM



Chris Frey wrote:

Quote:
1, // This number is used to make a SSQLS less-than-comparable.
// If this number is n then if the first n elements are the
// same the two SSQLS are the same.
// In this case if two two stock's "item" are the same then
// the two stock are the same.
5, // This number should generally be the same as the number of
// elements in the list unless you have a good reason not to.
I've clarified this language, including a real explanation for the
second parameter.

Stealing this language when I make the next release would be a good
thing for the documentation team (still alive out there?) to do.

--
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 - 2012, Jelsoft Enterprises Ltd.