Re: [sqlite] cidr data type

2008-04-21 Thread Florian Weimer
* Jay A. Kreibich:

   Yeah, I screwed that up.  I was too caught up on the other error.

   In the original function (-1  network_size) returns the wrong bit
   mask.  For example, 10.0.0.0/8 should return a netmask of 255.0.0.0,
   or 0xFF00.  The original function will return 255.255.255.0,
   which is a /24 mask.

   My mind was thinking you need to flip that, but did the wrong
   thing.  We're looking for (ip_addr  (~0  (32 - network_size))).

That's why it's called network_size and not prefix_length, I think.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-21 Thread Farzana

Thanks for your reply Igor.

We tried populating the listbox as mentioned in the URL.We are successful in
populating the listbox but when we go for scrolling the data, it takes more
time to move forward and backward since it has to execute the query
everytime. We are using a PocketPc so it is much slower. Is there any other
way to do this or can some one provide us a sample code for the same.
We are using a Table say Employees where we have to dsiplay their Job
Description in ascending order in a user defined listbox with scroll up and
scroll down buttons. Can anyone provide us a suggestion.
Thanks in Advance.

Regards,
Farzana



Igor Tandetnik wrote:
 
 Farzana [EMAIL PROTECTED]
 wrote in message news:[EMAIL PROTECTED]
 We are working in eVC++ environment with SQLite database.We need to
 populate the listbox with the values obtained by executing the query.
 We were able to get the values of the query by using the API's
 sqlite3_prepare and sqlite3_step.
 But we were able to populate and move the listbox in the downward
 direction only
 
 http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor
 
 Igor Tandetnik 
 
 
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 

-- 
View this message in context: 
http://www.nabble.com/Populating-and-scrolling-the-Listbox-using-query-tp16676178p16806114.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


Re: [sqlite] fetching and updating

2008-04-21 Thread Mike Johnston
I'm running the 3.5.7 version now.  My understanding was that if I have a 
prepared statement and currently using sqlite_step to walk through the results, 
the database was unable to commit a write.
In my case, I would be using the same connection.  Would you explain more?  
Also, what if same connection but different thread (assuming sqlite compiled 
with  multi-thread option turned on).

Many thanks

Igor Tandetnik [EMAIL PROTECTED] wrote: Mike Johnston 
wrote in message news:[EMAIL PROTECTED]
 I'm in a loop processing the result set using sqlite3_step. I need to
 insert/update the same sqlite database but a different table.  I
 can't get the write lock while I have this active statement I'm using
 sqlite3_step to move through.

With a recent enough SQLite version, you can run modification statements 
while a select statement is in progress. You have to do it on the same 
connection.

Igor Tandetnik



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


   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] fetching and updating

2008-04-21 Thread Igor Tandetnik
Mike Johnston [EMAIL PROTECTED]
wrote in message news:[EMAIL PROTECTED]
 I'm running the 3.5.7 version now.  My understanding was that if I
 have a prepared statement and currently using sqlite_step to walk
 through the results, the database was unable to commit a write.

You cannot commit a transaction, but you can make updates. They will be 
committed at the end of the transaction (possibly an implicit 
transaction started when SELECT statement was issued). The transaction 
is promoted from read-only to read-write under the usual rules.

 In my
 case, I would be using the same connection.  Would you explain more?

Which part?

 Also, what if same connection but different thread (assuming sqlite
 compiled with  multi-thread option turned on).

I'm not sure about that, but I suspect it will also work. Why don't you 
try it and see?

Igor Tandetnik



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


Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-21 Thread epankoke
Is it possible to store all of the needed data in memory?  If so, why not read 
the required information into an array and just update an index variable to 
keep track of where you are at in the array when the user clicks the up and 
down buttons?  That should be quite fast.

--
Eric Pankoke
Founder / Lead Developer
Point Of Light Software
http://www.polsoftware.com/

 -- Original message --
From: Farzana [EMAIL PROTECTED]
 
 Thanks for your reply Igor.
 
 We tried populating the listbox as mentioned in the URL.We are successful in
 populating the listbox but when we go for scrolling the data, it takes more
 time to move forward and backward since it has to execute the query
 everytime. We are using a PocketPc so it is much slower. Is there any other
 way to do this or can some one provide us a sample code for the same.
 We are using a Table say Employees where we have to dsiplay their Job
 Description in ascending order in a user defined listbox with scroll up and
 scroll down buttons. Can anyone provide us a suggestion.
 Thanks in Advance.
 
 Regards,
 Farzana
 
 
 
 Igor Tandetnik wrote:
  
  Farzana [EMAIL PROTECTED]
  wrote in message news:[EMAIL PROTECTED]
  We are working in eVC++ environment with SQLite database.We need to
  populate the listbox with the values obtained by executing the query.
  We were able to get the values of the query by using the API's
  sqlite3_prepare and sqlite3_step.
  But we were able to populate and move the listbox in the downward
  direction only
  
  http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor
  
  Igor Tandetnik 
  
  
  
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Populating-and-scrolling-the-Listbox-using-query-tp1667617
 8p16806114.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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] fetching and updating

2008-04-21 Thread Mike Johnston
OK, so that makes sense.   What I see happening is creation of a journal file 
when i do the update/insert/delete statement each of which return SQLITE_OK.  
However,  nothing is visible from an outside process (like sqlite3).  If  I 
understand you, this journal will be applied once the sqlite3_step finishes and 
I do the release on the prepared statement?

Is this correct?

Igor Tandetnik [EMAIL PROTECTED] wrote: Mike Johnston 
wrote in message news:[EMAIL PROTECTED]
 I'm running the 3.5.7 version now.  My understanding was that if I
 have a prepared statement and currently using sqlite_step to walk
 through the results, the database was unable to commit a write.

You cannot commit a transaction, but you can make updates. They will be 
committed at the end of the transaction (possibly an implicit 
transaction started when SELECT statement was issued). The transaction 
is promoted from read-only to read-write under the usual rules.

 In my
 case, I would be using the same connection.  Would you explain more?

Which part?

 Also, what if same connection but different thread (assuming sqlite
 compiled with  multi-thread option turned on).

I'm not sure about that, but I suspect it will also work. Why don't you 
try it and see?

Igor Tandetnik



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


   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] a suggestion to write tutorial for sqlite

