Re: [sqlite] Unexplained minor regression (bug) 3.7.8 up

2011-12-06 Thread Max Vlasov
On Tue, Dec 6, 2011 at 9:49 PM, Dan Kennedy  wrote:

> On 12/06/2011 03:28 PM, Max Vlasov wrote:
>
>> Hi,
>> Noticed a strange regression after 3.7.7 (in 3.7.8 and inherited in 3.7.9)
>>
>>
> There is a candidate fix for this in fossil now.
>
>
Dan, thanks
I checked the latest trunk against my unprepared database and query,
everything is fine.

btw, could not find exact steps for getting trunk amalgamation.
Is it :
- get
http://www.sqlite.org/src/tarball/sqlite-latest-trunk.tar.gz?uuid=trunk
- extract on a unix-compatible machine
- ./configure
- make sqlite3.c

For me it worked, but maybe there are other things to mention.

Max
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Tcl syntax help

2011-12-06 Thread Shamil F. Daghestani
I have variables containing lists of values I'd like to insert into a table one 
row at a time.  For example: if I have a variable called "road" containing 
three items: Miller lane, Pine street, Wilson blvd.  How can I insert each of 
the road names in separate columns in my table?  Something like:

db eval {insert into myTable VALUES($roads)}

I understand I can split the list, save each road name in a variable, and 
insert them by putting them into the table with something like
... VALUES($v1,$v2,$v3)

But I don't want to do that because I have over one hundred columns and don't 
want to clutter my code.

Thanks!




Disclaimer:

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to which they are addressed. If 
you are not the intended recipient or have received this email in error please 
notify the system manager and destroy this email. Any unauthorized copying, 
disclosure or distribution of the material in this e-mail is strictly 
forbidden. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Cache design using sqlite3...

2011-12-06 Thread Dan Kennedy

On 12/07/2011 12:25 PM, Dan Kennedy wrote:

On 12/07/2011 01:35 AM, Alejandro Martínez wrote:

I'm trying to use sqlite3 as a cache layer for queries on other
database. Actually, replace an existing layer cache which is very
adhoc and propietary (and that sucks), and i'd like to replace it with
something peer reviewed / open source, etc like sqlite.

So... I would like to have a process which periodically gets some
tables from a master database and stores it in a sqlite database.

Then some other processes would access the sqlite database to read and
use such cached data.

So its the tipical scenario of "one writer and many readers".

So the question is... regarding the locking mechanism...

What would be better during the "writer" process's "refresh" cycle for
each table:

1. Create a new table, load the new content (lots of inserts), and
then replace the old table by dropping the old one and renaming the
new one within a transaction.
or
2. Drop the table and then insert the new content within a transaction.

The objective is to block readers the least ammount of time possible
(probably using read uncommited), and of course, not cause writer
starvation.

I don't understand well from the documentation how "read uncommited"
performs when the master table is modified (as in option 1).

And yes, i've considered using a wal journal, but the problem is i'm
scared of the wal file growing out of control as i can't completely
guarantee that ALL prepared statements would be "reset" at the same
time and thus reach a checkpoint. The reason for this is that i must
satisfy a certain api, beyond my control :S for backwards
compatibility reasons.


If you run the command:

PRAGMA wal_checkpoint = restart

Then it blocks (calls the busy-handler) until all frames in the
WAL file have been checkpointed and all readers are reading the
latest database snapshot from the database file. This guarantees
that the next client to write to the database starts writing to
the start of the WAL file.

Other database writers are blocked while the "PRAGMA wal_checkpoint"
is running, but readers are not.


  http://www.sqlite.org/pragma.html#pragma_wal_checkpoint
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Cache design using sqlite3...

2011-12-06 Thread Dan Kennedy

On 12/07/2011 01:35 AM, Alejandro Martínez wrote:

I'm trying to use sqlite3 as a cache layer for queries on other
database. Actually, replace an existing layer cache which is very
adhoc and propietary (and that sucks), and i'd like to replace it with
something peer reviewed / open source, etc like sqlite.

