Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread P Kishor
On Fri, Feb 5, 2010 at 3:33 PM, Vasanta wrote: > Kittayya: > > My issue is, I already have imported table in the Database, there alreay > around 1000 records in that table where ROWID is from 1 to 1000, now system > generates new events, where ROWID again starts from beginning

Re: [sqlite] pdo_sqlite 3.3 or above

2010-02-05 Thread Steffenhagen Kerm
I cannot use the binaries at the download site for the user machine, they are built for Intel (X86) , and my target machine is a Power PC (ppc7400) CPUs. I looked for info on "php_pdo_sqlite_external" and I didn't find anything helpful, and I don't know what it is or how to use it. Is it

Re: [sqlite] Multi-Table constraint

2010-02-05 Thread Jay A. Kreibich
On Fri, Feb 05, 2010 at 06:42:34PM -0500, German Escallon scratched on the wall: > create table X(xid integer primary key); > create table Y(yid integer primary key, y_xid references X(xid) ); > create table Z(zid integer primary key, z_xid references X(xid) ); > > create table Y_Z >( >

Re: [sqlite] pdo_sqlite 3.3 or above

2010-02-05 Thread Kees Nuyt
On Fri, 5 Feb 2010 14:53:07 -0600, Steffenhagen Kerm wrote: >Thanks for your response. > >I am not sure I understand you correctly or the software correctly, >but I think the answer is "no". The system this is targeting is Mac OS >X 10.4.x, and the native sqlite is 2.8.16. I

Re: [sqlite] system.data.sqlite & encryption

2010-02-05 Thread Shane Harrelson
Yes. If you're willing to compile (and possibly modify) the system.data.sqlite libraries for yourself, it should work. -Shane On Fri, Feb 5, 2010 at 5:05 AM, Sylvain Pointeau wrote: > I posted on this forum > http://sqlite.phxsoftware.com/forums/p/2170/8904.aspx

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread German Escallon
Dude, Are you even reading what others have (very patiently) tried to explain you? Here's one more attempt. My advice (like everyone else in here) is to let SQLITE handle that for you with autoincrement. Asuming you don't take the advice, you can also try: int main() { ... .. . ... maxId =

Re: [sqlite] Multi-Table constraint

2010-02-05 Thread Igor Tandetnik
German Escallon wrote: > Hello all, > > I'm facing a challenge, and I hope someone can give me a hand. > > I tried something along the lines of: > > create table X(xid integer primary key); > create table Y(yid integer primary key, y_xid references X(xid) ); > create

[sqlite] Multi-Table constraint

2010-02-05 Thread German Escallon
Hello all, I'm facing a challenge, and I hope someone can give me a hand. I tried something along the lines of: create table X(xid integer primary key); create table Y(yid integer primary key, y_xid references X(xid) ); create table Z(zid integer primary key, z_xid references X(xid) ); create

Re: [sqlite] how to get the meta type of a column

2010-02-05 Thread Júlio César Ködel
Unfortunately there is no way to catch the metadata for this: CREATE VIEW FOO AS SELECT Name, COUNT(*) AS Counter ... Name is returned as VARCHAR(x), but the Counter is null in metadata =( On Fri, Feb 5, 2010 at 3:24 AM, gujx wrote: > >>If all you have is a void*,

Re: [sqlite] Restricting fast no-result query yields slowno-resultquery

2010-02-05 Thread ve3meo
Thank you, thank you, Igor! This relates to the earlier thread I had started titled "Speed regression after 3.6.17" where I was wrestling with a very slow query because the query optimiser was selecting an inappropriate index, one that was very chunky because the field was logical (0,1). This

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Vasanta
Kittayya: My issue is, I already have imported table in the Database, there alreay around 1000 records in that table where ROWID is from 1 to 1000, now system generates new events, where ROWID again starts from beginning from 1, now these new events are overwriting the earlier imported events by

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread P Kishor
I am top posting here because, (1) You are simply unable to articulate your own problem clearly, (2) you are not listening to the advice that you are getting, and (3) the quicker we put you on the right track the better it will be for everyone. First, if you have a table, you should have a

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Vasanta
I wroe this code to get ROWID, but if I assign output of sqlite3_step to an id, and assign that id, is OK?. const char *rowidSql = "SELECT max(ROWID)+1 "EVENTLOG_TBL ; const char *zSql; sqlite3_stmt * pStmt, pStmt2; /* This is added to run query to get ROWID */ rc =

Re: [sqlite] pdo_sqlite 3.3 or above

2010-02-05 Thread Steffenhagen Kerm
Thanks for your response. I am not sure I understand you correctly or the software correctly, but I think the answer is "no". The system this is targeting is Mac OS X 10.4.x, and the native sqlite is 2.8.16. I was able to create a 3.2.8 pdo_sqlite shared library from source, and it works

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Shane Harrelson
As stated before, in general, you should not specify the ROWID on inserts, but instead, let the database engine choose it for you. This is true of most/all database engines. The syntax you're trying below is not supported. Indeed, even it were, max(ROWID) is the maximum ROWID *in use*. Trying

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Vasanta
This is my actual string, still not working: const char *replaceSql = "INSERT INTO "EVENTLOG_TBL \ "(_ROWID_, component, facilityId, logLevel,"\ "textMessage, binMessage) VALUES(?,?,?,?,?,?); SELECT max(ROWID) from EVENTLOG_TBL"; On

Re: [sqlite] pdo_sqlite 3.3 or above

2010-02-05 Thread Kees Nuyt
On Fri, 5 Feb 2010 11:51:33 -0600, Steffenhagen Kerm wrote: >I am new to this list. I'm looking for assistance building a PHP >version of SQLite 3 (pdo_sqlite3) that is at or above version 3.3. I >have built and installed a 3.2.8 version, but none of the higher >versions

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Vasanta
Thanks jay. Can I combine like this: "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT max(ROWID) FROM table-name"; or "INSERT INTO trends(UnitID,HeureTrends,DateTrends) VALUES(?,?,?);SELECT last_insert_rowid() AS [ID]"; On Fri, Feb 5, 2010 at 2:49 PM, Jay A. Kreibich

Re: [sqlite] Updating blob columns from files by command-line

2010-02-05 Thread Kees Nuyt
On Fri, 5 Feb 2010 09:18:27 -0500, "Paul Craven" wrote: >Given table texts(filename text, contents blob) and a directory of plain >text files, is it possible (using the command line interface alone) to >populate the table with the names and contents of all the text files, one

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Petite Abeille
On Feb 5, 2010, at 8:37 PM, Vasanta wrote: > I couldn't find, looklike lot of expert users here, throw me command quickly Help Vampires: A Spotter’s Guide http://slash7.com/2006/12/22/vampires/ ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread P Kishor
On Fri, Feb 5, 2010 at 1:35 PM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Vasanta wrote: >> command "SELECT rowid from table-name;"  gives all rows from 1 to 100 for >> total 100 rows, any command to get last rowid?. I need insert from last >>

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Vasanta
I couldn't find, looklike lot of expert users here, throw me command quickly On Fri, Feb 5, 2010 at 2:34 PM, P Kishor wrote: > On Fri, Feb 5, 2010 at 1:28 PM, Vasanta wrote: > > command "SELECT rowid from table-name;" gives all rows from 1 to 100 for >

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Vasanta wrote: > command "SELECT rowid from table-name;" gives all rows from 1 to 100 for > total 100 rows, any command to get last rowid?. I need insert from last > rowid onwards (if table already 100 records, need to insert from 101 > onwards)

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread P Kishor
On Fri, Feb 5, 2010 at 1:28 PM, Vasanta wrote: > command "SELECT rowid from table-name;"  gives all rows from 1 to 100 for > total 100 rows, any command to get last rowid?. I need insert from last > rowid onwards (if table already 100 records, need to insert from 101 > onwards)

[sqlite] any command to find last rowid in a table

2010-02-05 Thread Vasanta
command "SELECT rowid from table-name;" gives all rows from 1 to 100 for total 100 rows, any command to get last rowid?. I need insert from last rowid onwards (if table already 100 records, need to insert from 101 onwards) ___ sqlite-users mailing list

Re: [sqlite] Bug Report: DateTime incorrect for Windows

2010-02-05 Thread Shane Harrelson
I was unable to duplicate your error with the CLI and 3.6.22 (compiled with cygwin\gcc or msvc): SQLite version 3.6.22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> SELECT datetime('now') as NOW; 2010-02-05 16:33:50 sqlite> SELECT datetime('now','utc') as UTC;

[sqlite] pdo_sqlite 3.3 or above

2010-02-05 Thread Steffenhagen Kerm
I am new to this list. I'm looking for assistance building a PHP version of SQLite 3 (pdo_sqlite3) that is at or above version 3.3. I have built and installed a 3.2.8 version, but none of the higher versions of source conform to the format required to "phpize" them, and build for PHP PDO.

Re: [sqlite] Multi-process read_uncommited equivalent?

2010-02-05 Thread Jean-Christophe Deschamps
Be aware that the backup process will need to restart from zero after each write! Now, if you can setup some kind of IPC between your two processes, then you could have the update process update the disk base and send identical data to the reader process, so the latter can update a memory

Re: [sqlite] Multi-process read_uncommited equivalent?

2010-02-05 Thread Pavel Ivanov
First of all there's no multi-process equivalent of read_uncommitted. There's just no way to implement that. If you want such type of behavior with your current application structure then you should use some other RDBMS. For SQLite though I'd suggest you to use some variation of you 3rd approach:

[sqlite] Multi-process read_uncommited equivalent?

2010-02-05 Thread Paul Corke
I have two independent processes that open the same sqlite database. One inserts data into a table and the other reads from the same table and creates reports. The reader process does something like "select * from table" and then does some heavy processing between each call to sqlite3_step(). It

Re: [sqlite] How to discover the state of a statement

2010-02-05 Thread Israel Lins Albuquerque
Thank you, that's work for me. -- Israel Lins Albuquerque Desenvolvimento Polibrás Brasil Software Ltda. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to discover the state of a statement

2010-02-05 Thread Dan Kennedy
On Feb 5, 2010, at 8:09 PM, Israel Lins Albuquerque wrote: > I want to now if a statement are in a valid row. I think the test is (sqlite3_data_count(pStmt)>0). http://www.sqlite.org/c3ref/data_count.html ___ sqlite-users mailing list

Re: [sqlite] Change in index optimizer bug with FTS3 between 3.6.21 and 3.6.22?

2010-02-05 Thread Dan Kennedy
On Feb 5, 2010, at 6:03 AM, Nasron Cheong wrote: > Not sure if this is intentional, but it looks like the wrong index > is being > selected on fts tables when a rowid is involved. > > Given a table: > > CREATE VIRTUAL TABLE MessagesFts USING fts3(Message); > > Explain query plan using sqlite

Re: [sqlite] Bug Report: DateTime incorrect for Windows

2010-02-05 Thread Wilson, Ronald
> The 3 SQL statements executed in maintest.c are: > SELECT datetime('now') as NOW; > SELECT datetime('now','utc') as UTC; > SELECT datetime('now','localtime') as MST; > > Current local-time is 22:50 MST. > The results are: > NOW = 1601-01-01 00:04:49 > UTC = 1601-01-01 07:04:49 > MST =

Re: [sqlite] Updating blob columns from files by command-line

2010-02-05 Thread Simon Slavin
On 5 Feb 2010, at 2:18pm, Paul Craven wrote: > Given table texts(filename text, contents blob) and a directory of plain > text files, is it possible (using the command line interface alone) to > populate the table with the names and contents of all the text files, one > file per record? You

[sqlite] Updating blob columns from files by command-line

2010-02-05 Thread Paul Craven
Given table texts(filename text, contents blob) and a directory of plain text files, is it possible (using the command line interface alone) to populate the table with the names and contents of all the text files, one file per record? Thanks in advance, Paul Craven

[sqlite] How to discover the state of a statement

2010-02-05 Thread Israel Lins Albuquerque
I want to now if a statement are in a valid row. Some one will tell me to get the sqlite_step result, but I don't want pass this value to a lot of functions. That functions receive the stament to build some operations and that can be more fast if a now that information. Thank s for

Re: [sqlite] Restricting fast no-result query yields slow no-resultquery

2010-02-05 Thread Igor Tandetnik
Kelly Jones wrote: > I have a query that runs very quickly and returns no results: > > SELECT * FROM filebackup WHERE sha1='x'; > > However, the more restrictive query below runs very slowly, although > it obviously can't have any results either: > > SELECT * FROM filebackup WHERE sha1='x' AND

[sqlite] Bug Report: DateTime incorrect for Windows

2010-02-05 Thread 4eanlss
Hello, I'm compiling the 3.6.21 amalgamation with Borland command-line compiler version 5.2 for Windows XP. My compilation command is bcc32.exe -5 -H- -O2 -RT- -a8 -x- maintest.c sqlite3.c where maintest.c is similar to the http://www.sqlite.org/quickstart.html sample C code. The 3 SQL

Re: [sqlite] Restricting fast no-result query yields slow no-result query

2010-02-05 Thread Simon Slavin
On 5 Feb 2010, at 5:05am, Kelly Jones wrote: > I have a query that runs very quickly and returns no results: > > SELECT * FROM filebackup WHERE sha1='x'; > > However, the more restrictive query below runs very slowly, although > it obviously can't have any results either: > > SELECT * FROM

Re: [sqlite] system.data.sqlite & encryption

2010-02-05 Thread Sylvain Pointeau
I posted on this forum http://sqlite.phxsoftware.com/forums/p/2170/8904.aspx The answer was: "I'm afraid not. This is an open-source project, and the encryption Dr. Hipp sells is not open source." but as the license of system.data.sqlite is "Released to the public domain, use at your own risk!"