2008-04-21 Thread Wilson, Ron P
Along these lines, also note that the quickstart (url below) still
shows the callback method instead of the v2 methods.  The last time
another programmer asked me for help, I referred him there and I was
shocked later at the code he produced.  Nice code, but you could have
done the same thing a lot easier with the v2 methods.  The v2
methods?  Yeah.  But this is SQlite3.  Why would I use v2 methods?

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

Ron Wilson, S/W Systems Engineer III, Tyco Electronics, 434.455.6453
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] a suggestion to write tutorial for sqlite

2008-04-21 Thread D. Richard Hipp
FWIW, I'll be happy to give write access to the documentation
repository (http://www.sqlite.org/docsrc/) and even a
prestigious sqlite.org email alias to anybody who is
willing to step up and make some improvements and
updates to the current documentation.

D. Richard Hipp
[EMAIL PROTECTED]



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


Re: [sqlite] a suggestion to write tutorial for sqlite

2008-04-21 Thread Toby Roworth


D. Richard Hipp wrote:
 FWIW, I'll be happy to give write access to the documentation
 repository (http://www.sqlite.org/docsrc/) and even a
 prestigious sqlite.org email alias to anybody who is
 willing to step up and make some improvements and
 updates to the current documentation.

 D. Richard Hipp
 [EMAIL PROTECTED]


   
As I haven't been using SQLite for very long, although I can't write the 
documentation, I'm happy to read through drafts and give pointers to 
what might need to be changed - I'm probably still at the stage where I 
need to read something like this, so I could quite happily be a test 
candidate if it helps.
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


   

-- 

Sent by Toby Roworth ([EMAIL PROTECTED])
This message is intended for the named reciepients only, and should not 
be forwarded without permission
The conents of this message may be ©Toby Roworth


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


Re: [sqlite] fetching and updating

2008-04-21 Thread Igor Tandetnik
Mike Johnston [EMAIL PROTECTED]
wrote:
 OK, so that makes sense.   What I see happening is creation of a
 journal file when i do the update/insert/delete statement each of
 which return SQLITE_OK.  However,  nothing is visible from an outside
 process (like sqlite3).  If  I understand you, this journal will be
 applied once the sqlite3_step finishes and I do the release on the
 prepared statement?

 Is this correct?

Yes, I believe so.

Igor Tandetnik 



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


Re: [sqlite] SQLITE_OMIT_xxx

2008-04-21 Thread Dennis Cote
Richard Klein wrote:
 In order to reduce SQLite's memory footprint in my embedded
 application, I want to use the SQLITE_OMIT_xxx options to
 remove unneeded features from SQLite.
 
 Using Cygwin running on Windows, I have successfully down-
 loaded the canonical sources and autoconfigured the Makefile.
 
 The Makefile seems to indicate that in order to generate
 the parser, opcodes, and keyword hash function so that they
 omit the unneeded features, I need only add the following
 line to the Makefile:
 
 OPTS = -DSQLITE_OMIT_xxx -DSQLITE_OMIT_yyy ...
 
 Is this correct?
 

I believe so, but I haven't ever used the OMIT options when building SQLite.

Are you having a problem when you do this?

Dennis Cote

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


Re: [sqlite] SQLITE_OMIT_xxx

2008-04-21 Thread Richard Klein
 Richard Klein wrote:
 In order to reduce SQLite's memory footprint in my embedded
 application, I want to use the SQLITE_OMIT_xxx options to
 remove unneeded features from SQLite.

 Using Cygwin running on Windows, I have successfully down-
 loaded the canonical sources and autoconfigured the Makefile.

 The Makefile seems to indicate that in order to generate
 the parser, opcodes, and keyword hash function so that they
 omit the unneeded features, I need only add the following
 line to the Makefile:

 OPTS = -DSQLITE_OMIT_xxx -DSQLITE_OMIT_yyy ...

 Is this correct?

 
 I believe so, but I haven't ever used the OMIT options when building SQLite.
 
 Are you having a problem when you do this?
 
 Dennis Cote
 
I haven't tried it yet ... I'll let you know if I have any
problems.  Thanks!

- Richard

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


[sqlite] blob api

2008-04-21 Thread Robert Bielik
Hi all,

I'm using the sqlite3_blob_* api to write a larger text stream incrementally. 
Works a charm, but is there a way to
change the datatype of the blob to text afterwards ? I'd like to see the text 
easily in f.i. SQLiteSpy.

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


[sqlite] Update in one process and Select in another (dumb question??)

2008-04-21 Thread jkimble


I've got two processes running. Each has it's own instance of the database
open. When I update the database from process 1 the select on that data
from process 2 doesn't see the change.

Of course if I close and re-open I see the change but surely that's not
how this has to work.

I'm reading an SPI bus for my data and updating a table that is then read
and the updated data is displayed on a GUI (different processes).

What am I doing wrong here? Tried to do a commit but that doesn't seem to
work either.

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


Re: [sqlite] SQLITE_OMIT_xxx

2008-04-21 Thread Mark Spiegel
That's what I do.  Once your makefile is set up, make the sqlite3.c 
target if you want an amalgamated source file.  Be sure to carefully 
coordinate the defined values between the preprocessing step (to 
generate your source file(s)) and the build of your application/dll. 

If you are using amalgamated source, you may find a few other small 
problems when building your app, but they are easy to fix.

Richard Klein wrote:
 Richard Klein wrote:
 
 In order to reduce SQLite's memory footprint in my embedded
 application, I want to use the SQLITE_OMIT_xxx options to
 remove unneeded features from SQLite.

 Using Cygwin running on Windows, I have successfully down-
 loaded the canonical sources and autoconfigured the Makefile.

 The Makefile seems to indicate that in order to generate
 the parser, opcodes, and keyword hash function so that they
 omit the unneeded features, I need only add the following
 line to the Makefile:

 OPTS = -DSQLITE_OMIT_xxx -DSQLITE_OMIT_yyy ...

 Is this correct?

   
 I believe so, but I haven't ever used the OMIT options when building SQLite.

 Are you having a problem when you do this?

 Dennis Cote

 
 I haven't tried it yet ... I'll let you know if I have any
 problems.  Thanks!

 - Richard

 ___
 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] multiple writers for in-memory datastore

2008-04-21 Thread Scott Hess
If you create a file on disk and set PRAGMA synchronous = OFF, you
should get pretty close to the performance of a shared in-memory
database on most modern desktop operating systems - maybe close enough
that you won't care to do anything beyond that.  If you further look
at the recent discussion/patch to disable journaling entirely, you
should get even closer.  Going this route means you won't have to
worry so much about the case where someone accidentally pumps 4 gig of
data into your database and sucks up all RAM.

Keep in mind that if you do these things, then it is quite trivial to
generate corrupt database files if your app or OS crashes.  So you
need to arrange to delete database files on app start-up to reset your
state (an in-memory database wouldn't have that problem!).  On a
Unix-based system, you may be able to open the database then delete
the underlying path, but that may not work for however you are sharing
things.

-scott


On Fri, Apr 18, 2008 at 11:25 AM, James Gregurich [EMAIL PROTECTED] wrote:


 I'm working on a commercial, boxed, desktop product. I can't be
 creating new mounted disks on a customer's system every time he uses
 my application.



 How about this...


 suppose I create a temporary db file on disk. Each task ( a thread)
 opens a connection to the temp file and attaches an in-memory db to
 it. The task then writes to tables in the attached in-memory db. When
 the task is done, the tables in the in-memory db are merged into the
 disk file and the attached in-memory db is closed. reader connections
 would only read from the disk file.

 Will such a design give me full concurrency on my writer tasks until
 they are ready to flush their results to the disk file? As I
 understand it, the attached db won't be locked by reading done on the
 disk file.


 thanks,
 James



 On Apr 18, 2008, at 10:33 :39AM, Dennis Cote wrote:

 James Gregurich wrote:
 If the sqlite statement had a temporary storage area so that I could
 load up a bunch of rows and then commit them in one shot so that the
 lock on the db was not held very long by a single transaction, that
 would probably work.


 Using a RAM disk you could insert rows into one database as they are
 generated. This would be your batch.

 Then periodically attach that database to the main database and copy
 all
 the new rows to the main DB table in one in a auto transaction.

 attach batch.db as batch;
 begin;
 insert into main.tbl select * from batch.tbl;
 delete from batch.tbl;
 commit;
 detach batch;

 This will only lock the main database for a short period while it is
 updated.

 However, my reading of the documentation leads me to believe that
 using the bind functions in a loop with an insert statement will lock
 the entire in-memory DB until the bulk insert is donewhich
 means I
 would get no benefit from concurrency.

 Is this correct?

 Readers are blocked by a writer until the write transaction is
 committed.


 BTW: does the question I posed on modifying the library to add a
 feature to attach  an in-memory data stores to another one via the C
 API belong on the sqlite-dev list?


 That list doesn't get much traffic. Your question was fine here.

 It would be fairly involved to change the handling of in memory
 databases. They don't have names to use with the attach command, and
 they don't do any locking since they can only be accessed from a
 single
 connection currently. The locking in SQLite is done with POSIX file
 locks which can't be used for in memory databases since they aren't
 files. You're welcome to try of course, but it seems like a lot of
 work
 for little return when there are other ways to do what you want.

 HTH
 Dennis Cote


 ___
 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_OMIT_xxx

2008-04-21 Thread Richard Klein
Thanks, Mark!

I use the individual source files rather than the amalgamation,
for several reasons:

(1) Visual Studio has trouble generating line number info for
files that have more than 64K lines.

(2) Perforce (our version control software) has trouble diff'ing
two versions of a large file.

(3) We build SQLite for many different target platforms, using
various C and C++ compilers.  We get many (i.e. hundreds) of
warnings, and even some errors.  When fixing these problems,
it is simply easier to edit many smaller files rather than one
huge, unwieldy file.

- Richard

Mark Spiegel wrote:
 That's what I do.  Once your makefile is set up, make the sqlite3.c 
 target if you want an amalgamated source file.  Be sure to carefully 
 coordinate the defined values between the preprocessing step (to 
 generate your source file(s)) and the build of your application/dll. 
 
 If you are using amalgamated source, you may find a few other small 
 problems when building your app, but they are easy to fix.
 
 Richard Klein wrote:
 Richard Klein wrote:
 
 In order to reduce SQLite's memory footprint in my embedded
 application, I want to use the SQLITE_OMIT_xxx options to
 remove unneeded features from SQLite.

 Using Cygwin running on Windows, I have successfully down-
 loaded the canonical sources and autoconfigured the Makefile.

 The Makefile seems to indicate that in order to generate
 the parser, opcodes, and keyword hash function so that they
 omit the unneeded features, I need only add the following
 line to the Makefile:

 OPTS = -DSQLITE_OMIT_xxx -DSQLITE_OMIT_yyy ...

 Is this correct?

   
 I believe so, but I haven't ever used the OMIT options when building SQLite.

 Are you having a problem when you do this?

 Dennis Cote

 
 I haven't tried it yet ... I'll let you know if I have any
 problems.  Thanks!

 - Richard

 ___
 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] String is changing after inserting into database

2008-04-21 Thread Scott Hess
My experience is that this kind of problem tends towards a he-said,
she-said type of thing, and what happens in the end is that everyone
is correct from their perspective, but there was some little bit of
non-obvious thing that made one party's understanding of the encoding
slightly different from the other party's.  For whatever reason, UTF
encoding seems to suffer badly from Murphy's Law :-).  Been there,
done that.

I think the best solution would be to post a self-contained
replication of the problem, rather than a description of what you're
doing.  A main() in a .c file would probably be the best way, but it's
possible that a shell script (calling sqlite3) or a TCL script (using
tclsqlite3) would also be adequate.  In my experience, either you'll
find that you can't replicate it in a standalone .c file (which is a
valuable hint of ... something), or you'll find that other people
don't have the same problem (also a valuable hint), or someone will
suggest a one-line change which totally fixes it.

