Re: [sqlite] C++ - WHERE clause - update

2012-09-07 Thread Simon Slavin
On 7 Sep 2012, at 2:18pm, Rob Richardson wrote: > One number (I don't know off hand which) is labeled SQLITE_ROW, which you are > using. Another is SQLITE_DONE. Another is SQLITE_MISUSE. There are several > of them. Quite right.

Re: [sqlite] C++ - WHERE clause - update

2012-09-07 Thread Rob Richardson
Discussion of SQLite Database' Subject: Re: [sqlite] C++ - WHERE clause - update Is this a tricky question? int sqlite3_step(sqlite3_stmt*); -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Richardson Sent: Thursday, September

Re: [sqlite] C++ - WHERE clause - 2nd update

2012-09-07 Thread Black, Michael (IS)
org [sqlite-users-boun...@sqlite.org] on behalf of Arbol One [arbol...@gmail.com] Sent: Friday, September 07, 2012 4:07 AM To: 'General Discussion of SQLite Database' Subject: EXT :Re: [sqlite] C++ - WHERE clause - 2nd update Yes, thank? I gave you the answer you gave me, obviously I was right. I need yo

Re: [sqlite] C++ - WHERE clause - 2nd update

2012-09-07 Thread Arbol One
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marcus Grimm Sent: Friday, September 07, 2012 3:39 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] C++ - WHERE clause - 2nd update On 07.09.2012 08:58, Arbol One wrote: > I got this code to work, however, I am getting a segmentat

Re: [sqlite] C++ - WHERE clause - 2nd update

2012-09-07 Thread Marcus Grimm
On 07.09.2012 08:58, Arbol One wrote: I got this code to work, however, I am getting a segmentation fault on this code. I pass to SQLite only one statement [db->setStmt(apstr);], I read the first of the 'fname', but I don't know how to get to the second 'fname' in the database. I am not very

[sqlite] C++ - WHERE clause - 2nd update

2012-09-07 Thread Arbol One
I got this code to work, however, I am getting a segmentation fault on this code. I pass to SQLite only one statement [db->setStmt(apstr);], I read the first of the 'fname', but I don't know how to get to the second 'fname' in the database. I am not very sure as to what do to tell the program to

Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Arbol One
: [sqlite] C++ - WHERE clause - update What is the value returned from sqlite3_step()? RobR -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Arbol One Sent: Thursday, September 06, 2012 12:14 PM To: 'General Discussion of SQLite

Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Igor Tandetnik
On 9/6/2012 12:14 PM, Arbol One wrote: rc = sqlite3_step(mystmt); if(rc == SQLITE_ROW ) { The code, in this case, does not process this statement!!?? It's possible that no row actually matches the condition, so sqlite3_step returns SQLITE_DONE on the first call. -- Igor Tandetnik

Re: [sqlite] C++ - WHERE clause - update

2012-09-06 Thread Rob Richardson
What is the value returned from sqlite3_step()? RobR -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Arbol One Sent: Thursday, September 06, 2012 12:14 PM To: 'General Discussion of SQLite Database' Subject: [sqlite] C

[sqlite] C++ - WHERE clause - update

2012-09-06 Thread Arbol One
rc = sqlite3_step(mystmt); if(rc == SQLITE_ROW ) { The code, in this case, does not process this statement!!?? <<-- apstr = (const char*)sqlite3_column_text(mystmt,pos); std::cout << apstr << std::endl; //<<-- this is not executed } Table: id | tile | fname | mname | lname |

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Black, Michael (IS)
Yeah -- I should've been in a better teaching mode Trying to keep things simple opens up these type of security problemsthough there are lots of situations where this works just fine and is no problem at all (e.g. when you don't have user input or it's completely under your own control

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Richard Hipp
ail.com] > Sent: Thursday, September 06, 2012 3:45 AM > To: General Discussion of SQLite Database > Subject: EXT :Re: [sqlite] C++ - WHERE clause > > VALUES is used for INSERTing into a table, not for SELECTing. This is not > valid SQL (I would help you fix it, but I can't figure out w

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Black, Michael (IS)
te.org [sqlite-users-boun...@sqlite.org] on behalf of Baruch Burstein [bmburst...@gmail.com] Sent: Thursday, September 06, 2012 3:45 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] C++ - WHERE clause VALUES is used for INSERTing into a table, not for SELECTing. This is not val

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Stephan Beal
On Thu, Sep 6, 2012 at 10:18 AM, Arbol One wrote: > As many of you know, I am trying to learn SQL using C++. > FWIW: it's much easier to learn SQL in its "native environment" (e.g. by using the sqlite shell app) and then apply that learning to your programming language of

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Baruch Burstein
VALUES is used for INSERTing into a table, not for SELECTing. This is not valid SQL (I would help you fix it, but I can't figure out what you were trying to achieve.) Here is a great reference: http://sqlite.org/lang_select.html On Thu, Sep 6, 2012 at 11:18 AM, Arbol One

[sqlite] C++ - WHERE clause

2012-09-06 Thread Arbol One
As many of you know, I am trying to learn SQL using C++. Below is an error I get when I try using the C++ example below it. Error Code: 1 Error Message: near "VALUES": syntax error Glib::ustring apstr; Glib::ustring sName; int