So... I would like to have a process which periodically gets some
tables from a master database and stores it in a sqlite database.

Then some other processes would access the sqlite database to read and
use such cached data.

So its the tipical scenario of "one writer and many readers".

So the question is... regarding the locking mechanism...

What would be better during the "writer" process's "refresh" cycle for
each table:

1. Create a new table, load the new content (lots of inserts), and
then replace the old table by dropping the old one and renaming the
new one within a transaction.
or
2. Drop the table and then insert the new content within a transaction.

The objective is to block readers the least ammount of time possible
(probably using read uncommited), and of course, not cause writer
starvation.

I don't understand well from the documentation how "read uncommited"
performs when the master table is modified (as in option 1).

And yes, i've considered using a wal journal, but the problem is i'm
scared of the wal file growing out of control as i can't completely
guarantee that ALL prepared statements would be "reset" at the same
time and thus reach a checkpoint. The reason for this is that i must
satisfy a certain api, beyond my control :S for backwards
compatibility reasons.


If you run the command:

  PRAGMA wal_checkpoint = restart

Then it blocks (calls the busy-handler) until all frames in the
WAL file have been checkpointed and all readers are reading the
latest database snapshot from the database file. This guarantees
that the next client to write to the database starts writing to
the start of the WAL file.

Other database writers are blocked while the "PRAGMA wal_checkpoint"
is running, but readers are not.



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Load a .NET DLL with additional functions usingload_extension

2011-12-06 Thread Joe Mistachkin

H K wrote:
>
> Is it possible to load these functions with the load_extension function?
>

Please take a look at the SQLiteFunction help topic in the
System.Data.SQLite CHM file,
here:

http://system.data.sqlite.org/index.html/artifact?filename=Doc/SQLite.NET.ch
m=tip

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread Sean Pieper
yED is nice, but there isn't an automated way of loading a schema into it to 
get an ER diagram out, is there?
I thought if you go down that path you were basically stuck drawing your 
diagram by hand (using their ER diagram shapes).

-sean

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Oliver Peters
Sent: Tuesday, December 06, 2011 11:53 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Database Diagram

Am Dienstag, den 06.12.2011, 04:45 -0800 schrieb priya786:
> Hello i want to know how to get the database diagram from sqlite.Please tell
> me the solution.Thanks in Advance.

for ER diagrams i.e.

