Re: [sqlite] Reset the cursor

2018-06-07 Thread Igor Korot
l but only a Stairway to Heaven says a > lot about anticipated traffic volume. > > >>-Original Message- >>From: sqlite-users [mailto:sqlite-users- >>boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >>Sent: Thursday, 7 June, 2018 20:19 >>To

Re: [sqlite] Reset the cursor

2018-06-07 Thread Keith Medcalf
. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >Sent: Thursday, 7 June, 2018 20:19 >To: SQLite mailing list >Subject: Re: [sqlite] Reset the cursor > >Hi, Keith, > >On Tue, Jun 5, 2018 at

Re: [sqlite] Reset the cursor

2018-06-07 Thread Igor Korot
> > --- > The fact that there's a Highway to Hell but only a Stairway to Heaven says a > lot about anticipated traffic volume. > > >>-Original Message- >>From: sqlite-users [mailto:sqlite-users- >>boun...@mailinglists.sqlite.org] On Behalf Of Olivier Ma

Re: [sqlite] Reset the cursor

2018-06-05 Thread Keith Medcalf
ge- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Olivier Mascia >Sent: Tuesday, 5 June, 2018 15:35 >To: SQLite mailing list >Subject: Re: [sqlite] Reset the cursor > >> Le 5 juin 2018 à 22:47, Igor Korot a écrit : >>

Re: [sqlite] Reset the cursor

2018-06-05 Thread Olivier Mascia
> Le 5 juin 2018 à 22:47, Igor Korot a écrit : > > As a side note: is it the case for all PRAGMA's command - they can be > rewritten this way? Full documentation for that is on page https://www.sqlite.org/pragma.html, see the second title ("PRAGMA functions"). Citing in short: // PRAGMAs that

Re: [sqlite] Reset the cursor

2018-06-05 Thread Keith Medcalf
et, reset at 5 ! sqlite3_reset returns 0 Loop 2, After Reset ! Loop 3, No Reset, Got SQLITE_DONE ! sqlite3_reset returns 0 --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-use

Re: [sqlite] Reset the cursor

2018-06-05 Thread Igor Korot
Hi, Olivier, On Tue, Jun 5, 2018 at 3:15 PM, Olivier Mascia wrote: >> Le 5 juin 2018 à 18:19, Igor Korot a écrit : >> >> My query is: >> >> std::string query = "PRAGMA foreign_key_list( \"%w\" )"; >> >> Then I'm doing this: >> >> char *y = sqlite3_mprintf( query.c_str(), tableName ); >> res =

Re: [sqlite] Reset the cursor

2018-06-05 Thread Olivier Mascia
> Le 5 juin 2018 à 18:19, Igor Korot a écrit : > > My query is: > > std::string query = "PRAGMA foreign_key_list( \"%w\" )"; > > Then I'm doing this: > > char *y = sqlite3_mprintf( query.c_str(), tableName ); > res = sqlite3_prepare_v2( m_db, y, -1, , 0 ); > > and then the code follows. > >

Re: [sqlite] Reset the cursor

2018-06-05 Thread Igor Korot
, Got SQLITE_DONE > ! > sqlite3_reset returns 0 > > which is what I would expect ... > > > > --- > The fact that there's a Highway to Hell but only a Stairway to Heaven says a > lot about anticipated traffic volume. > >>-Original Message----- >>From: s

Re: [sqlite] Reset the cursor

2018-06-05 Thread Keith Medcalf
to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >Sent: Tuesday, 5 June, 2018 08:54 >To: SQLite mailing list >Subject: Re: [sqlite] Reset the cur

Re: [sqlite] Reset the cursor

2018-06-05 Thread Igor Korot
esult of >> sqlite3_errcode may mean something and may not > > Removing thay call made no difference. > I am still getting 1 on the second iteration. > > Thank you. > >> >> >> --- >> The fact that there's a Highway to Hell but only a Stairway to Heaven sa

Re: [sqlite] Reset the cursor

2018-06-05 Thread Igor Korot
he second iteration. Thank you. > > > --- > The fact that there's a Highway to Hell but only a Stairway to Heaven says a > lot about anticipated traffic volume. > > >>-Original Message- >>From: sqlite-users [mailto:sqlite-users- >>boun...@mailinglists.

Re: [sqlite] Reset the cursor

2018-06-04 Thread Simon Slavin
On 4 Jun 2018, at 8:09pm, Igor Korot wrote: > The second cycle' sqlite3_step() returns 1, but immediately calling > sqlite3_errcode() returns 0. I don't like that. You should almost never see a result code of 1. It's SQLite telling you "Something went wrong but I don't know what.". It a bad

Re: [sqlite] Reset the cursor

2018-06-04 Thread Simon Slavin
On 4 Jun 2018, at 7:15pm, Igor Korot wrote: > Is my assumption correct that sqlite3_errcode() returning 0, indicate > there was no error? Correct. It might return 0 (SQLITE_OK == "no error") 1 to 99 (primary error code) 100 (SQLITE_ROW == "here's a row of data you asked for")

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
pated traffic volume. > > >>-Original Message- >>From: sqlite-users [mailto:sqlite-users- >>boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >>Sent: Monday, 4 June, 2018 12:15 >>To: SQLite mailing list >>Subject: Re: [sqlite] Reset the cursor &

Re: [sqlite] Reset the cursor

2018-06-04 Thread Keith Medcalf
2:15 >To: SQLite mailing list >Subject: Re: [sqlite] Reset the cursor > >Keith, > >On Mon, Jun 4, 2018 at 12:59 PM, Keith Medcalf >wrote: >> >> Yes, if it is 3.6.23.1 or earlier or the sqlite3 library was >compiled with SQLITE_OMIT_AUTORESET you will get an SQLITE_

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
sqlite-users [mailto:sqlite-users- >>boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >>Sent: Monday, 4 June, 2018 11:50 >>To: SQLite mailing list >>Subject: Re: [sqlite] Reset the cursor >> >>Keith, >> >>On Mon, Jun 4, 2018 at 12:35 PM, Keith Med

Re: [sqlite] Reset the cursor

2018-06-04 Thread Keith Medcalf
traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >Sent: Monday, 4 June, 2018 11:50 >To: SQLite mailing list >Subject: Re: [sqlite] Reset the cursor > >Keith, > >On Mon,

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
;test > > Loop 1, no reset, reset at 5 > 1 2 3 4 5 ! > sqlite3_reset returns 0 > > Loop 2, After Reset > 1 2 3 4 5 6 7 8 9 10 ! > > Loop 3, No Reset, Got SQLITE_DONE > 1 2 3 4 5 6 7 8 9 10 ! > sqlite3_reset returns 0 I will try without this call tonight when I'm b

Re: [sqlite] Reset the cursor

2018-06-04 Thread Keith Medcalf
-- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-----Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Keith Medcalf >Sent: Monday, 4 June, 2018 11:25 >

Re: [sqlite] Reset the cursor

2018-06-04 Thread Keith Medcalf
om: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Keith Medcalf >Sent: Monday, 4 June, 2018 11:06 >To: SQLite mailing list >Subject: Re: [sqlite] Reset the cursor > > >>Currently running w/MSVC 2010 under Win 8.1. > >>I also presu

Re: [sqlite] Reset the cursor

2018-06-04 Thread Keith Medcalf
>Currently running w/MSVC 2010 under Win 8.1. >I also presume you are testing under the latest SQLite source? Yes, I believe so ... SQLite 3.24.0 2018-06-02 19:14:58 1ecb3aa13de5c8dc611b814ff34010de0bd90aae73d88aa37a59c4627be4alt2 Using GCC (MinGW-w64 8.1.0) on Windows 10 Pro for Workstations

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
--- > The fact that there's a Highway to Hell but only a Stairway to Heaven says a > lot about anticipated traffic volume. > > >>-Original Message- >>From: sqlite-users [mailto:sqlite-users- >>boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >>Sent: S

Re: [sqlite] Reset the cursor

2018-06-04 Thread Keith Medcalf
lite3_reset returns 0 --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Igor Korot >Sent: Sunday, 3 J

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
x, On Mon, Jun 4, 2018 at 10:54 AM, x wrote: > If the first loop exits with res3 == SQLITE_DONE then !result will be true > and the second loop should process exactly the same (assuming underlying data > is unchanged). I can’t see why the code below wouldn’t work although I’m > confused by

Re: [sqlite] Reset the cursor

2018-06-04 Thread heribert
ooops... last answer mail was on the wrong topic. Am 04.06.2018 um 17:57 schrieb heribert: I'm using also paged queries. I'm adding an OFFSET to the select-limit query. Works for me. Am 04.06.2018 um 17:54 schrieb x: If the first loop exits with res3 == SQLITE_DONE then !result will be true

Re: [sqlite] Reset the cursor

2018-06-04 Thread heribert
I'm using also paged queries. I'm adding an OFFSET to the select-limit query. Works for me. Am 04.06.2018 um 17:54 schrieb x: If the first loop exits with res3 == SQLITE_DONE then !result will be true and the second loop should process exactly the same (assuming underlying data is

Re: [sqlite] Reset the cursor

2018-06-04 Thread x
If the first loop exits with res3 == SQLITE_DONE then !result will be true and the second loop should process exactly the same (assuming underlying data is unchanged). I can’t see why the code below wouldn’t work although I’m confused by the fact you say that sqlite3_step(stmt3) returns

Re: [sqlite] Reset the cursor

2018-06-04 Thread x
To: SQLite mailing list Subject: Re: [sqlite] Reset the cursor x, On Mon, Jun 4, 2018 at 9:42 AM, x wrote: > int result = 0, res3 = SQLITE_OK; > for( ; ; ) > { > res3 = sqlite3_step( stmt3 ); >

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
e 4, 2018 3:33:54 PM > To: SQLite mailing list > Subject: Re: [sqlite] Reset the cursor > > Hi, Igor, > > On Mon, Jun 4, 2018 at 7:55 AM, Igor Tandetnik wrote: >> On 6/4/2018 12:31 AM, Igor Korot wrote: >>> >>> Now I'd like the cursor in the records

Re: [sqlite] Reset the cursor

2018-06-04 Thread x
is never true. From: sqlite-users on behalf of Igor Korot Sent: Monday, June 4, 2018 3:33:54 PM To: SQLite mailing list Subject: Re: [sqlite] Reset the cursor Hi, Igor, On Mon, Jun 4, 2018 at 7:55 AM, Igor Tandetnik wrote: > On 6/4/2018 12:31 AM, Igor Ko

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
ply to Igor's post. Thank you. > > > > > From: sqlite-users on behalf > of Igor Korot > Sent: Monday, June 4, 2018 1:52:05 PM > To: SQLite mailing list > Subject: Re: [sqlite] Reset the cursor > > Hi, > > On Mon, Jun 4,

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
Hi, Igor, On Mon, Jun 4, 2018 at 7:55 AM, Igor Tandetnik wrote: > On 6/4/2018 12:31 AM, Igor Korot wrote: >> >> Now I'd like the cursor in the recordset of the "stmt" to go to the record >> 1 >> so I can process those records again. >> >> I thought that this will be a job of sqlite_reset(), but

Re: [sqlite] Reset the cursor

2018-06-04 Thread x
:52:05 PM To: SQLite mailing list Subject: Re: [sqlite] Reset the cursor Hi, On Mon, Jun 4, 2018 at 7:54 AM, Igor Korot wrote: > Hi, Clemens et al, > > On Mon, Jun 4, 2018 at 1:23 AM, Clemens Ladisch wrote: >> Igor Korot wrote: >>> res = sqlite3_step( stmt ); >>

Re: [sqlite] Reset the cursor

2018-06-04 Thread x
Igor, if sqlite3_step is successful it returns SQLITE_ROW which is 1. From: sqlite-users on behalf of Igor Korot Sent: Monday, June 4, 2018 1:52:05 PM To: SQLite mailing list Subject: Re: [sqlite] Reset the cursor Hi, On Mon, Jun 4, 2018 at 7:54 AM, Igor

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Tandetnik
On 6/4/2018 12:31 AM, Igor Korot wrote: Now I'd like the cursor in the recordset of the "stmt" to go to the record 1 so I can process those records again. I thought that this will be a job of sqlite_reset(), but when I called it and started re-processing the recordset I got SQLITE_DONE on the

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
Hi, On Mon, Jun 4, 2018 at 7:54 AM, Igor Korot wrote: > Hi, Clemens et al, > > On Mon, Jun 4, 2018 at 1:23 AM, Clemens Ladisch wrote: >> Igor Korot wrote: >>> res = sqlite3_step( stmt ); >>> >>> Now I'd like the cursor in the recordset of the "stmt" to go to the record 1 >>> so I can

Re: [sqlite] Reset the cursor

2018-06-04 Thread Igor Korot
Hi, Clemens et al, On Mon, Jun 4, 2018 at 1:23 AM, Clemens Ladisch wrote: > Igor Korot wrote: >> res = sqlite3_step( stmt ); >> >> Now I'd like the cursor in the recordset of the "stmt" to go to the record 1 >> so I can process those records again. > > Strictly speaking, it is not possible

Re: [sqlite] Reset the cursor

2018-06-04 Thread Clemens Ladisch
Igor Korot wrote: > res = sqlite3_step( stmt ); > > Now I'd like the cursor in the recordset of the "stmt" to go to the record 1 > so I can process those records again. Strictly speaking, it is not possible to go back in the _same_ cursor. You'd have to execute the query again (by calling

[sqlite] Reset the cursor

2018-06-03 Thread Igor Korot
Hi, All, After executing the following: int res = sqlite3_prepare_v2( ... stmt ); while( ; ; ) { res = sqlite3_step( stmt ); if( res == SQLITE_ROW ) { // process the record } else if( res == SQLITE_DONE ) break; else { // error procressing }