[sqlite] Banishment. Was: (no subject)

2012-06-27 Thread Richard Hipp
A quick policy reminder:  Emails such as the one below (don't click on the
link) result in immediate banishment from the mailing list.

I don't know if James Brison is a real person or the nom de guerre of some
robot.  In either event, don't let the same fate befall you - make sure
your computer is well-defended against malware.

On Wed, Jun 27, 2012 at 8:35 PM, James Brison  wrote:

> http://en.shijing*steel.com/pptlr.html
>
___
> 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


[sqlite] (no subject)

2012-06-27 Thread James Brison
http://en.shijingsteel.com/pptlr.html
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Not sure how to interrupt this

2012-06-27 Thread Jeff Archer
I am getting back SQLITE_DONE (101) from sqlite3_step() and the statement
is clearly being executed.

SQL: "INSERT INTO [Scans](ScanID, Timestamp, EndTime, Result) VALUES(NULL,
@Timestamp, @Timestamp, @Result);"

The table has been created as:
CREATE TABLE [Scans]
(ScanID  INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT
,Timestamp   DATETIME NOT NULL UNIQUE
,EndTime DATETIME NOT NULL DEFAULT CURRENT_TIME
,Result  VARCHAR
);
CREATE INDEX Scans_vwScan_Index on Scans(ScanID, Timestamp, EndTime,
Result);
CREATE INDEX Scans_Timestamp_Index on Scans(Timestamp);

I have SQLITE_CONFIG_LOG callback installed:
sqlite3_config(SQLITE_CONFIG_LOG, cb_sqlite_config_log, /*pUserData*/NULL);

I get the following message through the SQLITE_CONFIG_LOG callback during
the sqlite3_step():
errcode: SQLITE_SCHEMA  (17)
message: statement aborts at 80: [INSERT INTO [Scans](ScanID, Timestamp,
EndTime, Result) VALUES(NULL, @Timestamp, @Timestamp, @Result);] database
schema has changed

SQLITE_VERSION"3.7.13"  - amalgamation

Jeff Archer
Nanotronics Imaging
jsarc...@nanotronicsimaging.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] improvement to date/time documentation

2012-06-27 Thread Richard Hipp
On Wed, Jun 27, 2012 at 3:34 PM,  wrote:

>
> What is also confusing (and maybe is a feature request) is that the
> default JDBC format for the Xerial driver (at least) is to output a time as
> "2012-07-19 09:58:18.36" which doesn't [quite] match any of the internal
> formats.
>
> See this discussion: http://stackoverflow.com/a/11102689/179850
>

I suppose the document doesn't say that the ".SSS" suffix in formats 4, 7,
and 10 can actually hold any number of digits, not just 3.  So your string
above matches format 4.


>
> Thanks much for Sqlite!!
>
>
> --
> This message was sent from a MailNull anti-spam account.  You can get
> your free account and take control over your email by visiting the
> following URL.
>
>   http://mailnull.com/
> ___
> 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


[sqlite] improvement to date/time documentation

2012-06-27 Thread gray . sqlite
Sorry if this is the wrong place for this.  Just a quick comment that it would 
be good for the following documentation page about date functions to mention 
more specifically that the value of the fields need to be in one of the time 
formats:

http://www.sqlite.org/lang_datefunc.html

The 'Time Strings' are mentioned in the page later on but I did not initially 
realize that the data storied in the field that I was trying to use strftime on 
needed to be in one of those formats.  Maybe an example which shows data in a 
field would be good as well.  All of the examples at the bottom are using 
direct values instead of values stored in the database columns.

What is also confusing (and maybe is a feature request) is that the default 
JDBC format for the Xerial driver (at least) is to output a time as "2012-07-19 
09:58:18.36" which doesn't [quite] match any of the internal formats.

See this discussion: http://stackoverflow.com/a/11102689/179850

Thanks much for Sqlite!!


--
This message was sent from a MailNull anti-spam account.  You can get
your free account and take control over your email by visiting the
following URL.

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