- dia (http://live.gnome.org/Dia, linux and ms)
- yED (http://www.yworks.com/en/products_yed_about.html, linux & ms)

greetings
oliver

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Cache design using sqlite3...

2011-12-06 Thread Simon Slavin

On 6 Dec 2011, at 9:58pm, Jos Groot Lipman wrote:

> At some point (idle?) the readers should close the database connection and
> you must make sure any new connection starts to the new database?

Right.  One way to do it is to have a table in the database used to point to 
the next database.  Normally that table has zero rows in it.  You can check it 
with

SELECT COUNT(*) FROM databaseObsolete

when an entry does appear in it the count switches to 1.  If your operating 
system supports aliases/shortcuts/links you can change one of them to point to 
whatever file is the current database file.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Cache design using sqlite3...

2011-12-06 Thread Jos Groot Lipman
At some point (idle?) the readers should close the database connection and
you must make sure any new connection starts to the new database?
(just brainstorming)

Jos

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Alejandro Martínez
Sent: dinsdag 6 december 2011 20:56
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Cache design using sqlite3...

It would be a pretty small ammount of data. Say... 10Mb at most.

How would that be? I mean, the "switching the databases".

It would need to be transparent to the readers. How would they see the new
data?

On Tue, Dec 6, 2011 at 5:23 PM, Jos Groot Lipman  wrote:
>
> -Original Message-
> From: sqlite-users-boun...@sqlite.org
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Alejandro 
> Martínez
> Sent: dinsdag 6 december 2011 19:35
> To: General Discussion of SQLite Database
> Subject: [sqlite] Cache design using sqlite3...
>
> I'm trying to use sqlite3 as a cache layer for queries on other database.
> Actually, replace an existing layer cache which is very adhoc and 
> propietary (and that sucks), and i'd like to replace it with something 
> peer reviewed / open source, etc like sqlite.
>
> ---
> How much data are we talking here?
>
> Have you considered refreshing by filling a completely separate 
> database and just switching the databases?
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Cache design using sqlite3...

2011-12-06 Thread Alejandro Martínez
It would be a pretty small ammount of data. Say... 10Mb at most.

How would that be? I mean, the "switching the databases".

It would need to be transparent to the readers. How would they see the new data?

On Tue, Dec 6, 2011 at 5:23 PM, Jos Groot Lipman  wrote:
>
> -Original Message-
> From: sqlite-users-boun...@sqlite.org
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Alejandro Martínez
> Sent: dinsdag 6 december 2011 19:35
> To: General Discussion of SQLite Database
> Subject: [sqlite] Cache design using sqlite3...
>
> I'm trying to use sqlite3 as a cache layer for queries on other database.
> Actually, replace an existing layer cache which is very adhoc and propietary
> (and that sucks), and i'd like to replace it with something peer reviewed /
> open source, etc like sqlite.
>
> ---
> How much data are we talking here?
>
> Have you considered refreshing by filling a completely separate database and
> just switching the databases?
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread Oliver Peters
Am Dienstag, den 06.12.2011, 04:45 -0800 schrieb priya786:
> Hello i want to know how to get the database diagram from sqlite.Please tell
> me the solution.Thanks in Advance.

for ER diagrams i.e.

- dia (http://live.gnome.org/Dia, linux and ms)
- yED (http://www.yworks.com/en/products_yed_about.html, linux & ms)

greetings
oliver

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Cache design using sqlite3...

2011-12-06 Thread Jos Groot Lipman

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Alejandro Martínez
Sent: dinsdag 6 december 2011 19:35
To: General Discussion of SQLite Database
Subject: [sqlite] Cache design using sqlite3...

I'm trying to use sqlite3 as a cache layer for queries on other database.
Actually, replace an existing layer cache which is very adhoc and propietary
(and that sucks), and i'd like to replace it with something peer reviewed /
open source, etc like sqlite.

---
How much data are we talking here?

Have you considered refreshing by filling a completely separate database and
just switching the databases?

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread python
> I like navicat lite generally, though the lite version does not have 
> diagramming. Their commercial edition does have this and they have 30 day 
> free trials, so I'd probably check that out first and see if it does what you 
> need. Mac users seem to universally adore sql editor (Puneet just suggested 
> this too) and the price seems good, but most of us are stuck with Windows or 
> Linux, so that might not be an option. 

Thanks Sean!

Malcolm
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Cache design using sqlite3...

2011-12-06 Thread Alejandro Martínez
I'm trying to use sqlite3 as a cache layer for queries on other
database. Actually, replace an existing layer cache which is very
adhoc and propietary (and that sucks), and i'd like to replace it with
something peer reviewed / open source, etc like sqlite.

So... I would like to have a process which periodically gets some
tables from a master database and stores it in a sqlite database.

Then some other processes would access the sqlite database to read and
use such cached data.

So its the tipical scenario of "one writer and many readers".

So the question is... regarding the locking mechanism...

What would be better during the "writer" process's "refresh" cycle for
each table:

1. Create a new table, load the new content (lots of inserts), and
then replace the old table by dropping the old one and renaming the
new one within a transaction.
or
2. Drop the table and then insert the new content within a transaction.

The objective is to block readers the least ammount of time possible
(probably using read uncommited), and of course, not cause writer
starvation.

I don't understand well from the documentation how "read uncommited"
performs when the master table is modified (as in option 1).

And yes, i've considered using a wal journal, but the problem is i'm
scared of the wal file growing out of control as i can't completely
guarantee that ALL prepared statements would be "reset" at the same
time and thus reach a checkpoint. The reason for this is that i must
satisfy a certain api, beyond my control :S for backwards
compatibility reasons.

Any advice is welcome.

Thank you!

Alejandro
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread Sean Pieper
I haven't tried any of the pro options since getting management to buy into 
something free is easier than something that isn't.

I like navicat lite generally, though the lite version does not have 
diagramming. Their commercial edition does have this and they have 30 day free 
trials, so I'd probably check that out first and see if it does what you need. 
Mac users seem to universally adore sql editor (Puneet just suggested this too) 
and the price seems good, but most of us are stuck with Windows or Linux, so 
that might not be an option. 

-sean

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of pyt...@bdurham.com
Sent: Tuesday, December 06, 2011 9:40 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Database Diagram

Hi Sean,

> That said, having looked at tens of free options and seen the average 
> quality, I would strongly recommend paying a few hundred bucks for a 
> professional product if I needed this functionality.

Do you have any recommendations on commercial database diagram products?

Thanks,
Malcolm
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Unexplained minor regression (bug) 3.7.8 up

2011-12-06 Thread Dan Kennedy

On 12/06/2011 03:28 PM, Max Vlasov wrote:

Hi,
Noticed a strange regression after 3.7.7 (in 3.7.8 and inherited in 3.7.9)

I have a Russian morphology database and different queries working with it.
I narrowed it to the following case and populated with a couple of English
words (just to make sense)

The following database

CREATE TABLE [Beginnings] ([Id] INTEGER PRIMARY KEY AUTOINCREMENT,[Title]
TEXT, [EndingId] INTEGER);
CREATE TABLE [Endings] (Id INT,Title TEXT,EndingId INT);
INSERT INTO Beginnings (Id, Title, EndingId) VALUES (1, 'FACTOR', 18);
INSERT INTO Beginnings (Id, Title, EndingId) VALUES (2, 'SWIMM', 18);
INSERT INTO Endings (Id, Title, EndingId) VALUES (1, 'ING', 18);

There's a query that searches for primary form of a united list of some
words (here FACTORING and SWIMMING):

SELECT
   SrcWord, Beginnings.Title
FROM
   (SELECT 'FACTORING' AS SrcWord UNION
SELECT 'SWIMMING' AS SrcWord )
LEFT JOIN
   Beginnings
WHERE
   Beginnings.Id=
(SELECT BeginningId FROM
(SELECT
  SrcWord, B.Id as BeginningId, B.Title || E.Title As Connected
FROM
  Beginnings B
LEFT JOIN
  Endings E
ON
  B.EndingId=E.EndingId
WHERE
  Connected=SrcWord
LIMIT
  1))


There is a candidate fix for this in fossil now.

Alternatively, a workaround with 3.7.9 is to remove the "LIMIT 1"
from the sub-query. Or replace the "LEFT JOIN" in the subquery with
a regular JOIN. The query then seems to work as expected.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread python
Hi Sean,

> That said, having looked at tens of free options and seen the average 
> quality, I would strongly recommend paying a few hundred bucks for a 
> professional product if I needed this functionality.

Do you have any recommendations on commercial database diagram products?

Thanks,
Malcolm
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread Mr. Puneet Kishor

On Dec 6, 2011, at 6:45 AM, priya786 wrote:

> Hello i want to know how to get the database diagram from sqlite.Please tell
> me the solution.


If you are on a Mac, SQL Editor is a very nice product for about $80.
http://www.malcolmhardie.com/sqleditor/

--
Puneet Kishor
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread Sean Pieper
He wants an ER diagram, not a dump of the tables and contents. I wanted this 
too and did some digging.

There are a lot of pay tools that can do this (I think navicat for example does 
it). If pay tools are not an option, there are a bunch of things that claim to 
work, such as SQLFairy and some various JAVA libraries but never got updated to 
support foreign keys in sqlite. The best free option I've found is adminer, 
though it doesn't do automatic layout and doesn't seem to have print 
capability. If you don't need to generate diagrams all the time, you could 
manually arrange the contents until you're happy and then take a screen shot.

That said, having looked at tens of free options and seen the average quality, 
I would strongly recommend paying a few hundred bucks for a professional 
product if I needed this functionality.

-sean

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Donald Griggs
Sent: Tuesday, December 06, 2011 5:21 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Database Diagram

Regarding:

>
> Hello i want to know how to get the database diagram from sqlite.Please
> tell
> me the solution.Thanks in Advance.
>
> Quick answer:
 The sqlite3 utility, linked from the sqlite.org website, can dump
schema with the
 .schema
command.   If you need more than this, you will have to look to utility
programs written by others.

More detailed answer:
 Priya, if the quick answer above makes no sense to you, then I suggest
you write back to this list using many more words.   This list is for those
incorporating sqlite into their computer programs.   If you're not doing
programming, let us know what application you're using, what type of
database diagram you're wanting, and perhaps what the eventual goal is --
then someone here might (or might not) be able to direct you better.
Donald
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] import data error message cannot open file

2011-12-06 Thread Simon Slavin

On 5 Dec 2011, at 6:41pm, Helen Chen wrote:

>I am using Mac OX to run sqlite 3. In sqlite 3 I typed in 
> create table test2(code integer);

You hit return key ?  You got a prompt back ?

> Then I typed
> .import 'cheps.txt' test 2

You should have typed

.import cheps.txt test2

if it still cannot open the file then your problem is that it's not looking in 
the directory you think it's looking in.  I recommend you

quit sqlite3,
put the database file and cheps.txt in the same directory,
cd to that directory,
open the database file and make sure your table is still there,
and /then/ do the .import command as above.

Note that the file access routines in sqlite3 do not correctly implement folder 
names such as

~/Desktop/cheps.txt

so you can't specify things relative to your home folder.  You have to do 
things like

/Users/shortname/Desktop/cheps.txt

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [patch 2/2] move "const" out of loop in "WHERE const AND expr"

2011-12-06 Thread Yuriy Kaminskiy
Yuriy Kaminskiy wrote:
> Yuriy Kaminskiy wrote:
>> Yuriy Kaminskiy wrote:
>>> When WHERE condition is constant, there are no need to evaluate and check 
>>> it for
>>> each row. It works, but only partially:
>> ...
>>> [In fact, you can move out out loop not only *whole* constant WHERE, but 
>>> also
>>> all constant AND terms of WHERE, like this:
>>> SELECT * FROM t WHERE const1 AND notconst AND const2 ->
>>> SELECT * FROM (SELECT * FROM t WHERE notconst) WHERE const1 AND const2
>>> I'll take a shot on that later.]
>> Here it goes.
>>
>> Prerequisite: previous patch.
>> Passes quick regression test (make test).
>> Possible problem: short-circuits evaluation. Should not be problem, IMO, as 
>> only
>> constants references? Please verify.
> 
> Ping.
Ping.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] import data error message cannot open file

2011-12-06 Thread Black, Michael (IS)
You're seeing on of my pet peeves...error messages like "cannot open file" or 
Microsoft's famous "cannot load dll".  Some of us need to know WHY.



So, change all your "cannot open" lines in shell.c to this:



fprintf(stderr, "Error: cannot open \"%s\":%s\n", zFile, strerror(errno));



Then you'll see the real errror which could be permissions, not found, or some 
other.



And if it says "No such file..." then maybe you have some funky character.  Can 
you "more" the filename?



Then show us your complete line of execution like this:



vi test.txt (insert line '1')

./sqlite3 test.db

create table test2(code integer);

.import 'test.txt' test2



And the resultant error message.



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Helen Chen [xche...@partners.org]
Sent: Monday, December 05, 2011 12:41 PM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] import data error message cannot open file

Dear all,
I am using Mac OX to run sqlite 3. In sqlite 3 I typed in 
create table test2(code integer);Then I typed
.import 'cheps.txt' test 2  It then give me error message saying that cannot 
open "cheps.txt" I also tried without the '' around the file name. The 
database, the text file and sqlite.ext are in the same path. Can any one tell 
me why this is the case? Thank you very much.

Helen


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Load a .NET DLL with additional functions using load_extension

2011-12-06 Thread H K
Hello everybody,

I have written some additional functions to do some very specific work with
SQLite using the .NET SQLite provider.
The functions are written in VB.net and compiled into a dll file.

Is it possible to load these functions with the load_extension function?

Thank you.
ik
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread Donald Griggs
Regarding:

>
> Hello i want to know how to get the database diagram from sqlite.Please
> tell
> me the solution.Thanks in Advance.
>
> Quick answer:
 The sqlite3 utility, linked from the sqlite.org website, can dump
schema with the
 .schema
command.   If you need more than this, you will have to look to utility
programs written by others.

More detailed answer:
 Priya, if the quick answer above makes no sense to you, then I suggest
you write back to this list using many more words.   This list is for those
incorporating sqlite into their computer programs.   If you're not doing
programming, let us know what application you're using, what type of
database diagram you're wanting, and perhaps what the eventual goal is --
then someone here might (or might not) be able to direct you better.
Donald
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite3.exe version 3.7.9 - subsystem Shell - command .dump // Views and Triggers based on virtual tables are ignored

2011-12-06 Thread Manfred Blech

Hello Team of SQLite3,

I am using many self-made extension functions and some self-made virtual
table extensions to access files and folders with SQL statements.
This is very effective but I have a problem to duplicate my databases,
which are using them.

When I try to create a copy of my database using the .dump command and a
pipe on command line, then the result will NOT contain the views (and
probably triggers on them). I do not use yet triggers on views.

This is a request forshell.c enhancement to also export and import views,
which are based on virtual tables.

I could not find any hint about this missing portion when using the .dump
command.
To the best of my knowledge the .dump command is the only one which might
help in case of a corruped file image.

Best regards,

Manfred Blech
Engineering Tires
Final Finishing

Continental
Division Nfz-Reifen/Commercial Vehicle Tires
Jädekamp 30, D-30419 Hannover, Germany

Telefon/Phone: +49 511 976-46135
Handy/Mobile: +49 151 58 24 84 31
Telefax: +49 511 976-3338
E-Mail: manfred.bl...@conti.de
http://www.continental-corporation.com
_
Continental Reifen Deutschland GmbH, Vahrenwalder Str. 9, D-30165 Hannover
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Nikolai 
Setzer; Geschaeftsfuehrer/Managing Director: Bernd Guenther, Burkhardt 
Koeller
Sitz der Gesellschaft/Registered Office: Hannover, 
Registergericht/Registered Court: Amtsgericht Hannover HRB 204239, 
USt.-ID-Nr./VAT-ID-No. DE264920698
_
Proprietary and confidential. Distribution only by express authority of 
Continental AG or its subsidiaries.



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] import data error message cannot open file

2011-12-06 Thread Helen Chen
Dear all,
I am using Mac OX to run sqlite 3. In sqlite 3 I typed in 
create table test2(code integer);Then I typed
.import 'cheps.txt' test 2  It then give me error message saying that cannot 
open "cheps.txt" I also tried without the '' around the file name. The 
database, the text file and sqlite.ext are in the same path. Can any one tell 
me why this is the case? Thank you very much.

Helen


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database Diagram

2011-12-06 Thread Petite Abeille

On Dec 6, 2011, at 1:45 PM, priya786 wrote:

> i want to know

Yes.

> how to get the database diagram from sqlite.

Yes

> Please tell me the solution.

42.

In other news, I prefer mine round:

http://www.visualcomplexity.com/vc/project.cfm?id=42

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Database Diagram

2011-12-06 Thread priya786

Hello i want to know how to get the database diagram from sqlite.Please tell
me the solution.Thanks in Advance.
-- 
View this message in context: 
http://old.nabble.com/Database-Diagram-tp32923825p32923825.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Inconsistent limit checks

2011-12-06 Thread Filip Navara
Hi,

there seems to be an inconsistency for limit checks between zeroblob() and
the rest of code:

sqlite> CREATE TABLE "a" ("c" BLOB);
sqlite> INSERT INTO "a" VALUES (zeroblob(11));
Error: string or blob too big
sqlite> INSERT INTO "a" VALUES (zeroblob(10));
sqlite> SELECT "c" FROM "a";
Error: string or blob too big

Best regards,
Filip Navara
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Unexplained minor regression (bug) 3.7.8 up

2011-12-06 Thread Max Vlasov
Hi,
Noticed a strange regression after 3.7.7 (in 3.7.8 and inherited in 3.7.9)

I have a Russian morphology database and different queries working with it.
I narrowed it to the following case and populated with a couple of English
words (just to make sense)

The following database

CREATE TABLE [Beginnings] ([Id] INTEGER PRIMARY KEY AUTOINCREMENT,[Title]
TEXT, [EndingId] INTEGER);
CREATE TABLE [Endings] (Id INT,Title TEXT,EndingId INT);
INSERT INTO Beginnings (Id, Title, EndingId) VALUES (1, 'FACTOR', 18);
INSERT INTO Beginnings (Id, Title, EndingId) VALUES (2, 'SWIMM', 18);
INSERT INTO Endings (Id, Title, EndingId) VALUES (1, 'ING', 18);

There's a query that searches for primary form of a united list of some
words (here FACTORING and SWIMMING):

SELECT
  SrcWord, Beginnings.Title
FROM
  (SELECT 'FACTORING' AS SrcWord UNION
   SELECT 'SWIMMING' AS SrcWord )
LEFT JOIN
  Beginnings
WHERE
  Beginnings.Id=
   (SELECT BeginningId FROM
   (SELECT
 SrcWord, B.Id as BeginningId, B.Title || E.Title As Connected
   FROM
 Beginnings B
   LEFT JOIN
 Endings E
   ON
 B.EndingId=E.EndingId
   WHERE
 Connected=SrcWord
   LIMIT
 1))

Sqlite versions before 3.7.7 (inclusive) returns results (2 rows). 3.7.8
and above shows empty result set

Thanks,

Max Vlasov
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL file size

2011-12-06 Thread Lukas Gebauer
> *The prgama PRAGMA journal_size_limit = **N , *does not seem to limit
> the size of the WAL log file.  Is there any precondition to be
> satisfied before calling the pragma ?

I have same problem (on Windows). See this console session:

SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table waltest (data text);
sqlite> pragma journal_mode=wal;
wal
sqlite> pragma journal_size_limit;
-1
sqlite> pragma journal_size_limit=0;
0
sqlite> pragma wal_checkpoint;
0|-1|-1
sqlite> begin;
sqlite> insert into waltest(data) values 
("qwertyuiopasdfghjklzxcvbnm1234567890");
sqlite> insert into waltest(data) values 
("qwertyuiopasdfghjklzxcvbnm1234567890");
sqlite> insert into waltest(data) values 
("qwertyuiopasdfghjklzxcvbnm1234567890");
sqlite> insert into waltest(data) values 
("qwertyuiopasdfghjklzxcvbnm1234567890");
sqlite> commit;
sqlite> pragma wal_checkpoint;
0|2|2
sqlite> pragma wal_checkpoint(restart);
0|2|2
sqlite> pragma wal_checkpoint(restart);
0|2|2
sqlite>.quit

WAL log is deleted on database disconnect only. On big writes WAL log 
grows and grows... even I commiting datas, even I have no long 
transactions, even I have autocheckpointing , even I do checkpointing 
manually. Just close and reopen database clears WAL log file.

Is this correct behavior?

Thank you!

-- 
Lukas Gebauer.

http://synapse.ararat.cz/ - Ararat Synapse - TCP/IP Lib.
http://geoget.ararat.cz/ - Geocaching solution

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users