Re: [sqlite] sqlite3 windows command line: writing the sql errors to a file (and not to the screen)

2012-02-14 Thread Kees Nuyt
On Tue, 14 Feb 2012 21:31:15 +, "Black, Michael (IS)"
 wrote:

> type dbscript.sql | sqlite3 test.db3 > dbscript.log 2>&1

or, slightly more efficient:

sqlite3 test.db3 dbscript.log 2>&1

>
> And order is importantyou need to redirect to
> file first and then redirect stderr to stdout as above.

Indeed.

-- 
Regards,

Kees Nuyt

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


Re: [sqlite] sqlite3 windows command line: writing the sql errors to a file (and not to the screen)

2012-02-14 Thread Black, Michael (IS)
type dbscript.sql | sqlite3 test.db3 > dbscript.log 2>&1



And order is importantyou need to redirect to file first and then redirect 
stderr to stdout as above.





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 Gert Van Assche [ger...@gmail.com]
Sent: Tuesday, February 14, 2012 3:09 PM
To: sqlite-users
Subject: EXT :[sqlite] sqlite3 windows command line: writing the sql errors to 
a file (and not to the screen)

All,

I have an sql script in an dbscript.sql file. To execute this script on a
windows command line I use:

   type dbscript.sql | sqlite3 test.db3

I have put this line in a batch file: dbscript.cmd
and I just execute this on the command line. (or via a Windows shortcut on
my desktop)

This works fine, but I would like to redirect the echo to a file, so that I
can capture the errors that might occur when dbscript.sql is executed.

Does anyone have an idea how to do this?


thanks

Gert
___
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] A faster way to insert into a keyless table?

2012-02-14 Thread Rob Richardson
Many thanks for your response.  That solved the problem.  Now I update data for 
all 124 bases in about eight seconds.

RobR

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Petite Abeille
Sent: Tuesday, February 14, 2012 2:18 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] A faster way to insert into a keyless table?


On Feb 14, 2012, at 8:01 PM, Rob Richardson wrote:

>  What would be the best way to speed this up?

wrap all your inserts in one transaction. commit at the end.

___
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] sqlite3 windows command line: writing the sql errors to a file (and not to the screen)

2012-02-14 Thread Gert Van Assche
All,

I have an sql script in an dbscript.sql file. To execute this script on a
windows command line I use:

   type dbscript.sql | sqlite3 test.db3

I have put this line in a batch file: dbscript.cmd
and I just execute this on the command line. (or via a Windows shortcut on
my desktop)

This works fine, but I would like to redirect the echo to a file, so that I
can capture the errors that might occur when dbscript.sql is executed.

Does anyone have an idea how to do this?


thanks

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


Re: [sqlite] WAL mode, references to IO errors

2012-02-14 Thread Richard Hipp
On Tue, Feb 14, 2012 at 3:20 PM, Marc L. Allen
wrote:

> I think you're mixing up database size and transaction size.
>
> WAL starts having issues when a single transaction commits 100's of
> megabytes or more of data.  I believe there is no issue with very large
> databases, provided the actual transactions are relatively small.
>

Yup.  See the 9th item under disadvantages of WAL mode list at
http://www.sqlite.org/wal.html


>
> > -Original Message-
> > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> > boun...@sqlite.org] On Behalf Of Aemon Cannon
> > Sent: Tuesday, February 14, 2012 3:03 PM
> > To: sqlite-users@sqlite.org
> > Subject: [sqlite] WAL mode, references to IO errors
> >
> > Hello,
> >
> > In reading about WAL mode, I found the following passage disconcerting:
> >
> > "WAL works best with smaller transactions. WAL does not work well for
> > very large transactions. For transactions larger than about 100
> > megabytes, traditional rollback journal modes will likely be faster.
> > For transactions in excess of a gigabyte, WAL mode may fail with an I/O
> > or disk-full error.
> > It is recommended that one of the rollback journal modes be used for
> > transactions larger than a few dozen megabytes."
> > - sqlite.org/wal.html
> >
> >
> > On the other hand, I've read anecdotal reports from users on this list
> > who are using WAL mode with large databases (10s of gigabytes).
> > Is wal.html a bit out of date?
> > What exactly is meant by "may fail with an I/O or disk-full error"? Is
> > this just saying that if your WAL file grows larger than your available
> > disk space, you're out of luck?
> >
> > I'm very interested in the concurrency benefits of WAL mode, but I want
> > to be sure it's a safe choice.
> >
> > Thanks!
> > Aemon
> > ___
> > 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
>



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


Re: [sqlite] WAL mode, references to IO errors