-scott


On Thu, Apr 17, 2008 at 11:37 PM, Harish Dixit [EMAIL PROTECTED] wrote:
 Hello,

 I am inserting some unicode string into the SQLite database. After
 inserting, at the time of retrieving value has been modified.

 For example:

 I am inserting 즒铭ꓽ菷\큭셙냼誜\꾁霤꿩뱪낌.wma
 when i am retrieving it the value is :  馒铭ꓽ菷\큭셙냼誜\꾁霤꿩뱪낌.wma


 It seems that the problem is related to the some symbols having ASCII value
 between these ranges:

 1.56320 - 57343
 2.55296 - 56319


 I debugged and found that, upto the point where we call sqlite3_step ()
 method value goes correctly, but it changed after inserting into the
 database.


 Please help me regarding this issue.

 Thannks in advance.
 ___
 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] Update in one process and Select in another (dumb question??)

2008-04-21 Thread Dennis Cote
[EMAIL PROTECTED] wrote:
 
 I've got two processes running. Each has it's own instance of the database
 open. When I update the database from process 1 the select on that data
 from process 2 doesn't see the change.
 
 Of course if I close and re-open I see the change but surely that's not
 how this has to work.
 

No, that isn't necessary.

 I'm reading an SPI bus for my data and updating a table that is then read
 and the updated data is displayed on a GUI (different processes).
 
 What am I doing wrong here? Tried to do a commit but that doesn't seem to
 work either.
 