Re: [sqlite] SQLite Encryption Extension Performance?

2012-06-27 Thread Richard Hipp
On Wed, Jun 27, 2012 at 2:55 PM, Paul Vercellotti wrote:

>
>
> Hi there,
>
> We are considering using the SQLite Encryption Extension in one of our
> products, and are wondering what the performance characteristics of it are?
>   Does the encryption algorithm affect performance?   Any stats on this you
> might have would be useful.
>

SEE is a drop-in replacement for public-domain SQLite.  In other words, it
will read and write ordinary unencrypted database files, and it will do so
with no speed penalty.  If you enable encryption, however, SQLite has to
run your chosen encryption algorithm whenever content is read from disk, or
written to disk.  Whether or not this effects performance, and by how much,
depends heavily on your application (how much it uses the database), which
encryption algorithm you choose, and on the relative speeds of CPU versus
I/O on your target platform.

Your worst-case performance hit is probably going to be about 50%.  In
other words, a query that used to take 100us would now take 150us with AES
128-bit encryption enabled, the extra fifty microseconds being time spend
running the encryption/decryption algorithms.  This worst case is for
queries that have to do actual disk I/O.  Queries out of SQLite's internal
cache use pre-decrypted content and do not slow down at all.  A typical
application will sometimes hit the cache and sometimes go to disk,
resulting in a performance hit somewhere in between.

For performance sensitive applications, what developers sometimes do is
break up their content into sensitive and non-sensitive, storing each in
separate databases, and only encrypt the sensitive content.  SEE is able to
open both databases at once (using the ATTACH command) and do joins on
tables between the two databases, even though only one of the two is
encrypted.



>
> Thanks!
>
> -Paul
> ___
> 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] SQLite Encryption Extension Performance?

2012-06-27 Thread Etienne
Hi Paul,

Are you speaking of CEROD?

FYI, I use to link sqlite3.c with the free wxSQLite3 encryption (AES128/256) 
module (http://wxcode.sourceforge.net/components/wxsqlite3).

I didn't notice any significant slowing down (3-4% max.), but of course there 
is no compression involved...

Hope this helps.

Regards,
Etienne


- Original message -
From: Paul Vercellotti 
To: General Discussion of SQLite Database 
Subject: [sqlite] SQLite Encryption Extension Performance?
Date: Wed, 27 Jun 2012 11:55:21 -0700 (PDT)

Hi there,

We are considering using the SQLite Encryption Extension in one of our 
products, and are wondering what the performance characteristics of it are?   
Does the encryption algorithm affect performance?   Any stats on this you might 
have would be useful.

Thanks!

-Paul
___
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] SQLite Encryption Extension Performance?

2012-06-27 Thread Paul Vercellotti


Hi there,

We are considering using the SQLite Encryption Extension in one of our 
products, and are wondering what the performance characteristics of it are?   
Does the encryption algorithm affect performance?   Any stats on this you might 
have would be useful.

Thanks!

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


Re: [sqlite] SQLite only supports TYPE_FORWARD_ONLY cursors

2012-06-27 Thread Kees Nuyt
On Wed, 27 Jun 2012 07:10:49 -0400, gizu tseng 
wrote:

> Hello,
> I am porting my Java applications from Oracle Lite to SQLite and
> getting those error message: “SQLite only supports TYPE_FORWARD_ONLY
> cursors”.
> I’d like to know if there is any (updated) SQLite JDBC driver that
> supports the TYPE_SCROLL_INSENSITIVE cursors?

As others already said and the message tries to tell, sqlite can only
step forward. JDBC can not change that.

For scolling a "viewport" over a table or view forwards and backwards,
have a look at this excellent article:

http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor


> Thanks you.

HTH


-- 
Regards,

Kees Nuyt

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


Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Black, Michael (IS)
And I should also add...sqlite doesn't respect timezones for past/future dates.



So...you may want to consider storing both UTC and localtime and then you can 
do whatever you want by selecting the appropriate field.  That way historical 
reports can be accurate with localtime.