2012-02-14 Thread Marc L. Allen
I think you're mixing up database size and transaction size.

WAL starts having issues when a single transaction commits 100's of megabytes 
or more of data.  I believe there is no issue with very large databases, 
provided the actual transactions are relatively small.

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Aemon Cannon
> Sent: Tuesday, February 14, 2012 3:03 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] WAL mode, references to IO errors
> 
> Hello,
> 
> In reading about WAL mode, I found the following passage disconcerting:
> 
> "WAL works best with smaller transactions. WAL does not work well for
> very large transactions. For transactions larger than about 100
> megabytes, traditional rollback journal modes will likely be faster.
> For transactions in excess of a gigabyte, WAL mode may fail with an I/O
> or disk-full error.
> It is recommended that one of the rollback journal modes be used for
> transactions larger than a few dozen megabytes."
> - sqlite.org/wal.html
> 
> 
> On the other hand, I've read anecdotal reports from users on this list
> who are using WAL mode with large databases (10s of gigabytes).
> Is wal.html a bit out of date?
> What exactly is meant by "may fail with an I/O or disk-full error"? Is
> this just saying that if your WAL file grows larger than your available
> disk space, you're out of luck?
> 
> I'm very interested in the concurrency benefits of WAL mode, but I want
> to be sure it's a safe choice.
> 
> Thanks!
> Aemon
> ___
> 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] WAL mode, references to IO errors

2012-02-14 Thread Aemon Cannon
Hello,

In reading about WAL mode, I found the following passage disconcerting:

"WAL works best with smaller transactions. WAL does not work well for very
large transactions. For transactions larger than about 100 megabytes,
traditional rollback journal modes will likely be faster. For transactions
in excess of a gigabyte, WAL mode may fail with an I/O or disk-full error.
It is recommended that one of the rollback journal modes be used for
transactions larger than a few dozen megabytes."
- sqlite.org/wal.html


On the other hand, I've read anecdotal reports from users on this list who
are using WAL mode with large databases (10s of gigabytes).
Is wal.html a bit out of date?
What exactly is meant by "may fail with an I/O or disk-full error"? Is this
just saying that if your WAL file grows larger than your available disk
space, you're out of luck?

I'm very interested in the concurrency benefits of WAL mode, but I want to
be sure it's a safe choice.

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


Re: [sqlite] A faster way to insert into a keyless table?

2012-02-14 Thread Petite Abeille

On Feb 14, 2012, at 8:01 PM, Rob Richardson wrote:

>  What would be the best way to speed this up?

wrap all your inserts in one transaction. commit at the end.

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


Re: [sqlite] A faster way to insert into a keyless table?

2012-02-14 Thread Simon Slavin

On 14 Feb 2012, at 7:01pm, Rob Richardson wrote:

> The application is written in C#, and uses a .Net provider for SQLite.  
> 
> The code to insert tag data is very crude.  I build an INSERT query as a 
> string, and then I call the database object's Execute() method.  
> 
> The average time to update a base is half a second.

Does this include Non-SQLite-related operations ?

Does this include the time to open and close the database connection ?

How is the computer accessing the database files: are they on the boot disk, or 
across a network or what ?

If it's just the time to execute the execute, it's ridiculously long.

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


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Simon Slavin

On 14 Feb 2012, at 6:48pm, Marc L. Allen wrote:

> Does the data type start at being the same as the column affinity in the 
> underlying table and then adjust if the actual data isn't of that type?



section 2.3 gives examples of what happens.  But an overriding rule is about 
losing data.  So SQLite might try turning a string into an integer, then back 
to a string again.  If it gets the same string back, then storing it as an 
integer didn't lose any data, so it'll do that.  Bad example, but I hope it 
helps.

> And, if I don't know the underlying table structure, I am guessing that I 
> should always treat INTEGER as a potential int64?

Use sqlite3_column_int64() or sqlite3_column_int() from



whichever suits you, yielding different sized integers.

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


[sqlite] A faster way to insert into a keyless table?

2012-02-14 Thread Rob Richardson
Greetings!