If you post the code you are using to read and write the database 
someone will be able to help you straighten this out.

Dennis Cote

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


Re: [sqlite] blob api

2008-04-21 Thread D. Richard Hipp

On Apr 21, 2008, at 3:10 PM, Robert Bielik wrote:

 Hi all,

 I'm using the sqlite3_blob_* api to write a larger text stream  
 incrementally. Works a charm, but is there a way to
 change the datatype of the blob to text afterwards ? I'd like to see  
 the text easily in f.i. SQLiteSpy.


Perhaps:  SELECT CAST(b AS TEXT) FROM table

Really I suppose it depends on what SQLiteSpy is using to
determine that the column type is BLOB.  If you can subversion
that mechanism into thinking the column type is TEXT, then
it should just work.

D. Richard Hipp
[EMAIL PROTECTED]



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


Re: [sqlite] multiple writers for in-memory datastore

2008-04-21 Thread James Gregurich

interesting. thanks for the tip.

Ill give it some consideration.

-James


On Apr 21, 2008, at 1:07 :50PM, Scott Hess wrote:

 If you create a file on disk and set PRAGMA synchronous = OFF, you
 should get pretty close to the performance of a shared in-memory
 database on most modern desktop operating systems - maybe close enough
 that you won't care to do anything beyond that.  If you further look
 at the recent discussion/patch to disable journaling entirely, you
 should get even closer.  Going this route means you won't have to
 worry so much about the case where someone accidentally pumps 4 gig of
 data into your database and sucks up all RAM.

 Keep in mind that if you do these things, then it is quite trivial to
 generate corrupt database files if your app or OS crashes.  So you
 need to arrange to delete database files on app start-up to reset your
 state (an in-memory database wouldn't have that problem!).  On a
 Unix-based system, you may be able to open the database then delete
 the underlying path, but that may not work for however you are sharing
 things.

 -scott

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


Re: [sqlite] SQLITE_OMIT_xxx

2008-04-21 Thread D. Richard Hipp

On Apr 21, 2008, at 4:25 PM, Richard Klein wrote:

 Thanks, Mark!

 I use the individual source files rather than the amalgamation,
 for several reasons:

To generate individual source files run

 make target_source



 (1) Visual Studio has trouble generating line number info for
 files that have more than 64K lines.

Report this bug to Microsoft.



 (2) Perforce (our version control software) has trouble diff'ing
 two versions of a large file.

I had similar problems when I was working on the diff-er
in fossil (http://www.fossil-scm.org/)  but I eventually overcame
them.  Suggest you report the problem to Perforce.  They are
welcomed to use my (GPLed) fossil code :-)

 (3) We build SQLite for many different target platforms, using
 various C and C++ compilers.  We get many (i.e. hundreds) of
 warnings, and even some errors.  When fixing these problems,
 it is simply easier to edit many smaller files rather than one
 huge, unwieldy file.

As for warnings, see http://www.sqlite.org/faq.html#q17
SQLite is ANSI-C code, not C++ so if you try to compile
it with a C++ compiler you might well get errors.  I suggest
you use a C compiler instead.  Surely Visual Studio must
include a C compiler.

D. Richard Hipp
[EMAIL PROTECTED]



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


Re: [sqlite] SQLITE_OMIT_xxx

2008-04-21 Thread Mark Spiegel
Understood.  I use the amalgamated source for maximum performance.

Re 1: Look at Source Insight for editing.  The only dig I have at it is 
that it won't let me split a window into the same source file like the 
VC editor will.  Since I do all my building with command line tools, I 
don't need the build environment in VC.

Re 2: Look at using Araxis Merge instead of the Perforce dif tool.

Richard Klein wrote:
 Thanks, Mark!

 I use the individual source files rather than the amalgamation,
 for several reasons:

 (1) Visual Studio has trouble generating line number info for
 files that have more than 64K lines.

 (2) Perforce (our version control software) has trouble diff'ing
 two versions of a large file.

 (3) We build SQLite for many different target platforms, using
 various C and C++ compilers.  We get many (i.e. hundreds) of
 warnings, and even some errors.  When fixing these problems,
 it is simply easier to edit many smaller files rather than one
 huge, unwieldy file.

 - Richard

 Mark Spiegel wrote:
   
 That's what I do.  Once your makefile is set up, make the sqlite3.c 
 target if you want an amalgamated source file.  Be sure to carefully 
 coordinate the defined values between the preprocessing step (to 
 generate your source file(s)) and the build of your application/dll. 

 If you are using amalgamated source, you may find a few other small 
 problems when building your app, but they are easy to fix.

 Richard Klein wrote:
 
 Richard Klein wrote:
 
 
 In order to reduce SQLite's memory footprint in my embedded
 application, I want to use the SQLITE_OMIT_xxx options to
 remove unneeded features from SQLite.

 Using Cygwin running on Windows, I have successfully down-
 loaded the canonical sources and autoconfigured the Makefile.

 The Makefile seems to indicate that in order to generate
 the parser, opcodes, and keyword hash function so that they
 omit the unneeded features, I need only add the following
 line to the Makefile:

 OPTS = -DSQLITE_OMIT_xxx -DSQLITE_OMIT_yyy ...

 Is this correct?

   
   
 I believe so, but I haven't ever used the OMIT options when building 
 SQLite.

 Are you having a problem when you do this?

 Dennis Cote

 
 
 I haven't tried it yet ... I'll let you know if I have any
 problems.  Thanks!

 - Richard

 ___
 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

   

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


Re: [sqlite] a suggestion to write tutorial for sqlite

2008-04-21 Thread P Kishor
On 4/21/08, D. Richard Hipp [EMAIL PROTECTED] wrote:
 FWIW, I'll be happy to give write access to the documentation
  repository (http://www.sqlite.org/docsrc/) and even a
  prestigious sqlite.org email alias to anybody who is
  willing to step up and make some improvements and
  updates to the current documentation.


 my kingdom for a sqlite.org email alias.


For starters, a database of every single email from Igor and Dennis
Cote should be mandatory reading for anyone wanting to do anything
with SQLite.





  D. Richard Hipp
  [EMAIL PROTECTED]






-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] trigger and attached db

2008-04-21 Thread Federico Granata
Hi, I'm trying to create in the main db a trigger on after insert on
ATTACHED_DB.TABLE but I get an error
SQL error: trigger TEST_TRIGGER cannot reference objects in database
ATTACHED_DB

Can I obtain TABLE_1 in the attached db and TABLE_2 and TRIGGER (who read
from TABLE_1 and write to TABLE_2) in the main db ?

Tanks a lot and sorry for my bad english.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] trigger and attached db