Or you can store the UTC offset and just add it back in when you need it to do 
the same thing in a smaller data field.







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 Black, Michael (IS) [michael.bla...@ngc.com]
Sent: Wednesday, June 27, 2012 11:18 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] sqlite time is 2 hours to late

Kinda' depend on what exactly you want to do.

If you want your application to always use local time no matter where it's run:

select('now','localtime');

If you want to know how far off of UTC you are do this:

select round((julianday('now','localtime')-julianday('now'))*24);

In my case this returns -5 for Central Daylight Time.

If your case you should 2 hours.

If the time has any meaning across timezones where your applicaiton is run you 
should stick with UTC and perhaps just display local time to the users.
sqlite> select datetime('now');
2012-06-27 16:14:46
sqlite> create table t(mydate);
sqlite> insert into t values(datetime('now'));
sqlite> select datetime(mydate,'localtime') from t;
2012-06-27 11:17:13





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 deltagam...@gmx.net [deltagam...@gmx.net]
Sent: Wednesday, June 27, 2012 10:45 AM
To: j...@kreibi.ch; General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] sqlite time is 2 hours to late


Am 27.06.2012 17:40, schrieb Jay A. Kreibich:
>
> On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on 
> the wall:
>
>> Hello,
>>
>>> sqlite3 event.db "select datetime('now')";
>> gives me a time that is 2 hours too late ( 2012-06-27 15:33:13)
>> than my system time ( win 7 )  17::33:13
>>
>> How can this be fixed ?
>Move two timezones to the west.
>
>(By default all times and dates are UTC.)
>
> -j
>
>


I use this from within a c++ application
 char create_sql[] = "CREATE TABLE if not exists eventlog ("
 "id INTEGER PRIMARY KEY,"
 "eventdate DATETIME default current_timestamp,"
 "eventtype TEXT,"
 ")";

How do I get the right time in the the column eventdate ?
How to move timezones ?



___
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] sqlite time is 2 hours to late

2012-06-27 Thread Doug Nebeker
>  UTC is "the right time."  If you're doing anything with dates and
>  times I would STRONGLY recommend that all recorded times are in UTC.

Jay is right.  I've been bitten by storing local times before.  Even if your
users
are in the same time zone, that time zone shifts with day light savings.  It
was a 
painful lesson.  Always store times in UTC.

Doug


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


Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Black, Michael (IS)
Kinda' depend on what exactly you want to do.

If you want your application to always use local time no matter where it's run:

select('now','localtime');

If you want to know how far off of UTC you are do this:

select round((julianday('now','localtime')-julianday('now'))*24);

In my case this returns -5 for Central Daylight Time.

If your case you should 2 hours.

If the time has any meaning across timezones where your applicaiton is run you 
should stick with UTC and perhaps just display local time to the users.
sqlite> select datetime('now');
2012-06-27 16:14:46
sqlite> create table t(mydate);
sqlite> insert into t values(datetime('now'));
sqlite> select datetime(mydate,'localtime') from t;
2012-06-27 11:17:13





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 deltagam...@gmx.net [deltagam...@gmx.net]
Sent: Wednesday, June 27, 2012 10:45 AM
To: j...@kreibi.ch; General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] sqlite time is 2 hours to late


Am 27.06.2012 17:40, schrieb Jay A. Kreibich:
>
> On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on 
> the wall:
>
>> Hello,
>>
>>> sqlite3 event.db "select datetime('now')";
>> gives me a time that is 2 hours too late ( 2012-06-27 15:33:13)
>> than my system time ( win 7 )  17::33:13
>>
>> How can this be fixed ?
>Move two timezones to the west.
>
>(By default all times and dates are UTC.)
>
> -j
>
>


I use this from within a c++ application
 char create_sql[] = "CREATE TABLE if not exists eventlog ("
 "id INTEGER PRIMARY KEY,"
 "eventdate DATETIME default current_timestamp,"
 "eventtype TEXT,"
 ")";

How do I get the right time in the the column eventdate ?
How to move timezones ?



___
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] Example database with lots of "types"?