I am working on updating an application that has been around for years, 
originally written by someone who knew SQLite exists but had very little idea 
of how to use it.  The application monitors OPC information for 124 bases, with 
7-10 tags per base.  (Don't worry about what a base is.)  Each base has a 
separate SQLite database file associated with it.  Every minute, I have to 
write the latest tag value for each tag into the correct database.  Here is the 
create statement for the table into which I am writing data:
  CREATE TABLE trend_data( tag_key integer, value integer, value_timestamp 
datetime );
There is no primary key specified for this table.

The application is written in C#, and uses a .Net provider for SQLite.  

The code to insert tag data is very crude.  I build an INSERT query as a 
string, and then I call the database object's Execute() method.  

The average time to update a base is half a second.  Since I've got 124 bases, 
it takes almost exactly a minute to update each one.  But I would like the 
entire update process, for all bases, to be repeated every minute.  Therefore, 
I'd like to get the update time per base down to at most a quarter second.  
What would be the best way to speed this up?

Thanks very much!

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


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Stephan Beal
On Tue, Feb 14, 2012 at 7:48 PM, Marc L. Allen
wrote:

> Does the data type start at being the same as the column affinity in the
> underlying table and then adjust if the actual data isn't of that type?
>

i'll have to let someone else answer that, but...


> And, if I don't know the underlying table structure, I am guessing that I
> should always treat INTEGER as a potential int64?
>

Assuming your platform supports 64-bit integers, that's probably a safe
bet. If you're writing for a target which doesn't support them explicitly
(e.g. JavaScript engines traditionally don't) then using double is an
option.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Marc L. Allen
Thanks, everyone.  I appreciate all the insight.  As for the data type, I have 
a few follow up questions...

Does the data type start at being the same as the column affinity in the 
underlying table and then adjust if the actual data isn't of that type?

And, if I don't know the underlying table structure, I am guessing that I 
should always treat INTEGER as a potential int64?

Thanks,

Marc

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Rob Richardson
> Sent: Tuesday, February 14, 2012 1:09 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Able to differentiate between No query and empty
> results?
> 
> -Original Message
> 
> Also, Stephan is quite right: it's not the columns but the values which
> have datatypes, and if you're looking at some random SQLite database
> that wasn't carefully created the value in r1c1 may be an integer but
> the value in r2c1 may be text.
> 
> Simon.
> --
> A fact that has driven me up nearby walls on several occasions,
> especially when working with date/times.
> 
> RobR
> ___
> 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] Able to differentiate between No query and empty results?

2012-02-14 Thread Kees Nuyt
On Tue, 14 Feb 2012 18:08:39 +, Rob Richardson
 wrote:

>>-Original Message
>>
>> Also, Stephan is quite right: it's not the columns
>> but the values which have datatypes, and if you're
>> looking at some random SQLite database that wasn't
>> carefully created the value in r1c1 may be an
>> integer but the value in r2c1 may be text.
>>
>>Simon.
>>--
>
> A fact that has driven me up nearby walls on several
> occasions, especially when working with date/times.
>
> RobR

You can more or less restrict the datatypes a table
can contain by specifying CHECK constraints in your
table definitions. You'll have to experiment to see
what works and what doesn't.


-- 
Regards,

Kees Nuyt

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


Re: [sqlite] Incorporating user written functions into the sqlite library

2012-02-14 Thread Stephan Beal
On Tue, Feb 14, 2012 at 7:10 PM, Pete  wrote:

> the framework.   Any help on how to make these user written functions
> available to the sqlite3 library in the framework would be much
> appreciated.
>

If your framework provides a function which returns the raw sqlite3 handle
then you can use

http://www.sqlite.org/capi3ref.html#sqlite3_create_function

on that handle to register the functions (do this right after opening the
db if at all possible). If it does not provide such a handle then you're
out of luck :/.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Rob Richardson
-Original Message

Also, Stephan is quite right: it's not the columns but the values which have 
datatypes, and if you're looking at some random SQLite database that wasn't 
carefully created the value in r1c1 may be an integer but the value in r2c1 may 
be text.

Simon.
--
A fact that has driven me up nearby walls on several occasions, especially when 
working with date/times.

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


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Simon Slavin

On 14 Feb 2012, at 5:17pm, Simon Slavin wrote:

> Yes, the columncount returned will reflect what columns you asked for, even 
> if the SELECT returns zero rows.  So if columncount is zero, either it's not 
> a SELECT command, or you've somehow managed to make a SELECT which returns 
> zero rows.  At least, that's what it did a few releases ago, and I see no 
> reason it should have changed.

In the above, I should have typed "or you've somehow managed to make a SELECT 
which returns zero -->columns<--", not zero rows.  Sorry for any confusion, 
which was unfortunately key to the statement I was trying to make.

Also, Stephan is quite right: it's not the columns but the values which have 
datatypes, and if you're looking at some random SQLite database that wasn't 
carefully created the value in r1c1 may be an integer but the value in r2c1 may 
be text.

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


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Stephan Beal
To expand on Simon's warning about types: any given column can contain
different types in different rows in sqlite, so examining just the first
row to get the types is not necessarily reliable (but may be for any given
app, depending on how the app inserts/updates data).

- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
On Feb 14, 2012 6:17 PM, "Simon Slavin"  wrote:

>
> On 14 Feb 2012, at 4:50pm, Marc L. Allen wrote:
>
> > Ok.. I just want to make sure I understand.  A SELECT which returns no
> rows will still have a non-zero column count?  And, I would check the
> column count after step() returns SQLITE_DONE?
>
> Yes, the columncount returned will reflect what columns you asked for,
> even if the SELECT returns zero rows.  So if columncount is zero, either
> it's not a SELECT command, or you've somehow managed to make a SELECT which
> returns zero rows.  At least, that's what it did a few releases ago, and I
> see no reason it should have changed.
>
> Worth noting that other commands besides SELECT can also return columns.
>  For instance, PRAGMA.
>
> Also worth noting that using a SELECT which returns no rows, you can
> iterate along the columns and find the column names.  However, you can't
> find the datatypes of the columns, because columns don't have datatypes.
>  Only the data contained in the rows has datatypes, and there are no rows.
>
> Simon.
> ___
> 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] Able to differentiate between No query and empty results?

