[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 }

Re: [sqlite] Subject: Re: SQL Date Import

2018-06-03 Thread dmp
> SQLite doesn't have a DATE type. You can store dates in a SQLite > database as text, or integers or floating point numbers (e.g. "20180602", > a number of days, a number of seconds). But when you ask for a value, > that's what you'll get back. Any interpretation of that value as a > date is

Re: [sqlite] Subject: Re: SQL Date Import

2018-06-03 Thread Jean-Christophe Deschamps
The problem not having a DATETIME field is, however, very simple: When reading a foreign database which stores date values as a number, I have to guess on how to get back the correct date. The datatype used is irrelevant w.r.t. this issue. Unless fully qualified with convention used and

Re: [sqlite] [EXTERNAL] Re: Subject: Re: SQL Date Import

2018-06-03 Thread Hick Gunter
Not even Microsoft Excel has a dedicated datetime/timestamp type. It is just a presentation layer attribute of a floating point value. Also, you get to choose the way you want calendar data to be stored. So why? -Ursprüngliche Nachricht- Von: sqlite-users

Re: [sqlite] "cursored" queries and total rows

2018-06-03 Thread R Smith
On 2018/06/03 1:13 PM, Wout Mertens wrote: Hi all, To do paged queries on a query like SELECT colVal FROM t WHERE b=? LIMIT 10 I keep track of column values and construct a query that will get the next item in a query by augmenting the query like SELECT colVal FROM t WHERE b=? AND

Re: [sqlite] "cursored" queries and total rows

2018-06-03 Thread Clemens Ladisch
Wout Mertens wrote: > To do paged queries on a query like > > SELECT colVal FROM t WHERE b=? LIMIT 10 This does not make sense without an ORDER BY. > To know how many rows there are in the query, I do > > SELECT COUNT(*) FROM t WHERE b=? > > Are there any efficiency tricks here? No.

[sqlite] "cursored" queries and total rows

2018-06-03 Thread Wout Mertens
Hi all, To do paged queries on a query like SELECT colVal FROM t WHERE b=? LIMIT 10 I keep track of column values and construct a query that will get the next item in a query by augmenting the query like SELECT colVal FROM t WHERE b=? AND colVal > ? LIMIT 10 To know how many rows

Re: [sqlite] Subject: Re: SQL Date Import

2018-06-03 Thread Simon Slavin
On 3 Jun 2018, at 9:48am, Thomas Kurz wrote: > he problem not having a DATETIME field is, however, very simple: When reading > a foreign database which stores date values as a number, I have to guess on > how to get back the correct date. People and companies are very creative in > that

Re: [sqlite] Subject: Re: SQL Date Import

2018-06-03 Thread Thomas Kurz
> One problem with having an actual internal date format is how to dump it into > a text file or to a text interface. You end up turning it into a number or a > string anyway, so you might was well store it that way. The problem not having a DATETIME field is, however, very simple: When