2012-06-27 Thread Simon Slavin

On 27 Jun 2012, at 5:00pm, Maury Markowitz  wrote:

> I'm working on getting the Mac version of the SQLite ODCB connector fully 
> functional. I'm having some problems getting examples of lots of different 
> data types - for instance, my northwind copy has a decimal stored as a 
> varchar.

Note that SQLite is somewhat weird in that you can declare a column as being of 
one type, but then put another type of variable in it.  Example below.

> Does anyone have a small test DB they would be willing to part with so I 
> could see lots of different data types and what happens when they come 
> through the adaptor?

Can I suggest you make up your own using the command-line shell ?  Then you can 
mess with it to your heart's content.  cd to a folder you want your database 
file in and use the commend-line shell supplied with OS X to create your own 
database.

cd ~/Desktop
sqlite3 testdb.sqlite
CREATE TABLE testTable (textVar TEXT, intVar INTEGER, realVar REAL);
INSERT INTO testTable VALUES ('this is text', 1, 1);
INSERT INTO testTable VALUES (2.2, 'and this is text two', 2.2);
SELECT * FROM testTable;
.quit

You should find a copy of the shell tool as '/usr/bin/sqlite3' which should be 
in your default path.  Apart from the very important '.quit', lots of 
documentation for it can be found at



If you need a more up-to-date version of the shell tool, perhaps because you 
want to use FOREIGN KEYS, you can download a precompiled Mac version from the 
SQLite download page.

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


Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Etienne
Fully agree with you, Jay.

-> SQLite NUL "select datetime('now','localtime');"

E.


On Wed, Jun 27, 2012, at 10:55, Jay A. Kreibich wrote:
> On Wed, Jun 27, 2012 at 05:45:41PM +0200, deltagam...@gmx.net scratched on 
> the wall:
> > Am 27.06.2012 17:40, schrieb Jay A. Kreibich:
> > >On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on 
> > >the wall:
> > >
> > >>Hello,
> > >>
> > >>>sqlite3 event.db "select datetime('now')";
> > >>gives me a time that is 2 hours too late ( 2012-06-27 15:33:13)
> > >>than my system time ( win 7 )  17::33:13
> > >>
> > >>How can this be fixed ?
> > >   Move two timezones to the west.
> > >
> > >   (By default all times and dates are UTC.)
> 
> 
> > I use this from within a c++ application
> > char create_sql[] = "CREATE TABLE if not exists eventlog ("
> > "id INTEGER PRIMARY KEY,"
> > "eventdate DATETIME default current_timestamp,"
> > "eventtype TEXT,"
> > ")";
> > 
> > How do I get the right time in the the column eventdate ?
> 
>   UTC is "the right time."  If you're doing anything with dates and
>   times I would STRONGLY recommend that all recorded times are in UTC.
>   Anything online and anything mobile tends to be used from different
>   timezones.
> 
>   As for converting to the local time for display purposes, see:
> 
>   http://sqlite.org/lang_datefunc.html
> 
>   In specific, the "localtime" modifier.
> 
> > How to move timezones ?
> 
>   Car, usually.
> 
> 
>-j
> 
> -- 
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
> 
> "Intelligence is like underwear: it is important that you have it,
>  but showing it to the wrong people has the tendency to make them
>  feel uncomfortable." -- Angela Johnson
> ___
> 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] Example database with lots of "types"?

2012-06-27 Thread Maury Markowitz
I'm working on getting the Mac version of the SQLite ODCB connector fully 
functional. I'm having some problems getting examples of lots of different data 
types - for instance, my northwind copy has a decimal stored as a varchar.

Does anyone have a small test DB they would be willing to part with so I could 
see lots of different data types and what happens when they come through the 
adaptor?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Jay A. Kreibich
On Wed, Jun 27, 2012 at 05:45:41PM +0200, deltagam...@gmx.net scratched on the 
wall:
> Am 27.06.2012 17:40, schrieb Jay A. Kreibich:
> >On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on 
> >the wall:
> >
> >>Hello,
> >>
> >>>sqlite3 event.db "select datetime('now')";
> >>gives me a time that is 2 hours too late ( 2012-06-27 15:33:13)
> >>than my system time ( win 7 )  17::33:13
> >>
> >>How can this be fixed ?
> >   Move two timezones to the west.
> >
> >   (By default all times and dates are UTC.)


