[sqlite] Query Optimizer and INTEGER PRIMARY KEY

2006-12-18 Thread Jesús López
Hi, Given the table: CREATE TABLE Posts ( PostID INTEGER PRIMARY KEY, CategoryID INT NOT NULL ) Filled up with 500,000 rows And the index: CREATE UNIQUE INDEX IX_Posts (CategoryID, PostID) The query: SELECT CategoryID, PostID FROM Posts ORDER BY CategoryID LIMIT 10 Takes about

Re: [sqlite] SQL error: near "READ_ONLY": syntax error

2006-12-18 Thread John Stanton
Look here - http://www.sqlite.org/lang_transaction.html LuYanJun wrote: > Thanks, But I step the instruction fellow the hint by offcial document by > which said that's correct(BTW forgive me my poor english ): > http://www.sqlite.org/concurrency.html > 4.1 Read-only transactions > BEGIN

[sqlite] Re: SQL error: near "READ_ONLY": syntax error

2006-12-18 Thread Igor Tandetnik
LuYanJun <[EMAIL PROTECTED]> wrote: Thanks, But I step the instruction fellow the hint by offcial document by which said that's correct(BTW forgive me my poor english ): http://www.sqlite.org/concurrency.html 4.1 Read-only transactions BEGIN READ_ONLY; SELECT * FROM t1; SELECT * FROM t2; COMMIT;

Re: [sqlite] SQL error: near "READ_ONLY": syntax error

2006-12-18 Thread LuYanJun
Thanks, But I step the instruction fellow the hint by offcial document by which said that's correct(BTW forgive me my poor english ): http://www.sqlite.org/concurrency.html 4.1 Read-only transactions BEGIN READ_ONLY; SELECT * FROM t1; SELECT * FROM t2; COMMIT; 4.2 Defer write locks BEGIN

Re: [sqlite] Is there a method for doing bulk insertion?

2006-12-18 Thread Jay Sprenkle
On 12/18/06, Anderson, James H (IT) <[EMAIL PROTECTED]> wrote: I was hoping there was the equivalent of Sybase's BCP program. I was also hoping something programmatic was available, i.e., not something from the command shell. Maybe a little background would help. I'm planning on using the perl

Re: [sqlite] Is Column UNIQUE? How To

2006-12-18 Thread Dennis Cote
Firman Wandayandi wrote: Hi, Is any possible way to know if a column is UNIQUE without "PRAGMA index_info('')"? Seems "PRAGMA table_info('')" doesn't returns the unique flag of column. Thanks for advice. Firman, You should try pragma index_list(''). It returns a list of all the indexes (or

Re: [sqlite] disk I/O error writing files mounted via samba

2006-12-18 Thread Guy Hindell
[EMAIL PROTECTED] wrote: Guy Hindell <[EMAIL PROTECTED]> wrote: I would like to use sqlite (v3.3.8) on a linux box (fedora core 5) to read/write a database file in a directory which is actually on a windows share mounted via samba/cifs. I can open the file, and read from it, but writing

RE: [sqlite] Is there a method for doing bulk insertion?

2006-12-18 Thread Anderson, James H \(IT\)
I was hoping there was the equivalent of Sybase's BCP program. I was also hoping something programmatic was available, i.e., not something from the command shell. Maybe a little background would help. I'm planning on using the perl package DBD::SQLite. My department is a big sybase user but

Re: [sqlite] SQLite 3 and MS SQL CE Compatibility Issues?

2006-12-18 Thread Gregory Letellier
Many differents on create table statements... [EMAIL PROTECTED] a écrit : My client has an application which uses MS-SQL CE. My app uses SQLite 3. Does anyone know of any compatibility issues? Thanks, Richard

[sqlite] SQLite 3 and MS SQL CE Compatibility Issues?

2006-12-18 Thread Richard.Murphy
My client has an application which uses MS-SQL CE. My app uses SQLite 3. Does anyone know of any compatibility issues? Thanks, Richard

Re: [sqlite] Is there a method for doing bulk insertion?

2006-12-18 Thread drh
"Anderson, James H \(IT\)" <[EMAIL PROTECTED]> wrote: > or do I have to creation a gazillion insert statements? > The sqlite3 command-line shell has a ".import" command which can be used to read CSV data. But the way this works internally is that the command-line shell constructs an INSERT

[sqlite] Is there a method for doing bulk insertion?

2006-12-18 Thread Anderson, James H \(IT\)
...or do I have to creation a gazillion insert statements? Thanks, jim NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when

Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-18 Thread bartsmissaert
Thanks for clarifying that. I think this should settle it now. In fact when that format is used Excel will pick it up correctly as well, so that avoids the trouble of my previous method to convert my Interbase mmdd dates to Excel integer dates via the Julianday function. RBS > [EMAIL

Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-18 Thread bartsmissaert
Yes, so that may settle it then. RBS > [EMAIL PROTECTED] wrote: >> I think it was the date format in the SQLite table that wasn't right. >> I had this as dd-mm- >> >> Doing SELECT date('2006-02-16','+1 month') >> gives me indeed correctly 16 Feb 2006 >> >> So does the format have to be

Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-18 Thread drh
[EMAIL PROTECTED] wrote: > I think it was the date format in the SQLite table that wasn't right. > I had this as dd-mm- > > Doing SELECT date('2006-02-16','+1 month') > gives me indeed correctly 16 Feb 2006 > > So does the format have to be -mm-dd ? > Yes. That format is called

Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-18 Thread Martin Jenkins
[EMAIL PROTECTED] wrote: I think it was the date format in the SQLite table that wasn't right. I had this as dd-mm- Doing SELECT date('2006-02-16','+1 month') gives me indeed correctly 16 Feb 2006 So does the format have to be -mm-dd ? Only if you want it to work... ;) Martin

Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-18 Thread bartsmissaert
I think it was the date format in the SQLite table that wasn't right. I had this as dd-mm- Doing SELECT date('2006-02-16','+1 month') gives me indeed correctly 16 Feb 2006 So does the format have to be -mm-dd ? RBS > [EMAIL PROTECTED] wrote: >> Unfortunately, it looks that just adds

Re: [sqlite] Calculate years and months difference with Julian Date?

2006-12-18 Thread drh
[EMAIL PROTECTED] wrote: > Unfortunately, it looks that just adds 30 days, so 16 Feb 06 will give 18 > March 06 etc. > SELECT date('2006-01-16','+1 month'); yields 2006-02-16. You must have typed something wrong. -- D. Richard Hipp <[EMAIL PROTECTED]>

RE: [sqlite] Calculate years and months difference with Julian Date?

2006-12-18 Thread bartsmissaert
Unfortunately, it looks that just adds 30 days, so 16 Feb 06 will give 18 March 06 etc. RBS >> If you have two dates A and B, you can ask the question: > >> Is A more than one month after B like this: > >> SELECT julianday(A,'+1 month')>B ... > > > Thanks; that looks exactly what I need. > >

RE: [sqlite] Is sqlite the right db for me?

2006-12-18 Thread Denis Povshedny
Hi Steve, as a possible alternative for Python you may take a look at Lua language. www.lua.org Here is also a few webserver platform such as Xavante. Web-pages looks as standard html pages with Lua code fragment (similar to ASP but simpler) Lua supports SQLite with nice library luasqlite.