2008-04-21 Thread Scott Hess
You cannot create a trigger which crosses between databases because
the system cannot know that the database will be attached when the
trigger fires.  Triggers are part of the consistency guarantee, so
this is bad.

It would be interesting to have something like CREATE TEMPORARY
TRIGGER ...  which would only exist so long as the referenced
databases we attached.  Then you could just create your temporary
triggers in the same code which attaches your databases.  Likewise for
views, perhaps.

-scott




On Mon, Apr 21, 2008 at 2:41 PM, Federico Granata
[EMAIL PROTECTED] wrote:
 Hi, I'm trying to create in the main db a trigger on after insert on
 ATTACHED_DB.TABLE but I get an error
 SQL error: trigger TEST_TRIGGER cannot reference objects in database
 ATTACHED_DB

 Can I obtain TABLE_1 in the attached db and TABLE_2 and TRIGGER (who read
 from TABLE_1 and write to TABLE_2) in the main db ?

 Tanks a lot and sorry for my bad english.
 ___
 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 suggestion to write tutorial for sqlite

2008-04-21 Thread Mike McGonagle
For what it is worth, while I had done a few simple things in MySQL prior to
using SQLite, I think it would be nice if there were a couple of different
tracks of tutorials. Maybe they could be one for the Novice, one for an
Experienced user, and then one for those that are doing actual C
development using SQLite.
The first two catagories would be limited to using only SQL, where the
Novice track might provide some simple tutorials on database design (yes, I
know there are so many other out there, and they could be referenced, too,
but I think it would be a good thing to have a completely self-contained way
to learn SQLite). The Experienced track might get into topics that are a bit
more higher level SQL stuff, like triggers, indexing, transactions, etc.
Also, both of these track might stick to using the Commandline version of
SQLite.

This way, different users can start one whatever tutorials that their level
of experience demands.

Just another 2cent opinion.

Mike


On Sat, Apr 19, 2008 at 11:37 AM, mikeobe [EMAIL PROTECTED] wrote:

 i found it boring to learn how to use sqlite, maybe we can write a
 tutorial for it, with examples,
 it will be much easier for the beginner to start with sqlite.

 2008-04-19
 mikeobe


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




-- 
Peace may sound simple—one beautiful word— but it requires everything we
have, every quality, every strength, every dream, every high ideal.
—Yehudi Menuhin (1916–1999), musician
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Problems with SQLITE_OMIT_xxx

2008-04-21 Thread Richard Klein
I regenerated and recompiled the source files
specifying that the following features (among
others) are to be omitted:

SQLITE_OMIT_REINDEX
SQLITE_OMIT_VIEW
SQLITE_OMIT_VIRTUALTABLE

Nevertheless, I am getting the following link
errors:

delete.obj : error LNK2019: unresolved external symbol _sqlite3MaterializeView 
referenced in function _sqlite3DeleteFrom
update.obj : error LNK2019: unresolved external symbol _sqlite3MaterializeView 
referenced in function _sqlite3Update
parse.obj  : error LNK2019: unresolved external symbol _sqlite3VtabArgExtend 
referenced in function _yy_reduce
parse.obj  : error LNK2019: unresolved external symbol _sqlite3VtabArgInit 
referenced in function _yy_reduce
parse.obj  : error LNK2019: unresolved external symbol _sqlite3VtabBeginParse 
referenced in function _yy_reduce
parse.obj  : error LNK2019: unresolved external symbol _sqlite3VtabFinishParse 
referenced in function _yy_reduce
parse.obj  : error LNK2019: unresolved external symbol _sqlite3Reindex 
referenced in function _yy_reduce
parse.obj  : error LNK2019: unresolved external symbol _sqlite3CreateView 
referenced in function _yy_reduce

Are there any workarounds for these, or will
I have to remove the above OMIT options?

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


Re: [sqlite] Problems with SQLITE_OMIT_xxx

2008-04-21 Thread D. Richard Hipp

On Apr 21, 2008, at 9:03 PM, Richard Klein wrote:
 I regenerated and recompiled the source files
 specifying that the following features (among
 others) are to be omitted:

 SQLITE_OMIT_REINDEX
 SQLITE_OMIT_VIEW
 SQLITE_OMIT_VIRTUALTABLE

It worked OK when I tried this combination.  Are
you *sure* you set these options when you ran
make target_source?  Are you certain that you
are using the correct set of source files?



 Nevertheless, I am getting the following link
 errors:

 delete.obj : error LNK2019: unresolved external symbol  
 _sqlite3MaterializeView referenced in function _sqlite3DeleteFrom
 update.obj : error LNK2019: unresolved external symbol  
 _sqlite3MaterializeView referenced in function _sqlite3Update
 parse.obj  : error LNK2019: unresolved external symbol  
 _sqlite3VtabArgExtend referenced in function _yy_reduce
 parse.obj  : error LNK2019: unresolved external symbol  
 _sqlite3VtabArgInit referenced in function _yy_reduce
 parse.obj  : error LNK2019: unresolved external symbol  
 _sqlite3VtabBeginParse referenced in function _yy_reduce
 parse.obj  : error LNK2019: unresolved external symbol  
 _sqlite3VtabFinishParse referenced in function _yy_reduce
 parse.obj  : error LNK2019: unresolved external symbol  
 _sqlite3Reindex referenced in function _yy_reduce
 parse.obj  : error LNK2019: unresolved external symbol  
 _sqlite3CreateView referenced in function _yy_reduce

 Are there any workarounds for these, or will
 I have to remove the above OMIT options?

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