> I use this from within a c++ application
> char create_sql[] = "CREATE TABLE if not exists eventlog ("
> "id INTEGER PRIMARY KEY,"
> "eventdate DATETIME default current_timestamp,"
> "eventtype TEXT,"
> ")";
> 
> How do I get the right time in the the column eventdate ?

  UTC is "the right time."  If you're doing anything with dates and
  times I would STRONGLY recommend that all recorded times are in UTC.
  Anything online and anything mobile tends to be used from different
  timezones.

  As for converting to the local time for display purposes, see:

  http://sqlite.org/lang_datefunc.html

  In specific, the "localtime" modifier.

> How to move timezones ?

  Car, usually.


   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread deltagam...@gmx.net

Am 27.06.2012 17:40, schrieb Jay A. Kreibich:


On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on the 
wall:


Hello,


sqlite3 event.db "select datetime('now')";

gives me a time that is 2 hours too late ( 2012-06-27 15:33:13)
than my system time ( win 7 )  17::33:13

How can this be fixed ?

   Move two timezones to the west.

   (By default all times and dates are UTC.)

-j





I use this from within a c++ application
char create_sql[] = "CREATE TABLE if not exists eventlog ("
"id INTEGER PRIMARY KEY,"
"eventdate DATETIME default current_timestamp,"
"eventtype TEXT,"
")";

How do I get the right time in the the column eventdate ?
How to move timezones ?



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


Re: [sqlite] sqlite time is 2 hours to late

2012-06-27 Thread Jay A. Kreibich


On Wed, Jun 27, 2012 at 05:37:55PM +0200, deltagam...@gmx.net scratched on the 
wall:

> Hello,
> 
> >sqlite3 event.db "select datetime('now')";
> gives me a time that is 2 hours too late ( 2012-06-27 15:33:13)
> than my system time ( win 7 )  17::33:13
> 
> How can this be fixed ?

  Move two timezones to the west.

  (By default all times and dates are UTC.)

   -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite time is 2 hours to late

2012-06-27 Thread deltagam...@gmx.net

Hello,

>sqlite3 event.db "select datetime('now')";
gives me a time that is 2 hours too late ( 2012-06-27 15:33:13)
than my system time ( win 7 )  17::33:13

How can this be fixed ?


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


Re: [sqlite] SQLite only supports TYPE_FORWARD_ONLY cursors

2012-06-27 Thread Keith Medcalf

> > gizu tseng  wrote:

> > I am porting my Java applications from Oracle Lite to SQLite and
> > getting those error message: "SQLite only supports TYPE_FORWARD_ONLY
> > cursors".
> > I'd like to know if there is any (updated) SQLite JDBC driver that
> > supports the TYPE_SCROLL_INSENSITIVE cursors?

Igor Tandetnik  replied:

> I doubt it. This is not a limitation of the drivers, but of SQLite itself.
> The only operation it supports on its equivalent of a cursor is "advance to
> next row".

SQLite does not actually have cursors.  Your program can emulate a cursor but 
the database engine will not help you much with that.  If you have SQLite in 
WAL and ran all your cursor emulation queries inside a single transaction, you 
would have cursor stability (that is, database changes on other connections 
would not be visible to your cursor operations running inside a single WAL 
transaction).  Without WAL, subsequent queries would see the database "as 
modified" and return results based on the database at the time the query was 
executed.

Many databases emulate cursors entirely on the client side (in the "driver" as 
it were).  Some databases provide cursor support on the server-side through 
temporary keyset or result tables.  Since SQLite does not actually have cursors 
(it has statements, which generate a step by step result set) you would have to 
emulate a cursor entirely within your application.