2012-02-14 Thread Simon Slavin

On 14 Feb 2012, at 4:50pm, Marc L. Allen wrote:

> Ok.. I just want to make sure I understand.  A SELECT which returns no rows 
> will still have a non-zero column count?  And, I would check the column count 
> after step() returns SQLITE_DONE?

Yes, the columncount returned will reflect what columns you asked for, even if 
the SELECT returns zero rows.  So if columncount is zero, either it's not a 
SELECT command, or you've somehow managed to make a SELECT which returns zero 
rows.  At least, that's what it did a few releases ago, and I see no reason it 
should have changed.

Worth noting that other commands besides SELECT can also return columns.  For 
instance, PRAGMA.

Also worth noting that using a SELECT which returns no rows, you can iterate 
along the columns and find the column names.  However, you can't find the 
datatypes of the columns, because columns don't have datatypes.  Only the data 
contained in the rows has datatypes, and there are no rows.

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


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Stephan Beal
Hi!

Check the column count after sqlite3_prepare(). You don't need to execute
the query to get the column count.

- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
On Feb 14, 2012 5:50 PM, "Marc L. Allen" 
wrote:

> > > Without examining the SQL itself, is it possible to determine whether
> > > an SQL statement returned no results because no rows matched the
> > > criteria or because the statement doesn't return rows?
> >
> > sqlite3_column_count should do the trick: SELECT would always have at
> > least one, while UPDATE and such would have zero.
>
> Ok.. I just want to make sure I understand.  A SELECT which returns no
> rows will still have a non-zero column count?  And, I would check the
> column count after step() returns SQLITE_DONE?
>
> Marc
> ___
> 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] Able to differentiate between No query and empty results?

2012-02-14 Thread Marc L. Allen
> > Without examining the SQL itself, is it possible to determine whether
> > an SQL statement returned no results because no rows matched the
> > criteria or because the statement doesn't return rows?
> 
> sqlite3_column_count should do the trick: SELECT would always have at
> least one, while UPDATE and such would have zero.

Ok.. I just want to make sure I understand.  A SELECT which returns no rows 
will still have a non-zero column count?  And, I would check the column count 
after step() returns SQLITE_DONE?

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


Re: [sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Igor Tandetnik

On 2/14/2012 11:34 AM, Marc L. Allen wrote:

I'm trying to write my own function that takes a set of SQL, parses into 
statements, executes and returns the results set(s).

Without examining the SQL itself, is it possible to determine whether
an SQL statement returned no results because no rows matched the
criteria or because the statement doesn't return rows?


sqlite3_column_count should do the trick: SELECT would always have at 
least one, while UPDATE and such would have zero.

--
Igor Tandetnik

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


[sqlite] Able to differentiate between No query and empty results?

2012-02-14 Thread Marc L. Allen
I'm trying to write my own function that takes a set of SQL, parses into 
statements, executes and returns the results set(s).

Without examining the SQL itself, is it possible to determine whether an SQL 
statement returned no results because no rows matched the criteria or because 
the statement doesn't return rows?

Thanks,

Marc

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


Re: [sqlite] Difference between SQLITE_CONFIG_MULTITHREAD & SQLITE_CONFIG_SERIALIZED options

2012-02-14 Thread Pavel Ivanov
When you use SQLITE_CONFIG_MULTITHREAD you can't use the same handle
in different threads without some sort of synchronization. With
SQLITE_CONFIG_SERIALIZED you can do that because SQLite will do
synchronization for you. So there's no difference in concurrency here.
If you use different handles in each thread they will communicate with
each other via file locking no matter what configuration option you
use. So there's no difference in concurrency here either.

Overall for multi-threaded application occasionally needing to do
something with database I would suggest a pool of connection handles.
When any thread needs to do something with database it gets connection
handle from pool, performs what it needs and returns back to pool for
other threads to use. If it's too complicated or if you don't want a
pool-based design for some other reasons then use one connection
handle per thread and don't worry about SQLITE_CONFIG_MULTITHREAD or
SQLITE_CONFIG_SERIALIZED options - leave them in default state.


Pavel


On Mon, Feb 13, 2012 at 5:53 PM, Rittick Gupta  wrote:
> What is the difference between the SQLITE_CONFIG_MULTITHREAD &  
> SQLITE_CONFIG_SERIALIZED options - When a) the same handle is shared between 
> multiple threads in a process and when different handles are used by threads 
> in a proceses.
>
> Is there any difference in concurrency ? What should be used in a multi 
> threaded process with  more than one thread updating and reading the database.
> ___
> 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] Handling multiple result sets in sqllite3_exec()

