Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-13 Thread Stephen Sutherland
.S. Try don't use char* in C++ code. Use std::string instead. And when you need char* you can transform std::string into char* with c_str() method of std::string. Stephen Sutherland wrote: > Igor I tried your solution and can't get it working . > Here is my code. > > The

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
loop ? Just double checking I noticed rc = sqlite3_step(pStmt); is the start of the inner while loop. I'm guessing the inner while loop is needed with pStmt contains multiple SQl statements right ? Thanks STev Dennis Cote <[EMAIL PROTECTED]> wrote: St

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
d::string & v ) { m_buff.push_back( v ); } void read_table() { sqlite3_exec( m_db, "SELECT * FROM some_table", add_value, this, NULL ); } private: sqlite3 * m_db; std::vector< std::string > m_buff; }; This is very simple example, but it can help you I think. Stephen Sutherland wr

Re: [sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
Thanks I guess i have to figure out how to use prepared statements instead of callbacks because i can't get callbacks working as expected. Dennis Cote <[EMAIL PROTECTED]> wrote: Stephen Sutherland wrote: > Hi > > I am using the 'quick start' C-s

[sqlite] Object Oriented Question About Adding a vector inside the callback function

2007-08-09 Thread Stephen Sutherland
Hi I am using the 'quick start' C-styled code for sqlite3 http://www.sqlite.org/quickstart.html I think I'm running into a problem trying to put it in classes to make it somewhat object oriented. So I'm asking for help about how to make it object-oriented - or to confirm whether what I'

Re: [sqlite] Extremely new to SQLite

2007-08-07 Thread Stephen Sutherland
use the quick start code http://www.sqlite.org/quickstart.html That's what I used to build all my code from Stephen Dennis Cote <[EMAIL PROTECTED]> wrote: Rahul Banerjee wrote: > I'm trying to integrate SQLite into a library management system coded > in C++. I'm extremely n

Re: [sqlite] a c++ newbie question - prepared statements.

2007-08-06 Thread Stephen Sutherland
Thanks this is great information on sqlite's prepared statements. I think I have just one more question on this subject. I need to execute a SQL statement like this: "SELECT * FROM tbl WHERE BookID IN ( :arrayNumbers) ;" My function will be receiving an array like this

Re: [sqlite] a c++ newbie question

2007-08-06 Thread Stephen Sutherland
t;; char param2='y'; int param3=1 for(int x = 0; x < 10,000; x++ ) { // how would it work ? } Thanks a lot in advance. Stephen Trevor Talbot <[EMAIL PROTECTED]> wrote: On 8/5/07, Stephen Sutherland wrote: > I am trying to treat a str

[sqlite] a c++ newbie question

2007-08-05 Thread Stephen Sutherland
Hi ; I am trying to treat a string before passing it through my SQL statement into the database. I know that a single apostrophe will break the SQL statement. So I have to replace them all to double apostrophes. Question #1: What may I ask is the c or C++ code to accomplish th

[sqlite] How to Speed of Inserts

2007-08-03 Thread Stephen Sutherland
Hi Here's My Situation: - I have an XML file which contains user created data. It can have maybe 10,000 or more nodes. The XML needs to be queried infrequently for use in the application, in a way that lends itself more to SQL. For example the only qu

Re: [sqlite] How to set up sqlite3 with Dev C++

2007-07-31 Thread Stephen Sutherland
never mind. It seems I have it. It seems I had to include the source - the sqlite3.h file Stephen Sutherland <[EMAIL PROTECTED]> wrote: by dynamic link library. i'm gusiness you are talking about the sqlite3.dll. What is hte procedure to link it ? it seems to me that a

Re: [sqlite] How to set up sqlite3 with Dev C++

2007-07-31 Thread Stephen Sutherland
n't have to include the Sqlite source to use DevC0++. Just include the link library. Stephen Sutherland wrote: > Hi; > I'm pretty much a newbie. > I'm just about finishing a PC a game with Dev C++. > I decided to use sqlite3 to load content from XML repository (for user

[sqlite] How to set up sqlite3 with Dev C++

2007-07-30 Thread Stephen Sutherland
Hi; I'm pretty much a newbie. I'm just about finishing a PC a game with Dev C++. I decided to use sqlite3 to load content from XML repository (for user write access) into the database and then sort and pull out the appropriate information as needed. However, I am trying to figure out SET UP