If your goal is to be able to emulate "cursor stability" (ie, a stable view of 
the database across multiple queries -- keeping in mind that SQLite does not 
actually have cursors) where you can run multiple queries that see the same 
database view irrespective of updates taking place on other connections, then 
you can use WAL.  When you BEGIN a wal transaction which contains only queries, 
you will get a stable view of the database until you commit (or rollback) that 
transaction.  Note that the default is to have "automatic transactions" around 
select statements, so the default is that each SELECT statement is itself 
stable.  To extend that across multiple selects on a connection, they must all 
occur within a single transaction.  That is, if all you do is selects, you can 
thing of BEGIN as meaning "begin select stability" and COMMIT as "end select 
stability" ...

http://www.sqlite.org/wal.html

---
()  ascii ribbon campaign against html e-mail
/\  www.asciiribbon.org




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


Re: [sqlite] SQLite only supports TYPE_FORWARD_ONLY cursors

2012-06-27 Thread Igor Tandetnik
gizu tseng  wrote:
> I am porting my Java applications from Oracle Lite to SQLite and
> getting those error message: “SQLite only supports TYPE_FORWARD_ONLY
> cursors”.
> I’d like to know if there is any (updated) SQLite JDBC driver that
> supports the TYPE_SCROLL_INSENSITIVE cursors?

I doubt it. This is not a limitation of the drivers, but of SQLite itself. The 
only operation it supports on its equivalent of a cursor is "advance to next 
row".
-- 
Igor Tandetnik

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


[sqlite] SQLite only supports TYPE_FORWARD_ONLY cursors

2012-06-27 Thread gizu tseng
Hello,
I am porting my Java applications from Oracle Lite to SQLite and
getting those error message: “SQLite only supports TYPE_FORWARD_ONLY
cursors”.
I’d like to know if there is any (updated) SQLite JDBC driver that
supports the TYPE_SCROLL_INSENSITIVE cursors?
Thanks you.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] I consider this a bug. Anyone else?

2012-06-27 Thread Chris Smith
When seeking additional pain along these lines, your attention is drawn to
sqlitejdbc.
I did get it to compile and pass its test suite; actually integrating it
with a project, not so much.

On Tue, Jun 26, 2012 at 5:39 PM, E. Timothy Uy  wrote:

> " 40-80 hours digging deep into how System.Data.SQLite.dll is built "
>
> Lol, I actually did this.
>
> On Tue, Jun 26, 2012 at 11:00 AM, Andrew Rondeau
> wrote:
>
> > The answer of "just add sqlite.c to your project" is great when you're
> > making something in C. The entire world does not use C, nor is C (or
> > C++) always the best option for a particular project.
> >
> > Timothy Uy's offer actually makes a lot of sense if you're using
> > something other then C or C++.
> >
> > For example, I just can't ship a .Net .exe that uses x-copy
> > deployment, and runs on Linux/Mac (via Mono) unless I invest about
> > 40-80 hours digging deep into how System.Data.SQLite.dll is built.
> >
> > On Tue, Jun 26, 2012 at 9:10 AM, Simon Slavin 
> > wrote:
> > >
> > > On 26 Jun 2012, at 4:55pm, bi...@aol.com wrote:
> > >
> > >> Thank you everyone who took the time to comment on my Windows DLL
> >  question.
> > >> I'm also glad I'm not the only one who sees the problem with not
>  having
> > >> the version in the resource block. This really would have helped when
> >  Chrome
> > >> and Firefox updated to a new version of SQLite and all my code stopped
> > >> working.
> > >
> > > This is the reason you will see so many posts here telling you to build
> > SQLite into your application instead of using a DLL.  Then you are not
> > subject to the choices of any other person with code on your users'
> > computers.  SQLite purposely issued a compact and simple amalgamation
> > version of the source code especially to make this fast and simple.
> > >
> > > 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
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>