D. Richard Hipp
[EMAIL PROTECTED]



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


[sqlite] A concurrency question

2008-04-21 Thread Gaurav Mathur
Hi All,

I would appreciate help with the following scenario.

Suppose I have the following schema:

CREATE TABLE t1
(
f1 integer,
f2 text
);

CREATE TABLE t2
(
val integer
);

Suppose the following inserts statement are executed by two processes
over the above schema.

insert into t1 values ((SELECT val FROM t2 WHERE ROWID=1), aa);
UPDATE t2 SET  val = val + 1 WHERE ROWID=1;

The idea is to use the value 'val' from the table t2 and set the value
of f1 to that value on an insert. The question I have is whether I can
rely on the above sequence of SQL to reliably generate *unique* f2
values for all INSERTs. If it's a single threaded system then the
above surely works. But if I am in a multi(threaded/process) system,
then there is a problem. Basically, I am not sure whether there is a
possibility that a thread/process can be preempted after executing the
SELECT but before executing the INSERT in that thread/process. If it's
possible then I have a problem and I will have to start looking at
wrapping the above in explicit SQLITE transactions.

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


Re: [sqlite] Problems with SQLITE_OMIT_xxx

2008-04-21 Thread Richard Klein
D. Richard Hipp wrote:
 On Apr 21, 2008, at 9:03 PM, Richard Klein wrote:
 I regenerated and recompiled the source files
 specifying that the following features (among
 others) are to be omitted:

 SQLITE_OMIT_REINDEX
 SQLITE_OMIT_VIEW
 SQLITE_OMIT_VIRTUALTABLE
 
 It worked OK when I tried this combination.  Are
 you *sure* you set these options when you ran
 make target_source?  Are you certain that you
 are using the correct set of source files?

My bad.  In the Makefile, I broke up OPTS using a
backslash at the end of each line.  Of course, this
means that 'make' will ignore everything after the
first '#' that it encounters.

So my Makefile OPTS and my compilation OPTS are out
of sync.

As you can see from my OPTS definition, 'make' never
even saw the OMITs of REINDEX, VIEW, and VIRTUALTABLE.

It's amazing that I got as few link errors as I did!

Sorry about that,
- Richard

--

OPTS = -DSQLITE_DISABLE_LFS \
-DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_ANALYZE\
-DSQLITE_OMIT_ATTACH \
-DSQLITE_OMIT_AUTHORIZATION  \
-DSQLITE_OMIT_AUTOVACUUM \
-DSQLITE_OMIT_AUTOINCREMENT  \
-DSQLITE_OMIT_BETWEEN_OPTIMIZATION   \
-DSQLITE_OMIT_BLOB_LITERAL   \
-DSQLITE_OMIT_CAST   \
-DSQLITE_OMIT_CHECK  \
-DSQLITE_OMIT_COMPLETE   \
-DSQLITE_OMIT_COMPOUND_SELECT\
-DSQLITE_OMIT_CONFLICT_CLAUSE\
-DSQLITE_OMIT_DATETIME_FUNCS \
-DSQLITE_OMIT_EXPLAIN\
-DSQLITE_OMIT_FAULTINJECTOR  \
-DSQLITE_OMIT_FLAG_PRAGMAS   \
-DSQLITE_OMIT_FLOATING_POINT \
-DSQLITE_OMIT_FOREIGN_KEY\
-DSQLITE_OMIT_GET_TABLE  \
-DSQLITE_OMIT_GLOBALRECOVER  \
-DSQLITE_OMIT_INCRBLOB   \
#  -DSQLITE_OMIT_INTEGRITY_CHECK\
-DSQLITE_OMIT_LIKE_OPTIMIZATION  \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_MEMORYDB   \
-DSQLITE_OMIT_PAGER_PRAGMAS  \
#  -DSQLITE_OMIT_PARSER \
#  -DSQLITE_OMIT_PRAGMA \
-DSQLITE_OMIT_PROGRESS_CALLBACK  \
-DSQLITE_OMIT_QUICKBALANCE   \
-DSQLITE_OMIT_REINDEX\
-DSQLITE_OMIT_SCHEMA_PRAGMAS \
#  -DSQLITE_OMIT_SCHEMA_VERSION_PRAGMAS \
-DSQLITE_OMIT_SHARED_CACHE   \
-DSQLITE_OMIT_SUBQUERY   \
-DSQLITE_OMIT_TCL_VARIABLE   \
-DSQLITE_OMIT_TEMPDB \
-DSQLITE_OMIT_TRACE  \
#  -DSQLITE_OMIT_TRIGGER\
-DSQLITE_OMIT_UTF16  \
-DSQLITE_OMIT_VACUUM \
-DSQLITE_OMIT_VIEW   \
-DSQLITE_OMIT_VIRTUALTABLE   \
-DSQLITE_OMIT_XFER_OPT

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


Re: [sqlite] A concurrency question

2008-04-21 Thread Igor Tandetnik
Gaurav Mathur [EMAIL PROTECTED]
wrote in message
news:[EMAIL PROTECTED]
 Suppose I have the following schema:

 CREATE TABLE t1
 (
 f1 integer,
 f2 text
 );

 CREATE TABLE t2
 (
 val integer
 );

 Suppose the following inserts statement are executed by two processes
 over the above schema.

 insert into t1 values ((SELECT val FROM t2 WHERE ROWID=1), aa);
 UPDATE t2 SET  val = val + 1 WHERE ROWID=1;

 The idea is to use the value 'val' from the table t2 and set the value
 of f1 to that value on an insert. The question I have is whether I can
 rely on the above sequence of SQL to reliably generate *unique* f2
 values for all INSERTs.

Why not just use ROWID as a unique identifier?

 Basically, I am not sure whether there is a
 possibility that a thread/process can be preempted after executing the
 SELECT but before executing the INSERT in that thread/process.

