Re: [sqlite] Accent Insensitive search

2009-03-25 Thread Alexey Pechnikov
Hello!

On Tuesday 24 March 2009 20:19:00 aditya siram wrote:
 Hi all,
 Is there a way to do an accent/diacritic insensitive search in sqlite? For
 example I want to a query to find  `a blanc  with the search term a
 blanc.

Yes.

http://ioannis.mpsounds.net/blog/2007/12/19/sqlite-native-unicode-like-
support/

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


Re: [sqlite] speeding up row by row lookup in a large db

2009-03-25 Thread Alexey Pechnikov
Hello!

On Saturday 21 March 2009 17:31:45 P Kishor wrote:
 My intent is to simply retrieve a BLOB and
 deserialize it... it would possibly be quicker than 33 ms per
 retrieval. Well, I haven't yet completed this test because each BLOB
 is taking about 430 KB. At 1 million rows, that is going to occupy
 upward of 400 GB. I broke the load_blob_table routine after about a
 third of the records had been processed because I found even the
 loading_the_blobs to be excruciatingly slow.

zlib compression may help you.

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


[sqlite] pragma quick_check, how do I use it in C?

2009-03-25 Thread Jules Colding
Hi,

I can't get the quick_check instruction to work but I'm sure that I   
must be doing something really stupid. It seems like my callback  
function isn't invoked. I have this (just for testing) struct which  
should be initialised properly when the callback is invoked, but the  
values are always unchanged after sqlite3_exec(). Take for instance  
the struct sq member argc. That struct member is always -1 after  
sqlite3_exec().

Could someone help me and point out what I'm doing wrong here? I'm  
using SQlite3 3.4.0. My code is below.


Thanks a lot,
   jules



struct sq {
int argc;
char *argv;
};

static int
check_callback(void *hook,
   int argc,
   char **argv,
   char **azColName)
{
struct sq *data = (struct sq*)hook;
data-argc = argc;
data-argv = (NULL != argv[0]) ? strdup(argv[0]) : NULL;

return 0;
}

static int
quick_check(sqlite3 *db)
{
 int rc;
struct sq db_ok;

db_ok.argc = -1;
db_ok.argv = NULL;

 rc = sqlite3_exec(db, pragma quick_check;, check_callback,  
(void*)db_ok, NULL);

printf(%s(%d) - argc = %d, __FILE__, __LINE__, db_ok.argc);
if (db_ok.argv)
printf(%s(%d) - argv[0] = %s, __FILE__, __LINE__, db_ok.argv);
else
printf(%s(%d) - argv[0] = NULL, __FILE__, __LINE__);

 return 0;
}

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


[sqlite] Strict affinity again

2009-03-25 Thread sqlite . 20 . tomcat78
Hi everyone,

I'm new to sqlite and this mailing list and hope to get some help
here. I've used SQLite for some projects now and I must say, that it
is the fastes database I ever used. Great work!

But there is one thing, that I really dislike, because I get errors
sometimes with this and that is the type guessing or the untyped way
sqlite returns the data. So I searched the web and found
http://www.sqlite.org/datatype3.html where strict affinity is
described. I thought great, but how do I enable this option.

After some search I found the thread from Feb. 2008. It sounds like
that isn't a big code change and Samuel Neff wrote exactly that what I
think about this :

 But the important point is that no matter how much discussion we have, we
 will never all agree that untyped is better than typed or that typed is
 better than typed.  That's why an option so individual developers can choose
 is good.  We don't have to agree, with an option we can agree to disagree.

 Sam

So now my question: Why is this not implemented? I'd really like this
option!!

Jan

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


Re: [sqlite] pragma quick_check, how do I use it in C?

2009-03-25 Thread D. Richard Hipp

On Mar 25, 2009, at 8:44 AM, Jules Colding wrote:

 Hi,

 I can't get the quick_check instruction to work...  I'm
 using SQlite3 3.4.0.

quick_check was added in version 3.5.5.


D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] Strict affinity again

2009-03-25 Thread D. Richard Hipp

On Mar 25, 2009, at 9:02 AM, sqlite.20.tomca...@spamgourmet.com wrote:

 Hi everyone,

 I'm new to sqlite and this mailing list and hope to get some help
 here. I've used SQLite for some projects now and I must say, that it
 is the fastes database I ever used. Great work!

 But there is one thing, that I really dislike, because I get errors
 sometimes with this and that is the type guessing or the untyped way
 sqlite returns the data. So I searched the web and found
 http://www.sqlite.org/datatype3.html where strict affinity is
 described. I thought great, but how do I enable this option.

 After some search I found the thread from Feb. 2008. It sounds like
 that isn't a big code change and Samuel Neff wrote exactly that what I
 think about this :

 But the important point is that no matter how much discussion we  
 have, we
 will never all agree that untyped is better than typed or that  
 typed is
 better than typed.  That's why an option so individual developers  
 can choose
 is good.  We don't have to agree, with an option we can agree to  
 disagree.

 Sam

 So now my question: Why is this not implemented? I'd really like this
 option!!


Let me just say (again) that SQLite is not untyped.  It is  
dynamically typed.  Big difference.  SQLite is strongly typed, it just  
does not place arbitrary constraints on what types of data that can be  
stored in a particular column.  SQLite keeps the type information with  
the data itself, not on the data's container.

If you want to place a restriction on a column such that it will only  
hold an integer (for example) you can use a CHECK constraint.

  CREATE TABLE example1(x INTEGER CHECK( typeof(x)='integer' ));

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] pragma quick_check, how do I use it in C?

2009-03-25 Thread Jules Colding

On 25/03/2009, at 14.04, D. Richard Hipp wrote:


 On Mar 25, 2009, at 8:44 AM, Jules Colding wrote:

 Hi,

 I can't get the quick_check instruction to work...  I'm
 using SQlite3 3.4.0.

 quick_check was added in version 3.5.5.

OK, that was easy :-(

Thanks,
   jules

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


Re: [sqlite] pragma quick_check, how do I use it in C?

2009-03-25 Thread Jules Colding

On 25/03/2009, at 14.04, D. Richard Hipp wrote:


 On Mar 25, 2009, at 8:44 AM, Jules Colding wrote:

 Hi,

 I can't get the quick_check instruction to work...  I'm
 using SQlite3 3.4.0.

 quick_check was added in version 3.5.5.

BTW: when was integrity_check added?

Thanks,
   jules

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


Re: [sqlite] Strict affinity again

2009-03-25 Thread Thomas Briggs
   I'd be willing to bet that amongst experienced SQLite users, you're
in the minority.

   More importantly, I don't think Dr. Hipp agrees with you, so the
discussion is very likely moot. :)

   -T

On Wed, Mar 25, 2009 at 9:02 AM,  sqlite.20.tomca...@spamgourmet.com wrote:
 Hi everyone,

 I'm new to sqlite and this mailing list and hope to get some help
 here. I've used SQLite for some projects now and I must say, that it
 is the fastes database I ever used. Great work!

 But there is one thing, that I really dislike, because I get errors
 sometimes with this and that is the type guessing or the untyped way
 sqlite returns the data. So I searched the web and found
 http://www.sqlite.org/datatype3.html where strict affinity is
 described. I thought great, but how do I enable this option.

 After some search I found the thread from Feb. 2008. It sounds like
 that isn't a big code change and Samuel Neff wrote exactly that what I
 think about this :

 But the important point is that no matter how much discussion we have, we
 will never all agree that untyped is better than typed or that typed is
 better than typed.  That's why an option so individual developers can choose
 is good.  We don't have to agree, with an option we can agree to disagree.

 Sam

 So now my question: Why is this not implemented? I'd really like this
 option!!

 Jan

 ___
 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] pragma quick_check, how do I use it in C?

2009-03-25 Thread D. Richard Hipp

On Mar 25, 2009, at 9:15 AM, Jules Colding wrote:

 BTW: when was integrity_check added?


Version 2.3.0.  The original name was sanity_check.  The name was  
changed to integrity_check for 2.4.0.

D. Richard Hipp
d...@hwaci.com



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


[sqlite] Insert performance in 3.6.11 vs. 3.5.5

2009-03-25 Thread Günter Obiltschnig
Hi there,

I have just upgraded SQLite in our application from 3.5.5 to 3.6.11  
(we are using the amalgamation), and I have noticed a sharp drop in  
insert performance to more than half the speed that we had with 3.5.5.  
We are using SQLite in an embedded Linux device, and the database  
files are on a CompactFlash device.

The inserts are being done into an initially empty table with 28  
columns, and all inserts (can be more than 10) are done within one  
large transaction, using a prepared insert statement. One additional  
unique index on a single column is used on the table as well.

With 3.5.5, inserting 1000 rows into that table took about 7 seconds,  
with 3.6.11 it takes 14-16 seconds.

We are using PRAGMA synchronous = OFF and a cache size of 6000 pages.  
The main reason why we updated was because we experienced memory  
issues with 3.5.5. Reducing the cache size (PRAGMA cache_size) would  
not release memory.

Any ideas what causes this?

Apart from that we are very happy with sqlite. A big thank you to D.  
Richard Hipp and everyone who contributed to this great peace of  
software.

Thanks and best regards,

Günter

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


[sqlite] Compilation error enabling ICU and FTS3, Sqlite 3.6.11, Ubuntu Hardy libicu-dev

2009-03-25 Thread aditya siram
Hi all,
I am trying to compile Sqlite with full text search and icu support. I
installed libicu-dev from the Ubuntu Hardy repos. I downloaded the
amalgamation package [1] and added the icu and fts option to the sqlite3.c
file [2]. I now get the following compilation error:
gcc -DSQLITE_THREADSAFE=1 -g -O2 -o .libs/sqlite3 shell.o
./.libs/libsqlite3.so -lreadline -lcurses -ldl -lpthread
./.libs/libsqlite3.so: undefined reference to `ubrk_current_3_8'
./.libs/libsqlite3.so: undefined reference to `uregex_matches_3_8'
./.libs/libsqlite3.so: undefined reference to `uregex_setText_3_8'
./.libs/libsqlite3.so: undefined reference to `utf8_nextCharSafeBody_3_8'
./.libs/libsqlite3.so: undefined reference to `ubrk_next_3_8'
./.libs/libsqlite3.so: undefined reference to `uregex_close_3_8'
./.libs/libsqlite3.so: undefined reference to `u_foldCase_3_8'
./.libs/libsqlite3.so: undefined reference to `ubrk_close_3_8'
./.libs/libsqlite3.so: undefined reference to `ubrk_first_3_8'
./.libs/libsqlite3.so: undefined reference to `u_strToUTF8_3_8'
./.libs/libsqlite3.so: undefined reference to `u_isspace_3_8'
./.libs/libsqlite3.so: undefined reference to `ubrk_open_3_8'
./.libs/libsqlite3.so: undefined reference to `u_strToUpper_3_8'
./.libs/libsqlite3.so: undefined reference to `u_strToLower_3_8'
./.libs/libsqlite3.so: undefined reference to `utf8_countTrailBytes_3_8'
./.libs/libsqlite3.so: undefined reference to `u_errorName_3_8'
./.libs/libsqlite3.so: undefined reference to `uregex_open_3_8'
./.libs/libsqlite3.so: undefined reference to `ucol_close_3_8'
./.libs/libsqlite3.so: undefined reference to `ucol_strcoll_3_8'
./.libs/libsqlite3.so: undefined reference to `ucol_open_3_8'
collect2: ld returned 1 exit status
make: *** [sqlite3] Error 1

Google search yielded nothing. Any ideas?
Thanks,
deech

[1] http://www.sqlite.org/sqlite-amalgamation-3.6.11.tar.gz
[2] Head of sqlite3.c:
/**
** This file is an amalgamation of many separate C source files from SQLite
 ...
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
#ifndef SQLITE_API
# define SQLITE_API
#endif
#define SQLITE_ENABLE_FTS3
#define SQLITE_ENABLE_FTS3_PARENTHESIS
#define SQLITE_ENABLE_ICU
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Step Query

2009-03-25 Thread Kees Nuyt

Hi Dennis,

On Tue, 24 Mar 2009 18:23:23 -0600, Dennis Cote
r.dennis.c...@gmail.com wrote:

vinod1 wrote:
 I am new to sqlite and C.

 I have not been able to write a code which would read row by row using
 sqlite3_step.

 Could anybody guide me please.


Hi,

This code is equivalent to the very old callback style code shown at 
http://www.sqlite.org/quickstart.html.

It should provide the same results using the newer prepare/step/finalize 
set of calls that are discussed at http://www.sqlite.org/cintro.html.

Hopefully it provides a complete, if somewhat basic, intro to the use of 
the preferred C API functions.

#include stdio.h
#include sqlite3.h

[snip]

  return rc!=SQLITE_DONE;
}

HTH
Dennis Cote

This seems a very nice addition to the
http://www.sqlite.org/cvstrac/wiki?p=SampleCode 
we already have.

I feel tempted to put it in the wiki 
http://www.sqlite.org/cvstrac/wiki
under the 'Hints For Using SQLite More Effectively' heading,
as http://www.sqlite.org/cvstrac/wiki?p=SimpleCode.

Would you mind if I do?
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Strict affinity again

2009-03-25 Thread Kees Nuyt
On Wed, 25 Mar 2009 13:06:24 -0400, Wilson, Ron P
ronald.wil...@tycoelectronics.com wrote:

Cool!  I didn't think of doing that.  
I presume this would incur a performance hit
on insert/update to check the constraint 

Not much. The column data is _dynamically_ typed, 
so SQLite will determine the type of each 
value offered anyway.

and sqlite3_prepare* would return SQLITE_CONSTRAINT 
if the check failed.  Right?

Wrong. sqlite3_prepare* doesn't know the data you are going
to offer with sqlite3_bind*. The same 'prepared' statement
can be used with valid and invalid data.

CONSTRAINT violations will be discovered during VM execution
of your INSERT / UPDATE statements.
See how it works with something like:

EXPLAIN INSERT ... ;


RW

Ron Wilson, S/W Systems Engineer III, Tyco Electronics, 434.455.6453





If you want to place a restriction on a column such that it will only

hold an integer (for example) you can use a CHECK constraint.



  CREATE TABLE example1(x INTEGER CHECK( typeof(x)='integer' ));



D. Richard Hipp

d...@hwaci.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
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert performance in 3.6.11 vs. 3.5.5

2009-03-25 Thread Kees Nuyt
On Wed, 25 Mar 2009 15:24:47 +0100, Günter Obiltschnig
guenter.obiltsch...@appinf.com wrote:

Hi there,

I have just upgraded SQLite in our application from 3.5.5 to 3.6.11  
(we are using the amalgamation), and I have noticed a sharp drop in  
insert performance to more than half the speed that we had with 3.5.5.  
We are using SQLite in an embedded Linux device, and the database  
files are on a CompactFlash device.

The inserts are being done into an initially empty table with 28  
columns, and all inserts (can be more than 10) are done within one  
large transaction, using a prepared insert statement. One additional  
unique index on a single column is used on the table as well.

Sounds good.

With 3.5.5, inserting 1000 rows into that table took about 7 seconds,  
with 3.6.11 it takes 14-16 seconds.

We are using PRAGMA synchronous = OFF and a cache size of 6000 pages.  
The main reason why we updated was because we experienced memory  
issues with 3.5.5. Reducing the cache size (PRAGMA cache_size) would  
not release memory.

Any ideas what causes this?

Is the page_size the same in both cases?
Does the page_size fit the I/O unity of the Compact Flash?
(the default is not always optimal)

For releasing cache memory, have a look at
http://www.sqlite.org/c3ref/release_memory.html

Apart from that we are very happy with sqlite. A big thank you to 
D. Richard Hipp and everyone who contributed to this great peace of  
software.

+1

Thanks and best regards,

Günter
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Replacement for COPY

2009-03-25 Thread Griggs, Donald
 

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of BOB_GOREN
Sent: Tuesday, March 24, 2009 10:49 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Replacement for COPY

Sqlite 2.8.13 supported statements like:

COPY ar FROM xxx.odb USING DELIMITERS |

 

What is the equivalent in sqlite 3.6.11? 

COPY seems to no longer be supported - the same statement that works on
2.8 now generates a syntax error and COPY and DELIMITERS are not in the
list of keywords for 3.6.
==


Hi Bob,

I found this page:  http://www.hwaci.com/sw/sqlite/lang_copy.html
which directs developers to the .import command within the sqlite3
command-line utility.

If you must have this capability in your code (versus the standalone
utility) then you might want to look at the source for .import

Alternatively, you might want to seek out some good routines in your
language of choice for handling delimited text.  The easy trick to
quick imports, as you're probably already aware, will be to combine many
or all of your sql INSERTS within a transaction.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sql select of varchar text with special chars

2009-03-25 Thread anjela patnaik
Hello all,
 
I've a table in oracle that contains fields of type varchar2. In these fields 
are TCL scripts that contain backslash chars and brackets.
 
Now, I've generated an SQL file from the Oracle table data that contains SQL 
insert statements. I then use sqlite .read to read in the entire db. This runs 
fine with no issues.
 
However, when I select the rows using SQLite (TCL api), I notice some of the 
data comes back garbled and messed up. This doesn't happen to all of the rows, 
just some of them.
 
How do I get around this? It's not exactly clear why the SQLite TCL API is not 
handling some of the data properly.
 
Note that when I do a select using the sqlite3 command API, I don't see any 
problems.
 
Below is the insert corresponding to a row that comes back messed up. By messed 
up, I mean that the data that comes back has a \ for every space in the 
original field. But that is not what the original data contained. 
 
Thanks for any help!!
 
 
Insert into AUTO
   (OPERATION, INTERFACE, OCRELEASE, RUNDATE, PRODUCTS, SERVER, REQUEST, 
REQUEST2, RESPONSE)
 Values
   ('addConnections', 'MultiLayerSubnetworkMgr_I', '9.0.1', '01/16/2009', 
'{Core CI}', 
    '10.120.6.104', '  set ver 7.1
  set callName \
    [NamingAttributes_T $ver \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    EMS \
    CI/LightWorks_ON-Center \
    ] \
    [NameAndStringValue_T $ver \
    Call \
    Tunnel \
    ] \
    ] \
    ] 
  set connectionsToAdd \
    [SNCCreateDataList_T $ver \
    [SNCCreateData_T $ver \
     \
    false \
     \
    1 \
    1 \
    3 \
    2 \
    2 \
    0 \
    [LayerRate_T $ver \
    14 \
    ] \
    [CrossConnectList_T $ver \
    ] \
    [ResourceList_T $ver \
    ] \
    false \
    [ResourceList_T $ver \
    ] \
    [NamingAttributesList_T $ver \
    [NamingAttributes_T $ver \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    EMS \
    CI/LightWorks_ON-Center \
    ] \
    [NameAndStringValue_T $ver \
    ManagedElement \
    inci095 \
    ] \
    [NameAndStringValue_T $ver \
    FTP \
    
/rack=1/shelf=3/slot=15/port_group=1/port=Tunnel \
    ] \
    [NameAndStringValue_T $ver \
    CTP \
    /sts1_au3=29 \
    ] \
    ] \
    ] \
    ] \
    [NamingAttributesList_T $ver \
    [NamingAttributes_T $ver \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    EMS \
    CI/LightWorks_ON-Center \
    ] \
    [NameAndStringValue_T $ver \
    ManagedElement \
    inci095 \
    ] \
    [NameAndStringValue_T $ver \
    PTP \
    /rack=1/shelf=3/slot=2/sub_slot=1/port=1 \
    ] \
    [NameAndStringValue_T $ver \
    CTP \
    /sts1_au3=27 \
    ] \
    ] \
    ] \
    ] \
    [NVSList_T $ver \
    [NameAndStringValue_T $ver \
    SNC_NAME \
    ethSNC222 \
    ] \
    [NameAndStringValue_T $ver \
    SNC_PREEMPTING \
    No \
    ] \
    [NameAndStringValue_T $ver \
    SNC_PREEMPTABILITY \
    No \
    ] \
    [NameAndStringValue_T $ver \
    SNC_PRIORITY \
    0 \
    ] \
    [NameAndStringValue_T $ver \
    SNC_UNPROTECTED_LINES \
    Yes \
    ] \
    [NameAndStringValue_T $ver \
    SNC_PROTECT_LINES \
    No \
    ] \
    [NameAndStringValue_T $ver \
    SNC_LINEAR_APS_PROTECTED_LINES \
    No \
    ] \
    [NameAndStringValue_T $ver \
    SNC_VLSR_PROTECTED_LINES \
    No \
    ] \
   

[sqlite] Documentation on SQLite indirectBLOB?

2009-03-25 Thread MBR
The Open Source project BitPim uses SQLite.  I'm trying to examine the 
database BitPim creates.  At http://www.sqlite.org/download.html I found 
sqlite-3_6_11.zip, which is a pre-compiled Windows command-line SQL 
interface.

I ran:

sqlite3 bitpim.db

then typed:

.dump

and saved the output to see what's in the database.  The result is a set 
of SQL queries that can be used to recreate the database.  In the output 
I found numerous references to columns of type indirectBLOB.  When I 
look at the data that gets inserted into those columns, it's pretty 
clear that the value in those columns is of the form:

/tableName/,/recordId/,/recordId/,...

But I've been unable to find documentation on the keyword 'indirect' or 
'indirectBLOB' anywhere on the web, including 
http://www.sqlite.org/docs.html.  Can anyone here tell me where to find 
that documentation?

Mark Rosenthal
m...@arlsoft.com mailto:m...@arlsoft.com

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


Re: [sqlite] Documentation on SQLite indirectBLOB?

2009-03-25 Thread Griggs, Donald
Hi Mark,

There's a good reason for your difficulty -- Sqlite uses dynamic typing:
http://www.sqlite.org/datatype3.html

As far as I know, the term IndirectBlob is not defined within sqlite
and is likely a term from the BitPim developers.

Sqlite allows one to use most anything as a type -- BlobThatAteNewYork
would work quite nicely.

From sqlite's point-of-view, if a BLOB contains structure, it's
structure known only to the calling application.

Hope this helps,
  Donald

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of MBR
Sent: Wednesday, March 25, 2009 6:09 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] Documentation on SQLite indirectBLOB?

The Open Source project BitPim uses SQLite.  I'm trying to examine the
database BitPim creates.  At http://www.sqlite.org/download.html I found
sqlite-3_6_11.zip, which is a pre-compiled Windows command-line SQL
interface.

I ran:

sqlite3 bitpim.db

then typed:

.dump

and saved the output to see what's in the database.  The result is a set
of SQL queries that can be used to recreate the database.  In the output
I found numerous references to columns of type indirectBLOB.  When I
look at the data that gets inserted into those columns, it's pretty
clear that the value in those columns is of the form:

/tableName/,/recordId/,/recordId/,...

But I've been unable to find documentation on the keyword 'indirect' or
'indirectBLOB' anywhere on the web, including
http://www.sqlite.org/docs.html.  Can anyone here tell me where to find
that documentation?

Mark Rosenthal
m...@arlsoft.com mailto:m...@arlsoft.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


[sqlite] Sqlite3 crashes when using the where command

2009-03-25 Thread JoeT

I am trying to run sqlite3 on Solaris 8.  I have managed to compile it- and
install it.  Basic read and write to a database works fine.  However when I
use the where command or the delete command it crashes on me and says bus
error.  It then does a core dump.
Here is my configure line:
./configure --prefix=/usr/local/sqlite --sysconfdir=/usr/local/sqlite
--enable-readline --enable-threadsafe
Make -s
make install

Any ideas on what I am doing wrong or maybe some other compile options would
be appreciated.
-- 
View this message in context: 
http://www.nabble.com/Sqlite3-crashes-when-using-the-where-command-tp22712542p22712542.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] Sqlite3 crashes when using the where command

2009-03-25 Thread John Machin
On 26/03/2009 9:48 AM, JoeT wrote:
 I am trying to run sqlite3 on Solaris 8.  I have managed to compile it- and
 install it.  Basic read and write to a database works fine.  However when I
 use the where command or the delete command it crashes on me and says bus
 error.  It then does a core dump.
 Here is my configure line:
 ./configure --prefix=/usr/local/sqlite --sysconfdir=/usr/local/sqlite
 --enable-readline --enable-threadsafe
 Make -s
 make install
 
 Any ideas on what I am doing wrong or maybe some other compile options would
 be appreciated.

IIRC boxes running Solaris are bigendian, most of the rest of the world 
is littleendian ... perhaps this is relevant to your problem.

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


Re: [sqlite] Documentation on SQLite indirectBLOB?

2009-03-25 Thread MBR
I just read through http://www.sqlite.org/datatype3.html, and it's now 
starting to make sense to me.  Wow!   My mental model of what's going on 
under the covers just underwent a major readjustment.  Thanks for 
pointing me at that page.

Mark

Griggs, Donald wrote:
 Hi Mark,

 There's a good reason for your difficulty -- Sqlite uses dynamic typing:
 http://www.sqlite.org/datatype3.html

 As far as I know, the term IndirectBlob is not defined within sqlite
 and is likely a term from the BitPim developers.

 Sqlite allows one to use most anything as a type -- BlobThatAteNewYork
 would work quite nicely.

 From sqlite's point-of-view, if a BLOB contains structure, it's
 structure known only to the calling application.

 Hope this helps,
   Donald

 -Original Message-
 From: sqlite-users-boun...@sqlite.org
 [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of MBR
 Sent: Wednesday, March 25, 2009 6:09 PM
 To: sqlite-users@sqlite.org
 Subject: [sqlite] Documentation on SQLite indirectBLOB?

 The Open Source project BitPim uses SQLite.  I'm trying to examine the
 database BitPim creates.  At http://www.sqlite.org/download.html I found
 sqlite-3_6_11.zip, which is a pre-compiled Windows command-line SQL
 interface.

 I ran:

 sqlite3 bitpim.db

 then typed:

 .dump

 and saved the output to see what's in the database.  The result is a set
 of SQL queries that can be used to recreate the database.  In the output
 I found numerous references to columns of type indirectBLOB.  When I
 look at the data that gets inserted into those columns, it's pretty
 clear that the value in those columns is of the form:

 /tableName/,/recordId/,/recordId/,...

 But I've been unable to find documentation on the keyword 'indirect' or
 'indirectBLOB' anywhere on the web, including
 http://www.sqlite.org/docs.html.  Can anyone here tell me where to find
 that documentation?

 Mark Rosenthal
 m...@arlsoft.com mailto:m...@arlsoft.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

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


Re: [sqlite] Sqlite3 crashes when using the where command

2009-03-25 Thread P Kishor
On Wed, Mar 25, 2009 at 6:48 PM, John Machin sjmac...@lexicon.net wrote:
 On 26/03/2009 9:48 AM, JoeT wrote:
 I am trying to run sqlite3 on Solaris 8.  I have managed to compile it- and
 install it.  Basic read and write to a database works fine.  However when I
 use the where command or the delete command it crashes on me and says bus
 error.  It then does a core dump.
 Here is my configure line:
 ./configure --prefix=/usr/local/sqlite --sysconfdir=/usr/local/sqlite
 --enable-readline --enable-threadsafe
 Make -s
 make install

 Any ideas on what I am doing wrong or maybe some other compile options would
 be appreciated.

 IIRC boxes running Solaris are bigendian, most of the rest of the world
 is littleendian ... perhaps this is relevant to your problem.



Apple's PPC based machines are bigendian... sqlite compiles and works
just fine. Has to be something specific to his build.



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


Re: [sqlite] gentle intro to including sqlite in another program

2009-03-25 Thread Dennis Cote
P Kishor wrote:
 so, I have read the tutes on the website, but just wanted to confirm...

 I want to take baby steps to including sqlite's capabilities in my
 modeling program. Do I just include sqlite3.h and compile my program
 and magic will happen, or do I need to do something else?
   

There will be no magic unless you also link a previously compiled sqlite 
library, or also include the sqlite3.c almagamation source code file in 
your project. 

 Using Xcode. The model itself has about 30 or 40 different .c files
 and about a dozen or so .h files.

Just add the sqlite3.c file to your project and include sqlite3.h in 
your source files that call sqlite functions.

HTH
Dennis Cote

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


Re: [sqlite] gentle intro to including sqlite in another program

2009-03-25 Thread P Kishor
On Wed, Mar 25, 2009 at 7:58 PM, Dennis Cote r.dennis.c...@gmail.com wrote:
 P Kishor wrote:

 so, I have read the tutes on the website, but just wanted to confirm...

 I want to take baby steps to including sqlite's capabilities in my
 modeling program. Do I just include sqlite3.h and compile my program
 and magic will happen, or do I need to do something else?


 There will be no magic unless you also link a previously compiled sqlite
 library, or also include the sqlite3.c almagamation source code file in your
 project.

 Using Xcode. The model itself has about 30 or 40 different .c files
 and about a dozen or so .h files.

 Just add the sqlite3.c file to your project and include sqlite3.h in your
 source files that call sqlite functions.


yes. Thank you. William Kygesburye saved my house walls from the
banging of my head by explaining the first C and L of compiling and
linking. Listen, I have lived in the safe confines of Perl so far, but
this is exciting stuff... it takes little to get us excited here in
the midwest.

Off I go sqlitifying my first program... and what a program it is.


 HTH
 Dennis Cote





-- 
Puneet Kishor http://www.punkish.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Carbon Model http://carbonmodel.org/
Open Source Geospatial Foundation http://www.osgeo.org/
Sent from: Madison WI United States.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Documentation on SQLite indirectBLOB?

2009-03-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

MBR wrote:
 The Open Source project BitPim uses SQLite. 

I wrote that code.  The rationale is at
http://bitpim.svn.sourceforge.net/viewvc/bitpim/trunk/bitpim/dev-doc/database.html

 In the output
 I found numerous references to columns of type indirectBLOB.  

Generally the indirect is because the value is stored in another
table.  The BLOB bit is so that SQLite doesn't attempt to make any
affinity conversions (it generally prefers to mangle things into
integers which is fatal for phone numbers) .

This is only deep and meaningful to BitPim itself.  It has import and
export functionality if you want the actual data.  The SQLite database
is structured so that Python dictionaries are can be used in the rest of
the code.  Each entry has arbitrary fields each of which can have any
number of ordered values.  Any entry can be looked up for any point in
the past.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknK1rcACgkQmOOfHg372QRZXgCglblMxRPuS4vxa+OCecDUV2mI
3UEAoIgP0TTe0TWSURFrYCTekOGi1h9x
=Q1JI
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] gentle intro to including sqlite in another program

2009-03-25 Thread dcharno
P Kishor wrote:
 so, I have read the tutes on the website, but just wanted to confirm...
 
 I want to take baby steps to including sqlite's capabilities in my
 modeling program. Do I just include sqlite3.h and compile my program
 and magic will happen, or do I need to do something else?
 
 Using Xcode. The model itself has about 30 or 40 different .c files
 and about a dozen or so .h files.
 
 I am a C newbie (but, by golly, I will learn some by the end of this),
 so be gentle in your replies.
 

Grab the amalgamation,  add sqlite3.c to your makefile and include 
sqlite3.h in your program files as necessary.  At some point, you may 
want or need to add some compilation options depending upon your system 
(e.g. thread safety or page size).

I usually create a wrapper for the database access so I can have some 
abstraction which makes sense for the objects I am working with and 
isolate all the SQL into one area of the code.  What this wrapper looks 
like will largely depend upon your system and how you use SQLite.

If you program in C++, you could consider a C++ wrapper to make your 
life even simpler.  SQLiteDatabase.cpp from WebKit can provide a good 
starting point or be used as inspiration to roll your own.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite3 crashes when using the where command

2009-03-25 Thread Dan

On Mar 26, 2009, at 5:48 AM, JoeT wrote:


 I am trying to run sqlite3 on Solaris 8.  I have managed to compile  
 it- and
 install it.  Basic read and write to a database works fine.  However  
 when I
 use the where command or the delete command it crashes on me and  
 says bus
 error.  It then does a core dump.
 Here is my configure line:
 ./configure --prefix=/usr/local/sqlite --sysconfdir=/usr/local/sqlite
 --enable-readline --enable-threadsafe
 Make -s
 make install

 Any ideas on what I am doing wrong or maybe some other compile  
 options would
 be appreciated.

Could be the same as this:

  http://www.sqlite.org/cvstrac/tktview?tn=3613

Fixed here:

  http://www.sqlite.org/cvstrac/chngview?cn=6364

Dan.


 -- 
 View this message in context: 
 http://www.nabble.com/Sqlite3-crashes-when-using-the-where-command-tp22712542p22712542.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