-- 
History tells all of us that nobody gets a pass.  Your [country's]
perpetual existence is not guaranteed.  If you do not believe in yourself,
and believe that you're better than the alternative, and have the
educational skills to come to that empirical judgment, then there is no
reason for you to continue, and often you won't. --Victor Davis Hanson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] convert CString for statement

2012-06-27 Thread PA Newsgroups
If you are compiling for Unicode, your CString has a LPCWSTR (const
wchar_t*) operator.  In that case use sqlite3_bind_text16.  If you're not
using
Unicode, then there is a LPCSTR (const char*) operator that will let you use
sqlite3_bind_text directly like Alessandro shows.

Doug

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Alessandro Marzocchi
Sent: Wednesday, June 27, 2012 6:34 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] convert CString for statement

I have no way to test but i think a call like rc = sqlite3_bind_text(stmt,
1, (LPCTSTR)likeexp, -1,
SQLITE_TRANSIENT
);
would work

2012/6/26 deltagam...@gmx.net 

> Hello I have as input parameter
>
> CString likeexp
>
> but I think in the following statement  likeexp hast to be char []
>
> rc = sqlite3_bind_text(stmt, 1, likeexp, strlen(likeexp), NULL);
>
>
> How can i convert likeexp to fit the above statement ?
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users //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] convert CString for statement

2012-06-27 Thread Alessandro Marzocchi
I have no way to test but i think a call like
rc = sqlite3_bind_text(stmt, 1, (LPCTSTR)likeexp, -1,
SQLITE_TRANSIENT
);
would work

2012/6/26 deltagam...@gmx.net 

> Hello I have as input parameter
>
> CString likeexp
>
> but I think in the following statement  likeexp hast to be char []
>
> rc = sqlite3_bind_text(stmt, 1, likeexp, strlen(likeexp), NULL);
>
>
> How can i convert likeexp to fit the above statement ?
>
> __**_
> 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 SQLite from InputStream in Java as ReadOnly

2012-06-27 Thread Hector Guilarte
Hello everyone,

I'm new to SQLite as well as to this list. I'm writing because I was
planning on using SQLite for a personal -but public- project that I wanted
to make available through Google App Engine. It is basically a SQLite to
CSV converter and a SQLite to VCard converter. In other words, I have an
Address Book in a SQLite database and I wanted to export it to a well-known
format for importing it to some other places, as CSV and as VCard.

I already placed my question in StackOverflow.com last friday with no luck,
it has only been seen 21 times and the only answer I received was not
helpfull since it was telling me somehing like "first use something like
what you are trying to develop yourself and then use yours with their
output" (nahh, I'm kidding, but the real answer is not far from that and it
can be seen here:
http://stackoverflow.com/questions/11155537/load-sqlite-from-inputstream-in-java-as-readonly
)

If somebody has an answer, even if it is "It's not possible at all, so drop
it" and is a stackoverflow user, feel free to go ahead and answer over
there to earn the points, but please post your answer here as well. Now my
question as I wrote it in StackOverflow:

I have an App which receives a SQLite database to read some data and export
it as an CSV. I'm trying to upload it to Google App Engine but I faced a
huge problem which I think makes it impossible to use the GAE for this app.

The problem is that since on the GAE I can't write to the FileSystem, I
can't open the JDBC Connection to the SQLite file and therefore I can't
read the data to convert to CSV. I've been looking for other options such
as Google Cloud Storage, but I don't want to use my only "free trial" of it
on this application, and actually I don't want to have to pay ever for this
app after the Free Trial ends, so this is not an option.

After a lot of research, my only guess is that I might be able to load the
database straight from the InputStream as I received it from the upload
form I'm using to get it, however, this is a 100% lucky guess and I've not
been able to find anything about this approach online, but I just don't
want to believe it can't be done with any of the existing JDBC libraries to
SQLite and I'm hoping somebody here will tell me how to do it.

If the InputStream approach is not possible, but you know some other way to
open a SQLite DB in GAE to READ ONLY, and then dispose it, feel free to
comment as well...

If there is another option like "don't use JDBC, use a socket connection
with a pipe to open the connection with the InputStream", I'd also like to
hear that, it does not HAVE to be done with JDBC.

Thanks a lot,

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