No. An implicit transaction is created for each statement. What is 
possible is for another thread to squeeze a statement between your 
insert and update. To prevent that, surround the two statements with an 
explicit transaction.

Igor Tandetnik



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


Re: [sqlite] A concurrency question

2008-04-21 Thread Gaurav Mathur
Many thanks for your response Igor. Please see response and additional query
inline.

On Mon, Apr 21, 2008 at 7:40 PM, Igor Tandetnik [EMAIL PROTECTED] wrote:

 Gaurav Mathur [EMAIL PROTECTED]
 wrote in message
 news:[EMAIL PROTECTED][EMAIL PROTECTED]
  Suppose I have the following schema:
 
  CREATE TABLE t1
  (
  f1 integer,
  f2 text
  );
 
  CREATE TABLE t2
  (
  val integer
  );
 
  Suppose the following inserts statement are executed by two processes
  over the above schema.
 
  insert into t1 values ((SELECT val FROM t2 WHERE ROWID=1), aa);
  UPDATE t2 SET  val = val + 1 WHERE ROWID=1;
 
  The idea is to use the value 'val' from the table t2 and set the value
  of f1 to that value on an insert. The question I have is whether I can
  rely on the above sequence of SQL to reliably generate *unique* f2
  values for all INSERTs.

 Why not just use ROWID as a unique identifier?


This is  because I need to avoid one property of ROWID fields and that's
that SQLITE reuses
the ROWID values. For example, in the following sequence of events,
1. Insert 3 rows in t1
2. Delete last row from t1
3. Insert 1 row in t1

assuming there are no instructions between operations (2) and (3), the row
added in
operation (3) will have the same ROWID value as the row deleted in operation
(2).
The application I am using SQLITE for needs to set unique identifiers that
are
never reused. These identifiers will be maintained in a separate table like
t2 in
my example above.


  Basically, I am not sure whether there is a
  possibility that a thread/process can be preempted after executing the
  SELECT but before executing the INSERT in that thread/process.

 No. An implicit transaction is created for each statement. What is
 possible is for another thread to squeeze a statement between your
 insert and update. To prevent that, surround the two statements with an
 explicit transaction.


Got it.


 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] A concurrency question

2008-04-21 Thread Igor Tandetnik
Gaurav Mathur [EMAIL PROTECTED]
wrote in message
news:[EMAIL PROTECTED]
 Why not just use ROWID as a unique identifier?

 This is  because I need to avoid one property of ROWID fields and
 that's
 that SQLITE reuses
 the ROWID values.

http://sqlite.org/autoinc.html

Igor Tandetnik 



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


Re: [sqlite] SQLITE_OMIT_xxx

2008-04-21 Thread Dimitri
Hi,

Richard Klein wrote:
 [...]
 (2) Perforce (our version control software) has trouble diff'ing
 two versions of a large file.

We have the amalgamated sqlite3.c source file under Perforce control 
here and I don't recall any problems with diff, except I had to wait a 
bit longer than usual.

In your case, it could have been an occasional failure. I suggest 
reporting the issue to Perforce, they will most probably fix it.

-- 
Dimitri

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


Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-21 Thread Farzana

Thanks for the quick reply Epankoke.
We tried as you mentioned. But we are restricted with the memory size and
the storage of the needed data occupies some MB's of space in the memory so
we cannot go for it. Is there any other work around to perform the scrolling
condition.

Kindly help in this regard.

Regards,
Farzana.


epankoke wrote:
 
 Is it possible to store all of the needed data in memory?  If so, why not
 read the required information into an array and just update an index
 variable to keep track of where you are at in the array when the user
 clicks the up and down buttons?  That should be quite fast.
 
 --
 Eric Pankoke
 Founder / Lead Developer
 Point Of Light Software
 http://www.polsoftware.com/
 
  -- Original message --
 From: Farzana [EMAIL PROTECTED]
 
 Thanks for your reply Igor.
 
 We tried populating the listbox as mentioned in the URL.We are successful
 in
 populating the listbox but when we go for scrolling the data, it takes
 more
 time to move forward and backward since it has to execute the query
 everytime. We are using a PocketPc so it is much slower. Is there any
 other
 way to do this or can some one provide us a sample code for the same.
 We are using a Table say Employees where we have to dsiplay their Job
 Description in ascending order in a user defined listbox with scroll up
 and
 scroll down buttons. Can anyone provide us a suggestion.
 Thanks in Advance.
 
 Regards,
 Farzana
 
 
 
 Igor Tandetnik wrote:
  
  Farzana [EMAIL PROTECTED]
  wrote in message news:[EMAIL PROTECTED]
  We are working in eVC++ environment with SQLite database.We need to
  populate the listbox with the values obtained by executing the query.
  We were able to get the values of the query by using the API's
  sqlite3_prepare and sqlite3_step.
  But we were able to populate and move the listbox in the downward
  direction only
  
  http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor
  
  Igor Tandetnik 
  
  
  
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Populating-and-scrolling-the-Listbox-using-query-tp1667617
 8p16806114.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-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 

-- 
View this message in context: 
http://www.nabble.com/Populating-and-scrolling-the-Listbox-using-query-tp16676178p16821712.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


Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-21 Thread Neville Franks
Tuesday, April 22, 2008, 2:52:37 PM, you wrote:

Why not just keep the rowid's in an array and query the actual row
contents as needed. This is typical with virtual list or tree
controls. That is you keep a reference to the data, not the data
itself.


F Thanks for the quick reply Epankoke.
F We tried as you mentioned. But we are restricted with the memory size and
F the storage of the needed data occupies some MB's of space in the memory so
F we cannot go for it. Is there any other work around to perform the scrolling
F condition.

F Kindly help in this regard.

F Regards,
F Farzana.