2012-02-14 Thread Marc L. Allen
Ok.. thanks.

Marc

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Igor Tandetnik
> Sent: Tuesday, February 14, 2012 10:50 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Handling multiple result sets in sqllite3_exec()
> 
> On 2/14/2012 10:37 AM, Marc L. Allen wrote:
> > If I call exec() with a series of SQL that returns multiple result
> sets, is there an easy way to determine that in the callback?
> 
> Not to my knowledge. So it's best to not do that. In fact, it's best to
> use sqlite3_exec, if at all, only for statements that don't return any
> results. For SELECT, consider sqlite3_prepare[_v2], sqlite3_step,
> sqlite3_column*, sqlite3_finalize.
> --
> Igor Tandetnik
> 
> ___
> 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] Handling multiple result sets in sqllite3_exec()

2012-02-14 Thread Igor Tandetnik

On 2/14/2012 10:37 AM, Marc L. Allen wrote:

If I call exec() with a series of SQL that returns multiple result sets, is 
there an easy way to determine that in the callback?


Not to my knowledge. So it's best to not do that. In fact, it's best to 
use sqlite3_exec, if at all, only for statements that don't return any 
results. For SELECT, consider sqlite3_prepare[_v2], sqlite3_step, 
sqlite3_column*, sqlite3_finalize.

--
Igor Tandetnik

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


[sqlite] Handling multiple result sets in sqllite3_exec()

2012-02-14 Thread Marc L. Allen
If I call exec() with a series of SQL that returns multiple result sets, is 
there an easy way to determine that in the callback?  I could always compare 
column names, but that seems rather inefficient.

Thanks,

Marc

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


[sqlite] SQLite with Powershell

2012-02-14 Thread Ralf Jantschek
Hello,

not quite sure if this is the correct forum.
I've downloaded the SQLite Powershell Provider from psqlite.codeplex.com.

But I somehow can't get it to work properly.
I can import the module and "mount" a DB but when it comes to an ordinary
"select * from table" I'm stuck

In case this isn't the correct forum can somebody point me to a correct one.

Thanks a lot
Ralf

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


[sqlite] ANN: SQLite Data Sync 12.2 released

2012-02-14 Thread SQL Maestro Group

Hi!

SQL Maestro Group announces the release of SQLite Data Sync 12.2, a powerful 
and easy-to-use tool for SQLite database contents comparison and 
synchronization. The new version is immediately available for download at

http://www.sqlmaestro.com/products/sqlite/datasync/

Please note that before Feb 19 you can purchase SQLite Data Sync as well as 
all other our products and bundles with a 20% discount. Happy Valentine's 
Day!


Top 5 new features:


1. Comparison and synchronization of the data represented by database views.

2. Automatic checking of table and column mappings.

3. Filters to compare and synchronize only subsets of data.

4. Exporting comparison results to Excel, HTML, XML, and more.

5. Auto sorting of the target tables to avoid potential integrity 
violations.


Full press-release with explaining screenshots is available at:
http://www.sqlmaestro.com/news/company/datasyncs_updated_to_12_2/

Background information:
---
SQL Maestro Group offers complete database admin, development and management 
tools for MySQL, SQL Server, PostgreSQL, Oracle, DB2, SQLite, SQL Anywhere, 
Firebird and MaxDB providing the highest performance, scalability and 
reliability to meet the requirements of today's database applications.


Sincerely yours,
The SQL Maestro Group Team
http://www.sqlmaestro.com 


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