F epankoke wrote:
 
 Is it possible to store all of the needed data in memory?  If so, why not
 read the required information into an array and just update an index
 variable to keep track of where you are at in the array when the user
 clicks the up and down buttons?  That should be quite fast.
 
 --
 Eric Pankoke
 Founder / Lead Developer
 Point Of Light Software
 http://www.polsoftware.com/
 
  -- Original message --
 From: Farzana [EMAIL PROTECTED]
 
 Thanks for your reply Igor.
 
 We tried populating the listbox as mentioned in the URL.We are successful
 in
 populating the listbox but when we go for scrolling the data, it takes
 more
 time to move forward and backward since it has to execute the query
 everytime. We are using a PocketPc so it is much slower. Is there any
 other
 way to do this or can some one provide us a sample code for the same.
 We are using a Table say Employees where we have to dsiplay their Job
 Description in ascending order in a user defined listbox with scroll up
 and
 scroll down buttons. Can anyone provide us a suggestion.
 Thanks in Advance.
 
 Regards,
 Farzana
 
 
 
 Igor Tandetnik wrote:
  
  Farzana [EMAIL PROTECTED]
  wrote in message news:[EMAIL PROTECTED]
  We are working in eVC++ environment with SQLite database.We need to
  populate the listbox with the values obtained by executing the query.
  We were able to get the values of the query by using the API's
  sqlite3_prepare and sqlite3_step.
  But we were able to populate and move the listbox in the downward
  direction only
  
  http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor
  
  Igor Tandetnik 
  
  
  
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/Populating-and-scrolling-the-Listbox-using-query-tp1667617
 8p16806114.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-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 



-- 
Best regards,
  Neville Franks, http://www.surfulater.com http://blog.surfulater.com
 

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


[sqlite] OMIT_VIEW / TRIGGER bug?

2008-04-21 Thread Richard Klein
I fixed my OPTS in the Makefile so that they are in sync
with my compilation options.

Now all the unresolved references in the parser have dis-
appeared, but I'm still left with two unresolved references
to the function sqlite3MaterializeView():

delete.obj : error LNK2019: unresolved external symbol _sqlite3MaterializeView 
referenced in function _sqlite3DeleteFrom
update.obj : error LNK2019: unresolved external symbol _sqlite3MaterializeView 
referenced in function _sqlite3Update

The function sqlite3MaterializeView() is defined in the
file delete.c, as follows:


#if !defined(SQLITE_OMIT_VIEW)  !defined(SQLITE_OMIT_TRIGGER)
/*
** Evaluate a view and store its result in an ephemeral table.  The
** pWhere argument is an optional WHERE clause that restricts the
** set of rows in the view that are to be added to the ephemeral table.
*/
void sqlite3MaterializeView(
   ...
){
   ...
}
#endif /* !defined(SQLITE_OMIT_VIEW)  !defined(SQLITE_OMIT_TRIGGER) */


In my application, I've defined SQLITE_OMIT_VIEW, but *not*
SQLITE_OMIT_TRIGGER; that is, I want TRIGGERs, but not VIEWs.

It would seem that in the conditional compilation expression
shown above, the  should be replaced by ||:

#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER)

In other words, if VIEW *or* TRIGGER is supported, then define
the function sqlite3MaterializeView().

Making that change fixes the problem.

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


Re: [sqlite] Populating and scrolling the Listbox using query

2008-04-21 Thread Eric Pankoke
That seems like it would cut down on some of your query times.  When you
say it's running slow, how slow are you talking about?

Eric Pankoke
Founder
Point Of Light Software
http://www.polsoftware.com/
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Neville Franks
Sent: Tuesday, April 22, 2008 1:08 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Populating and scrolling the Listbox using query

Tuesday, April 22, 2008, 2:52:37 PM, you wrote:

Why not just keep the rowid's in an array and query the actual row
contents as needed. This is typical with virtual list or tree
controls. That is you keep a reference to the data, not the data
itself.


F Thanks for the quick reply Epankoke.
F We tried as you mentioned. But we are restricted with the memory size
and
F the storage of the needed data occupies some MB's of space in the
memory so
F we cannot go for it. Is there any other work around to perform the
scrolling
F condition.

F Kindly help in this regard.

F Regards,
F Farzana.


F epankoke wrote:
 
 Is it possible to store all of the needed data in memory?  If so, why
not
 read the required information into an array and just update an index
 variable to keep track of where you are at in the array when the user
 clicks the up and down buttons?  That should be quite fast.
 
 --
 Eric Pankoke
 Founder / Lead Developer
 Point Of Light Software
 http://www.polsoftware.com/
 
  -- Original message --
 From: Farzana [EMAIL PROTECTED]
 
 Thanks for your reply Igor.
 
 We tried populating the listbox as mentioned in the URL.We are
successful
 in
 populating the listbox but when we go for scrolling the data, it
takes
 more
 time to move forward and backward since it has to execute the query
 everytime. We are using a PocketPc so it is much slower. Is there
any
 other
 way to do this or can some one provide us a sample code for the
same.
 We are using a Table say Employees where we have to dsiplay their
Job
 Description in ascending order in a user defined listbox with scroll
up
 and
 scroll down buttons. Can anyone provide us a suggestion.
 Thanks in Advance.
 
 Regards,
 Farzana
 
 
 
 Igor Tandetnik wrote:
  
  Farzana [EMAIL PROTECTED]
  wrote in message news:[EMAIL PROTECTED]
  We are working in eVC++ environment with SQLite database.We need
to
  populate the listbox with the values obtained by executing the
query.
  We were able to get the values of the query by using the API's
  sqlite3_prepare and sqlite3_step.
  But we were able to populate and move the listbox in the downward
  direction only
  
  http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor
  
  Igor Tandetnik 
  
  
  
  ___
  sqlite-users mailing list
  sqlite-users@sqlite.org
  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
  
  
 
 -- 
 View this message in context: 

http://www.nabble.com/Populating-and-scrolling-the-Listbox-using-query-t
p1667617
 8p16806114.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-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 



-- 
Best regards,
  Neville Franks, http://www.surfulater.com http://blog.surfulater.com
 

___
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] blob api

2008-04-21 Thread Robert Bielik
D. Richard Hipp skrev:
 Perhaps:  SELECT CAST(b AS TEXT) FROM table
 

Ok, I was kinda hoping for a more permanent solution such as:

int sqlite3_cast_column_type(sqlite3* db, const char* zDBname, const char* 
zTable, const char* zColumn, int newColumnType);

that would cast the column into the desired type, returning SQLITE3_ERROR if 
the cast is invalid (like from double to
integer, or text to numeric).

 Really I suppose it depends on what SQLiteSpy is using to
 determine that the column type is BLOB.  If you can subversion
 that mechanism into thinking the column type is TEXT, then
 it should just work.

How do you mean by subversioning ?

/R



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