Re: [sqlite] self test for sqlite-amalgamation-3.6.5

2008-11-26 Thread goldy
Hi,

Do we need to add more files in src as i just copied test*.c and *.h files
from source tar and then compiled in 3.6.5-amalgmation .

On Tue, Nov 25, 2008 at 10:21 AM, goldy <[EMAIL PROTECTED]> wrote:

> Hi Shane,
>
> I am using linux and i have used these options:
> gcc -g -O2 -DSQLITE_OS_UNIX=1 -I. -I./src -DNDEBUG -I/devel/usr/include
> -DSQLITE_THREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1  -DTCLSH=1
> -DSQLITE_NO_SYNC=1\
> -DSQLITE_CRASH_TEST=1 -DSQLITE_TEST=1\
> -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
> -DSQLITE_TEMP_STORE=1
>  -o testfixture ./src/test1.c ./src/test2.c ./src/test3.c ./src/test4.c
> ./src/test5.c ./src/test6.c ./src/test7.c ./src/test8.c ./src/test9.c
> ./src/test_autoext.c ./src/test_async.c ./src/test_btree.c
> ./src/test_config.c ./src/test_devsym.c ./src/test_func.c ./src/test_hexio.c
> ./src/test_malloc.c ./src/test_md5.c ./src/test_mutex.c ./src/test_onefile.c
> ./src/test_osinst.c ./src/test_schema.c ./src/test_server.c
> ./src/test_tclvar.c ./src/test_thread.c sqlite3.c -L/devel/usr/lib -ltcl8.4
> -ldl  -lieee -lm -lpthread
>
>
> I have copied src/test*.c from source repository and appended tclsqlite.c
> to sqlite3.c.
>
> I also tried to give -DSQLITE_AMALGAMATION flag but then during compilation
> i am getting errors.
>
> Regards
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how do this stuff in sqlite

2008-11-26 Thread Igor Tandetnik
"Rachmat Febfauza" <[EMAIL PROTECTED]>
wrote in message news:[EMAIL PROTECTED]
> i have query that don't work in sqlite but in mysql work and make
> good result.

Define "don't work". Do you get an error? What's the error text?

> CREATE TABLE hasil1 (Code char(5), Level vachar(8), Category varchar
> (50), Product varchar(60), Location varchar(50), Begin datetime, End
> datetime, Difference integer, PRIMARY KEY
> (Code,Level,Category,Product,Location,Begin,End));

Begin and End are keywords in SQLite (SQL is case insensitive). If you 
insist on naming your columns this way, you have to enclose the names in 
double quotes, just as you did when creating awal1 and akhir1.

Igor Tandetnik 



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


[sqlite] how do this stuff in sqlite

2008-11-26 Thread Rachmat Febfauza
i have query that don't work in sqlite but in mysql work and make good result.

sqlite :

table definition
CREATE TABLE awal1(Code char(5),Level varchar(8), Category varchar(50), Product 
varchar(60),  Location varchar(50), "begin" datetime);


CREATE TABLE akhir1(Code char(5),Level varchar(8),Category varchar(50),Product 
varchar(60), Location varchar(50),"end" datetime);

CREATE TABLE hasil1 (Code char(5), Level vachar(8), Category varchar (50), 
Product varchar(60), Location varchar(50), Begin datetime, End datetime, 
Difference integer, PRIMARY KEY 
(Code,Level,Category,Product,Location,Begin,End));

query :
insert or ignore into hasil1 select awal1.Code, awal1.Level, awal1.Category, 
awal1.Product, awal1.Location, awal1.Begin, akhir1.End, 
strftime("%s",akhir1.End)-strftime("%s",awal1.Begin) as Difference from awal1, 
akhir1 where awal1.Code = akhir1.Code and awal1.Category = akhir1.Category and 
awal1.Product = akhir1.Product and awal1.Location = akhir1.Location and 
akhir1.End >= awal1.Begin group by awal1.Begin, awal1.Code, awal1.Category, 
awal1.Product, awal1.Location

data i attached in zip file.

mysql
table definition
CREATE TABLE `awal1` (
  `Code` char(5) NOT NULL default '',
  `Level` enum('SMALL','MEDIUM','BIG') NOT NULL default 'SMALL',
  `Category` varchar(50) NOT NULL default '',
  `Product` varchar(60) NOT NULL default '',
  `Location` varchar(50) NOT NULL default '',
  `Begin` datetime NOT NULL default '-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE `akhir1` (
  `Code` char(5) NOT NULL default '',
  `Level` enum('SMALL','MEDIUM','BIG') NOT NULL default 'SMALL',
  `Category` varchar(50) NOT NULL default '',
  `Product` varchar(60) NOT NULL default '',
  `Location` varchar(50) NOT NULL default '',
  `End` datetime NOT NULL default '-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


CREATE TABLE `hasil1` (
  `Code` char(5) NOT NULL default '',
  `Level` enum('SMALL','MEDIUM','BIG') NOT NULL default 'SMALL',
  `Category` varchar(50) NOT NULL default '',
  `Product` varchar(60) NOT NULL default '',
  `Location` varchar(50) NOT NULL default '',
  `Begin` datetime NOT NULL default '-00-00 00:00:00',
  `End` datetime NOT NULL default '-00-00 00:00:00',
  `Difference` int(8) NOT NULL,
  PRIMARY KEY  (`Code`,`Level`,`Category`,`Product`,`Location`,`Begin`,`End`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


query
insert ignore into hasil1 select awal1.Code, awal1.Level, awal1.Category, 
awal1.Product, awal1.Location, awal1.Begin, akhir1.End, 
time_to_sec(timediff(akhir1.End, awal1.Begin)) as Difference from awal1, akhir1 
where awal1.Code = akhir1.Code and awal1.Category = akhir1.Category and 
awal1.Product = akhir1.Product and awal1.Location = akhir1.Location and 
akhir1.End >= awal1.Begin group by awal1.Begin, awal1.Code, awal1.Category, 
awal1.Product, awal1.Location;

sory if my post messed up, sory for my bad english.


i attached data and this file or u can download at
http://rapidshare.com/files/167784565/up.zip.html


thanks 4 ur advanced



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


Re: [sqlite] database lock owner

2008-11-26 Thread Ronnel P. Maglasang
John Karp wrote:
> On Wed, Nov 26, 2008 at 3:38 AM, Ronnel P. Maglasang
> <[EMAIL PROTECTED]> wrote:
>   
>> Hi All,
>>
>> Is there a way to identify which process currently
>> holding the lock (I am aware of several type locks) of
>> the database? And how long the lock has been held. I am
>> looking for a functionality similar to Unix semaphores. I
>> initially thought that these information are stored in the
>> database, or are they?
>>
>> Thanks,
>> sho
>> 
>
> I've had to deal with the same question. At least on Unix-type
> operating systems, you can use 'lsof ' to get
> some information. Its better than nothing.
>
> One idea is to add some tracing code into sqlite, that would log the
> process and thread ids to a log file whenever the lock changed states.
>
>   
I am experiencing intermittent "database malformed" error when multiple
processes access the database. I was hoping to narrow down to the last
process that holds the lock. I'm thinking to add another level of 
locking for
the meantime until this issue (i think this is a bug) is resolved. Has 
anyone
successfully implemented a workaround or solution to deal with "database
malformed" error?

Thanks


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


[sqlite] Loading database from memory buffer

2008-11-26 Thread Brown, Daniel
Good afternoon list,

Is there any way to open a SQLite databases out of an in memory buffer
rather than an operating system file (via a VFS)?

The runtime environment of one of our platforms does not have local
storage that can be accessed via a normal operating system VFS but via
an interface that accesses very slow secure storage.  This interface
only supports passing files in and out via memory buffers and is
hideously slow.  On our other platforms we load our database into an
completely memory resident database (:memory:) from an database file on
read only storage which we attach to during start up and then detach
once we've finished copying our data into memory.  This approach has
worked quite well so far, as it avoids SQLite attempting to access
storage (which is read only) except during set-up.  So we would quite
like to keep using this approach if possible but are unsure about how to
solve this new problem with working with the buffers coming from or
going into secure storage.

One solution would seem to be to write a new VFS that handles this
reading and writing of memory buffers.  However writing a new VFS would
seem to be quite an time consuming solution, especially as current
solution of using :memory: databases seems to be working except for this
one issue.  It would seem the easier solution would be to copy the data
out of the buffer and into SQLite's memory pages when setting up and to
copy the data from SQLite to the buffer during shutdown but I am unsure
if this functionality already exists or if it does not exist how to
begin implementing it.

Any advice on potential solutions would be most welcome!

Cheers,

Daniel Brown | Software Engineer
"The best laid schemes o' mice an' men, gang aft agley"


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


Re: [sqlite] Error handling anomaly ...

2008-11-26 Thread Igor Tandetnik
Rob Sciuk <[EMAIL PROTECTED]> wrote:
> In a test harness, I'm using a sqlite3_prepare/bind/step/finalize
> sequence to add rows to a table, and then add them again,
> intentionally violating the unique index constraints.  It appears
> that sqlite3_step reports the violation (sqlite3_errorMessage), and
> then the details (the offending column numbers) are only reported
> when I check the error in the sqlite3_finalize() routine ...

http://sqlite.org/c3ref/prepare.html

Igor Tandetnik 



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


[sqlite] Error handling anomaly ...

2008-11-26 Thread Rob Sciuk

In a test harness, I'm using a sqlite3_prepare/bind/step/finalize sequence 
to add rows to a table, and then add them again, intentionally violating 
the unique index constraints.  It appears that sqlite3_step reports the 
violation (sqlite3_errorMessage), and then the details (the offending 
column numbers) are only reported when I check the error in the 
sqlite3_finalize() routine ...

::: Error :::
sq3_step: Error 19 returned from sqlite3_step.
constraint failed

::: Error :::
sq3_finish: Error 19 returned from sqlite3_finalize.
columns sname, fname, dob are not unique

This is not a problem, per se, but in an ideal world, one might handle the 
error one time, and receive all the relevant information at one go.  Is 
there a reason to defer reporting the details until the transaction is 
completed?

Just wondering ...

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Joel Lucsy
On Wed, Nov 26, 2008 at 11:23 AM, Ti Ny <[EMAIL PROTECTED]> wrote:
> Dependency walker fails to load that DLL. Also it reports mess between 
> dependencies (x86 vs. x64), don't understand why when it
> has been compiled as target x64.

If it fails to load, where is this "mess" at?
-- 
Joel Lucsy
"The dinosaurs became extinct because they didn't have a space
program." -- Larry Niven
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Teg
Hello Ti,

I build 32 and 64 bit versions in Windows but, don't use SQLite in a
DLL. I compile the code into my program using a static library. In my
experience, DLL's are really flaky under Vista. Flaky in the sense
that you have to be very particular about where they go. Having them
in the EXE folder is insufficient. I think the "really there" comment
probably hit it on the head.

To avoid all that, you could statically link SQLite into place.

C


Wednesday, November 26, 2008, 11:23:11 AM, you wrote:

TN> Dependency walker fails to load that DLL. Also it reports mess
TN> between dependencies (x86 vs. x64), don't understand why when it
TN> has been compiled as target x64.

TN> Ti Ny

>> From: [EMAIL PROTECTED]
>> To: sqlite-users@sqlite.org
>> Date: Wed, 26 Nov 2008 09:57:46 -0500
>> Subject: Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b
>> 
>> > 
>> > It throws an exception: unable to find entry point sqlite3_open16
>> 
>> Try opening the DLL with Dependency Walker, make sure the entry point *is*
>> there?
>> 
>> - Sherief
>> 
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

TN> _
TN> Invite your mail contacts to join your friends list with Windows Live 
Spaces. It's easy!
TN> 
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
TN> ___
TN> sqlite-users mailing list
TN> sqlite-users@sqlite.org
TN> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Best regards,
 Tegmailto:[EMAIL PROTECTED]

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


Re: [sqlite] Query Crashing SQLite

2008-11-26 Thread Clark Christensen

Older versions result in an SQL error:

SQLite version 3.3.13
Enter ".help" for instructions
sqlite> create table a (b);
sqlite> select max(b) as q from a where q = 1;
SQL error: misuse of aggregate:

Same on Linux, Solaris, and Win32



- Original Message 
From: Daniel Zingaro <[EMAIL PROTECTED]>
To: General Discussion of SQLite Database 
Sent: Wednesday, November 26, 2008 12:18:42 PM
Subject: [sqlite] Query Crashing SQLite

Hi all,

The following session crashes SQLite3.exe 3.6.6.2 on Windows XP:

sqlite> create table a (b);
sqlite> select max(b) as q from a where q = 1;

SQLite prevents me from directly using max(b) in the 'where' clause, but 
I think it gets fooled by the alias.

Thanks,
Dan

___
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] Query Crashing SQLite

2008-11-26 Thread D. Richard Hipp

On Nov 26, 2008, at 3:18 PM, Daniel Zingaro wrote:

> Hi all,
>
> The following session crashes SQLite3.exe 3.6.6.2 on Windows XP:
>
> sqlite> create table a (b);
> sqlite> select max(b) as q from a where q = 1;
>
> SQLite prevents me from directly using max(b) in the 'where' clause,  
> but
> I think it gets fooled by the alias.
>

This is the same problem as ticket #3508.  
http://www.sqlite.org/cvstrac/tktview?tn=3508

Ticket number #3508 has already been fixed, but only in CVS HEAD, not  
in the branch from which 3.6.6.2 was taken.

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] Query Crashing SQLite

2008-11-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

John Karp wrote:
> I can reproduce this on Linux, with version 3.6.5:

Also present in 3.6.6.2.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkttKcACgkQmOOfHg372QQVfACfXxMgixe7jWDNqVk3KcL9fudt
5r0AoI/IAh8eAAMB1uiTsD7BmyPhfqi4
=K54A
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite 3.6.5 slow on windows

2008-11-26 Thread Breeze Meadow
Eric,
 
Thanks for the pragma tip which improves the speed significantly. The single 
insert is under 4 ms now.
 
The only published sqlite performance i found 
is http://www.sqlite.org/speed.html, which is too old. However, assuming the 
performance still holds up, the windows speed seems 10 times of linux, with and 
without synchronization (see section "Test 1: 1000 Inserts" in the linked 
page). 
I wonder if there is a similar benchmark test for windows.

FLX
--- On Tue, 11/25/08, Eric Minbiole <[EMAIL PROTECTED]> wrote:

From: Eric Minbiole <[EMAIL PROTECTED]>
Subject: Re: [sqlite] sqlite 3.6.5 slow on windows
To: [EMAIL PROTECTED], "General Discussion of SQLite Database" 

Date: Tuesday, November 25, 2008, 6:05 PM

> Here is a typical outputs from the program running in debug mode:

Debug builds can be substantially slower.  I would expect at least some
performance improvement with a release build (optimizations on).


> Notice my constraint is these SQL statements must run one by one, not
within a transaction.

Alas, this will dramatically reduce write performance.  Since each insert
statement will now require an explicit disk flush, it will be very slow.  Is
there *really* no way to group multiple writes together?  As you've likely
read elsewhere, doing so can provide orders of magnitude performance
improvements-- well worth the effort to reorganize your architecture a bit.


> 1) are these expected performance on windows?
> 2) if not, what can be done to improve it?

If you really must run the statements individually, you have a few (less than
perfect) alternatives:

- Turn off synchronous writes ("pragma synchronous = OFF").  Though
this will dramatically improve your insert performance, you will be running
without any safety net: If the application crashes or exits during a write, your
database may become (permanently) corrupted.

- The compiler optimizations (above) will likely help somewhat, though not
terribly much.

- A faster (higher RPM) hard drive will help somewhat.


~Eric




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


Re: [sqlite] Query Crashing SQLite

2008-11-26 Thread John Karp
I can reproduce this on Linux, with version 3.6.5:

sqlite>  create table a (b);
sqlite> select max(b) as q from a where q = 1;

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1211238720 (LWP 8893)]
0xb7d4c567 in memcpy () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7d4c567 in memcpy () from /lib/tls/libc.so.6
#1  0xb7e9e6c1 in sqlite3StrAccumAppend (p=0x0, z=0x0, N=-1081252571)
at sqlite3.c:17101
#2  0xb7e9f069 in sqlite3VXPrintf (pAccum=0xbf8d64f0, useExtended=1,
fmt=0xb7eefddc "T", ap=0xbf8d66ac "W\231��8\231\006\b") at
sqlite3.c:17011
#3  0xb7e9faf5 in sqlite3VMPrintf (db=0x805b2f0, zFormat=0xb7eefdc6
"misuse of aggregate: %T", ap=0xbf8d66a8
"$\205\006\bW\231��8\231\006\b")
at sqlite3.c:17160
#4  0xb7e9fdea in sqlite3ErrorMsg (pParse=0xbf8d7450,
zFormat=0xb7eefdc6 "misuse of aggregate: %T") at sqlite3.c:18515
#5  0xb7eca626 in sqlite3ExprCodeTarget (pParse=0xbf8d7450,
pExpr=0x8068508, target=5) at sqlite3.c:54797
#6  0xb7ecacb3 in sqlite3ExprCode (pParse=0xbf8d7450,
pExpr=0xbf8d6525, target=5) at sqlite3.c:55145
#7  0xb7ecaf37 in codeAlias (pParse=0xbf8d7450, iAlias=1,
pExpr=0x8068508, target=4) at sqlite3.c:54539
#8  0xb7eca1f5 in sqlite3ExprCodeTarget (pParse=0xbf8d7450,
pExpr=0x8068300, target=4) at sqlite3.c:54650
#9  0xb7eca652 in sqlite3ExprCodeTemp (pParse=0xbf8d7450,
pExpr=0x8068300, pReg=0xbf8d6a34) at sqlite3.c:55126
#10 0xb7eca6bc in codeCompareOperands (pParse=0xbf8d7450,
pLeft=0xbf8d6525, pRegLeft=0xbf8d6525, pFreeLeft=0xbf8d6a34,
pRight=0x8068710,
pRegRight=0xbf8d6525, pFreeRight=0xbf8d6a3c) at sqlite3.c:53050
#11 0xb7ecaad2 in sqlite3ExprIfFalse (pParse=0xbf8d7450,
pExpr=0x8068778, dest=-5, jumpIfNull=8) at sqlite3.c:3
#12 0xb7eceb7f in sqlite3WhereBegin (pParse=0xbf8d7450,
pTabList=0x8068918, pWhere=0xbf8d6e44, ppOrderBy=0xbf8d71f4, wflags=2
'\002') at sqlite3.c:78615
#13 0xb7ec7611 in sqlite3Select (pParse=0xbf8d7450, p=0x8067fc0,
pDest=0xbf8d7370) at sqlite3.c:72840
#14 0xb7ed3eeb in sqlite3Parser (yyp=0x806a5a0, yymajor=1, yyminor={z
= 0x6 , dyn = 0, n = 3}, pParse=0x6) at
sqlite3.c:81055
#15 0xb7ed55c0 in sqlite3RunParser (pParse=0xbf8d7450, zSql=0x8069080
"select max(b) as q from a where q = 1;", pzErrMsg=0xbf8d744c) at
sqlite3.c:82554
#16 0xb7ed6640 in sqlite3LockAndPrepare (db=0x805b2f0, zSql=0x8069080
"select max(b) as q from a where q = 1;", nBytes=-1, saveSqlFlag=0,
ppStmt=0xbf8d7674, pzTail=0xbf8d7678) at sqlite3.c:68577
#17 0xb7ed70da in sqlite3_exec (db=0x805b2f0, zSql=0x8069080 "select
max(b) as q from a where q = 1;", xCallback=0x8049910 ,
pArg=0xbf8d7850,
pzErrMsg=0xbf8d76dc) at sqlite3.c:65566
#18 0x0804b134 in process_input (p=0xbf8d7850, in=0x0) at shell.c:1735
#19 0x0804d4ab in main (argc=1, argv=0xbf8d8e04) at shell.c:2078

-John

On Wed, Nov 26, 2008 at 2:18 PM, Daniel Zingaro
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> The following session crashes SQLite3.exe 3.6.6.2 on Windows XP:
>
> sqlite> create table a (b);
> sqlite> select max(b) as q from a where q = 1;
>
> SQLite prevents me from directly using max(b) in the 'where' clause, but
> I think it gets fooled by the alias.
>
> Thanks,
> Dan
>
> ___
> 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] Query Crashing SQLite

2008-11-26 Thread Daniel Zingaro
Hi all,

The following session crashes SQLite3.exe 3.6.6.2 on Windows XP:

sqlite> create table a (b);
sqlite> select max(b) as q from a where q = 1;

SQLite prevents me from directly using max(b) in the 'where' clause, but 
I think it gets fooled by the alias.

Thanks,
Dan

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


[sqlite] Generating CRC values for tables

2008-11-26 Thread Brown, Daniel
Good Morning list,

Is there any functionality built into SQLite to generate CRC values for
tables?  We would like to be able to verify that the contents of the
table we just updated matches the intended contents.  Currently using
our old database solution we generate a CRC value for each table and
compare them.  Is there similar functionality in SQLite?

Cheers,

Daniel Brown | Software Engineer 
"The best laid schemes o' mice an' men, gang aft agley"


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


Re: [sqlite] Adobe AIR Version Issue(?)

2008-11-26 Thread Dusan Gibarac
Ignore this, did not read all the comments...

Dusan.



Dusan Gibarac wrote:
> from the message (missing cftable) one can conclude that AIR is looking 
> for ColdFusion database, not SQLite one;
> So, some settings in (probably) FLEX has to be adjusted.
>
> Dusan.
>
>
>
> phillipm wrote:
>   
>> tiggyboo wrote:
>>   
>> 
>>> I created and populated a table via sqlite3 on a Mac OSX machine, and have
>>> no problem working with it  from the sqlite3 prompt.  However, when I try
>>> to access the sole table (named cftable) in this database via a very
>>> simple Adobe AIR application I'm working on, I get this error:
>>>
>>> Error #3115: SQL Error.', details:'no such table: cftable'
>>>
>>> My question - would this be typical of a version conflict for sqlite,
>>> i.e., is the latest release of AIR perhaps using an embedded sqlite that
>>> is not compatible with what I have (3.1.3) on my machine?  I have  yet to
>>> determine which version is embedded in AIR.
>>>
>>> Thanks,
>>> Al
>>>
>>> 
>>>   
>> Just wondering if you resolved this issue - I'm experiencing the same
>> situation. Very simple project, small database in the project folder?
>>
>> Any help appreciated, thanks
>>
>>
>> Phil
>>   
>> 
> ___
> 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] Adobe AIR Version Issue(?)

2008-11-26 Thread Dusan Gibarac
from the message (missing cftable) one can conclude that AIR is looking 
for ColdFusion database, not SQLite one;
So, some settings in (probably) FLEX has to be adjusted.

Dusan.



phillipm wrote:
>
> tiggyboo wrote:
>   
>> I created and populated a table via sqlite3 on a Mac OSX machine, and have
>> no problem working with it  from the sqlite3 prompt.  However, when I try
>> to access the sole table (named cftable) in this database via a very
>> simple Adobe AIR application I'm working on, I get this error:
>>
>> Error #3115: SQL Error.', details:'no such table: cftable'
>>
>> My question - would this be typical of a version conflict for sqlite,
>> i.e., is the latest release of AIR perhaps using an embedded sqlite that
>> is not compatible with what I have (3.1.3) on my machine?  I have  yet to
>> determine which version is embedded in AIR.
>>
>> Thanks,
>> Al
>>
>> 
>
> Just wondering if you resolved this issue - I'm experiencing the same
> situation. Very simple project, small database in the project folder?
>
> Any help appreciated, thanks
>
>
> Phil
>   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] A minor suggestion about LoadLibraryEx

2008-11-26 Thread barabbas
Hi all,

I recently realized that sqlite extension DLL loading could use a little
help from LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH),
unless extension DLLs were always put in the system directory. The only
drawback of this function is that doesn't support Windows CE and Windows 9x.

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


[sqlite] SQLite version 3.6.6.2

2008-11-26 Thread D . Richard Hipp
SQLite version 3.6.6.2 is now available for download on the SQLite  
website

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

Version 3.6.6.2 fixes a bug that could potentially lead to database  
corruption.  The bug was introduced in SQLite version 3.6.6.  The bug  
was discovered by an assert() failure during stress testing and has  
not been seen in the wild.

Database corruption resulting from this bug is still only a  
theoretical possibility.  Despite focused efforts, we have so far been  
unable to generate a test case that actually causes database  
corruption.  Nevertheless, the nature of the bug suggests that such a  
test should be possible, even if it is difficult to devise.  The fact  
we have have been unable in creating a test case suggests the bug is  
unlikely to be causing problems in the real world.  Even so, we are  
issuing this branch release out of an abundance of caution and  
recommending that all users of SQLite version 3.6.6 and 3.6.6.1  
upgrade to version 3.6.6.2.


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 for embedded devices

2008-11-26 Thread Doug Currie

On Nov 25, 2008, at 1:44 PM, Igor Augusto Guzzo wrote:

> I get an ARM based embedded system (AT91SAM9260 - ATMEL), linux based,
> with uclibc library and my code, developed in C with the sqlite3
> library, runs fine only in my host linux (Fedora).
>
> Firstly, I compiled the code on Makefile project (the main line is...
> arm-linux-gcc -o $(PROJECT) $(PROJECT).c -L/usr/local/lib -lsqlite3)
> And get the error...
> /opt/eldk/usr/bin/../lib/gcc/arm-linux/4.0.0/../../../../arm-linux/ 
> bin/ld:
> skipping incompatible /usr/local/lib/libsqlite3.so when searching for
> -lsqlite3

Did you use the same compiler to make /usr/local/lib/libsqlite3.so  
that you are using to build your application? What makefile did you  
use to build /usr/local/lib/libsqlite3.so ?

e

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


Re: [sqlite] Rtree coordinate limitations ?

2008-11-26 Thread Oyvind Idland
Hi,

I made another post related to this since the topic changed.

Problem was solved using sqlite3_prepare_v2() instead of sqlite3_prepare().

All is fine now ! :)


Oyvind



On Wed, Nov 26, 2008 at 5:41 PM, D. Richard Hipp <[EMAIL PROTECTED]> wrote:

>
> On Nov 26, 2008, at 11:02 AM, Oyvind Idland wrote:
>
> > Seems my problem are related to sqlite not handling multiple prepared
> > statements properly.
>
>
> Before every release of SQLite, we run scripts that do literally
> millions of prepared statements.  They all work correctly before we
> make the release.  And SQLite prepared statements are used in
> thousands of consumer products like iTunes and Skype and Adobe Acrobat
> reader, all without given any trouble.  So I'm guessing the problem is
> more likely to be found in your code than in the prepared statement
> handling of SQLite.  Perhaps if you give a concrete example of what is
> going wrong in your application, someone might be able to suggest a fix.
>
> D. Richard Hipp
> [EMAIL PROTECTED]
>
>
>
> ___
> 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] Rtree coordinate limitations ?

2008-11-26 Thread D. Richard Hipp

On Nov 26, 2008, at 11:02 AM, Oyvind Idland wrote:

> Seems my problem are related to sqlite not handling multiple prepared
> statements properly.


Before every release of SQLite, we run scripts that do literally  
millions of prepared statements.  They all work correctly before we  
make the release.  And SQLite prepared statements are used in  
thousands of consumer products like iTunes and Skype and Adobe Acrobat  
reader, all without given any trouble.  So I'm guessing the problem is  
more likely to be found in your code than in the prepared statement  
handling of SQLite.  Perhaps if you give a concrete example of what is  
going wrong in your application, someone might be able to suggest a fix.

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] database lock owner

2008-11-26 Thread John Karp
On Wed, Nov 26, 2008 at 3:38 AM, Ronnel P. Maglasang
<[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Is there a way to identify which process currently
> holding the lock (I am aware of several type locks) of
> the database? And how long the lock has been held. I am
> looking for a functionality similar to Unix semaphores. I
> initially thought that these information are stored in the
> database, or are they?
>
> Thanks,
> sho

I've had to deal with the same question. At least on Unix-type
operating systems, you can use 'lsof ' to get
some information. Its better than nothing.

One idea is to add some tracing code into sqlite, that would log the
process and thread ids to a log file whenever the lock changed states.

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


Re: [sqlite] Multiple prepared statements

2008-11-26 Thread Oyvind Idland
*argh*

more or less my bad, sqlite3_prepare_v2() instead of sqlite3_prepare()
solved it.

Oyvind.



On Wed, Nov 26, 2008 at 5:29 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote:

> Oyvind Idland <[EMAIL PROTECTED]>
> wrote:
> > I am using two prepared statements in my code (that does INSERT),
> > following the pattern
> >
> > prepare(stmt1)
> > prepare(stmt2)
> >
> > while (xx)
> > {
> >   bind(stmt1)
> >  step(stmt1)
> >  reset(stmt1)
> >
> >   bind(stmt2)
> >  step(stmt2)
> >  reset(stmt2)
> > }
> >
> > The first iteration works, but int the second step() fails with code
> > 1.
>
> There's nothing wrong with the pattern. The problem must be in your code
> actually implementing the pattern.
>
> > I am thinking of trying to add both INSERT's inside one statement
> > insted, hopefully that will work better..
>
> That won't work. sqlite3_prepare parses only one statement, up to the
> first semicolon.
>
> 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] Multiple prepared statements

2008-11-26 Thread Igor Tandetnik
Oyvind Idland <[EMAIL PROTECTED]>
wrote:
> I am using two prepared statements in my code (that does INSERT),
> following the pattern
>
> prepare(stmt1)
> prepare(stmt2)
>
> while (xx)
> {
>   bind(stmt1)
>  step(stmt1)
>  reset(stmt1)
>
>   bind(stmt2)
>  step(stmt2)
>  reset(stmt2)
> }
>
> The first iteration works, but int the second step() fails with code
> 1.

There's nothing wrong with the pattern. The problem must be in your code 
actually implementing the pattern.

> I am thinking of trying to add both INSERT's inside one statement
> insted, hopefully that will work better..

That won't work. sqlite3_prepare parses only one statement, up to the 
first semicolon.

Igor Tandetnik



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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Ti Ny

Dependency walker fails to load that DLL. Also it reports mess between 
dependencies (x86 vs. x64), don't understand why when it
has been compiled as target x64.

Ti Ny

> From: [EMAIL PROTECTED]
> To: sqlite-users@sqlite.org
> Date: Wed, 26 Nov 2008 09:57:46 -0500
> Subject: Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b
> 
> > 
> > It throws an exception: unable to find entry point sqlite3_open16
> 
> Try opening the DLL with Dependency Walker, make sure the entry point *is*
> there?
> 
> - Sherief
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Multiple prepared statements

2008-11-26 Thread Oyvind Idland
Hi,

according to documentation,

"An application is allows to prepare multiple SQL statements in advance and
evaluate them as needed. There is no arbitrary
limit to the number of outstanding prepared statements."

I am using two prepared statements in my code (that does INSERT), following
the pattern

prepare(stmt1)
prepare(stmt2)

while (xx)
{
   bind(stmt1)
  step(stmt1)
  reset(stmt1)

   bind(stmt2)
  step(stmt2)
  reset(stmt2)
}

The first iteration works, but int the second step() fails with code 1.  I
have also double-checked that I
give the correct statement objects etc. Commenting out one of them works.

I running 3.6.6.1 on WinXP.

I am thinking of trying to add both INSERT's inside one statement insted,
hopefully that will work better..


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


Re: [sqlite] Rtree coordinate limitations ?

2008-11-26 Thread Oyvind Idland
Seems my problem are related to sqlite not handling multiple prepared
statements properly.


Oyvind



On Tue, Nov 25, 2008 at 6:25 PM, Oyvind Idland <[EMAIL PROTECTED]>wrote:

> Thanks for the reply,
>
> I misunderstood the concept of dimensions here (i have fairly good
> knowledge about r-trees)
>
> Still i am stuck with binding values, and cant really figure out why
> (possibly been looking
> myself blind on the code ?)
>
> Here is a portion of the code that shows what I do, the bind on index 3
> fails:
>
>
> sqlite3_exec(db, "CREATE VIRTUAL TABLE points_index USING rtree(id, xmin,
> xmax, ymin, ymax);", callback, 0, &errmsg);
>
> char *sql_idx = "INSERT INTO points_index (id, xmin, xmax, ymin, ymax)
> VALUES (?, ?, ?, ?, ?);";
> sqlite3_stmt *stmt_idx = NULL;
> tail = NULL;
> rc = sqlite3_prepare(db, sql, -1, &stmt_idx, &tail);
>
> for(i=0; i {
> /*  */
> rc = sqlite3_bind_int(stmt_idx, 1, i+1);
> if( rc!=SQLITE_OK )
>   return sqlerror(db);
> rc = sqlite3_bind_double(stmt_idx, 2, blob.x);
> if( rc!=SQLITE_OK )
>   return sqlerror(db);
> rc = sqlite3_bind_double(stmt_idx, 3, blob.x);
> if( rc!=SQLITE_OK )
>   return sqlerror(db);
> rc = sqlite3_bind_double(stmt_idx, 4, blob.y);
> if( rc!=SQLITE_OK )
>   return sqlerror(db);
> rc = sqlite3_bind_double(stmt_idx, 5, blob.y);
> if( rc!=SQLITE_OK )
>   return sqlerror(db);
> /*  */
> }
>
>
> Oyvind
>
>
>
>
>
> On Tue, Nov 25, 2008 at 4:25 PM, Jay A. Kreibich <[EMAIL PROTECTED]> wrote:
>
>> On Tue, Nov 25, 2008 at 01:26:48PM +0100, Oyvind Idland scratched on the
>> wall:
>> > Hi,
>> >
>> > as far as I can see from docs, the r-tree extension uses 32-bit floats
>> to
>> > store rectangles.
>> >
>> > However, when I try to insert this one
>> >
>> > INSERT INTO points_index (id, x, y) VALUES (3, 731.293, 74.463);
>> >
>> > i get "SQL error: constraint failed".
>> >
>> > Reducing the x to 31.293 works.
>> >
>> > Is the r-tree limitied to WGS84 latitude/longitude coordinates ?
>>
>>   From this and your other post, I think you're missing a fundamental
>>  point about the R-tree extension: it is designed to hold ranges of
>>  data, not points.  An R-tree with three values defines a
>>  one-dimensional space not as (id, x, y), but as (id, min_x, max_x).
>>
>>  If you want to do 2D coords, such as lat/long, you need an R-tree
>>  with five columns: (id, x_min, x_max, y_min, y_max).  You can put
>>  equal values in to define points, or you can define "boxes" of space.
>>  Either way, it must be true that (x_min <= x_max) (and so on), hence
>>  the bind and constraint errors you're getting.
>>
>>-j
>>
>> --
>> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>>
>>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to copy a big table in limited memory

2008-11-26 Thread Eric Minbiole
>   I use sqlite3 on resource limited embedded devices, and  it
> provide only 250K memory for sqlite.
> Now, I have a table named test_tab,whose size is 300K bytes.
> If I want to copy this big table to another table, this operation will fail
> because of limitde memory.

The first thing I would try to do is to reduce the SQLite page cache. 
By default, it is set for 2000 pages.  At about 1.5K RAM each, that is a 
peak of 3MB.  When you copy the big table, it may exceed your 250KB 
allocation limit by trying to cache the whole table into RAM.

In your case, you might reduce the page cache to 100 pages or so.  (Of 
course, this may have a performance impact.)  This can be done via the 
pragma cache_size directive.  In addition, you will probably want to 
ensure that your temp_store (for temporary tables, etc) is set to FILE. 
  See http://www.sqlite.org/pragma.html for more info.

Finally, take a look at the lookaside memory allocator.  By default, it 
creates a working buffer of 50KB per connection.  Reducing this buffer 
may make more room for page cache (above).  You'll have to find a good 
balance that works for your system.  See http://www.sqlite.org/malloc.html .

Hope this helps,
  Eric
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Adobe AIR sqlite - access to sqlite_master

2008-11-26 Thread Ben Marchbanks
ignore this post - found the error of my ways !
*Ben Marchbanks*

www.magazooms.com 
Signature
Email: [EMAIL PROTECTED] 
Phone: (864) 284.9918


Ben Marchbanks wrote:
> I am having trouble getting a table description from a SQLite 3.4.2 database
> that was originally created on Linux system using PHP-PDO.
>
> I migrated this DB to an Adobe AIR 1.1 application where I understand 
> the AIR implement is somehow different.
>
> I am trying to use the basic call to describe the table.
>
> select table_name from sqlite_master where type='table' >>  throws ERROR 
> 3115.
>
> Using the build-in methods from AIR to get table schema also fails. 
> (Same method works fine on DB
> create with AIR)
>
> _sqlConnection.loadSchema();
> var schemaResult:SQLSchemaResult = _sqlConnection.getSchemaResult();
> var mytableSchema = schemaResult.tables
>
> trace(mytableSchema) // = "undefined"
>
> Any ideas on a workaround ?
>
>
>   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to copy a big table in limited memory

2008-11-26 Thread Griggs, Donald
 Hi, Jack,

Regarding:  "I use sqlite3 on resource limited embedded devices, and
it provide only 250K memory for sqlite.  Now, I have a table named
test_tab,whose size is 300K bytes."

Do you mean 250K bytes of persistent memory (flash file system) for the
database, or do you mean 250K bytes of RAM memory for sqlite and it's
cache to run in?  

I'm not sure I'm qualified to answer, but you might look at:
-- compressing your data before storing in the database, though
you'd need at least some cleartext if you need indices.
-- removing any indicies you can do without (or shorten the length
of an essential one).
-- More drastic measures such as using a PRAGMA to disable the
rollback journal.

*If* 250Kbytes is all you have for persistent storage, you might need to
consider whether
-- Sqlite, even though very "light," may be more than your
application can tolerate.
-- You'll need heavy compression to make this work with even simple
data storage; maybe the memory on the device is simply undersized for
the requirements.

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Sherief N. Farouk
> 
> It throws an exception: unable to find entry point sqlite3_open16

Try opening the DLL with Dependency Walker, make sure the entry point *is*
there?

- Sherief

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Ti Ny

For more information:

I am using Visual Studio 2008 SP1 to compile 64bit SQLite3.

Ti Ny

> From: [EMAIL PROTECTED]
> To: sqlite-users@sqlite.org
> Date: Wed, 26 Nov 2008 14:26:03 +0100
> Subject: Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b
> 
> 
> I am trying to build 64bit version of SQLite on Windows Vista, but I am 
> facing some severe troubles with it. 
> It seems I am unable to get it to work - I have 64bit build and if I try to 
> invoke some function it fails that
> module cannot be found. I assume there are some missing dependencies, however 
> using dependency walker
> it seems all of them are there. Even it shows x86 dependencies, but I assume 
> WOW64 should handle it.
> 
> Is it even possible to compile 64bit version of SQLite with the current 
> source files? I do not want to try if
> my head is stronger than a wall ;-) Thanks.
> 
> Ti Ny.
> 
> > Date: Wed, 26 Nov 2008 01:04:46 +0100
> > From: [EMAIL PROTECTED]
> > To: sqlite-users@sqlite.org
> > Subject: Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b
> > 
> > That'd happen if you use the 32bit DLL with 64bit application... F.
> > 
> > On Tue, Nov 25, 2008 at 1:59 PM, Ti Ny <[EMAIL PROTECTED]> wrote:
> > >
> > > I am getting an exception: An attempt was made to load a program with a 
> > > incorrect format. (HRESULT: 0x8007000B) when I am trying to use 
> > > sqlite3_open16 on Windows Vista 64b. On 32b or XP 32bit it works 
> > > correctly.


_
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Adobe AIR sqlite - access to sqlite_master

2008-11-26 Thread Ben Marchbanks
I am having trouble getting a table description from a SQLite 3.4.2 database
that was originally created on Linux system using PHP-PDO.

I migrated this DB to an Adobe AIR 1.1 application where I understand 
the AIR implement is somehow different.

I am trying to use the basic call to describe the table.

select table_name from sqlite_master where type='table' >>  throws ERROR 
3115.

Using the build-in methods from AIR to get table schema also fails. 
(Same method works fine on DB
create with AIR)

_sqlConnection.loadSchema();
var schemaResult:SQLSchemaResult = _sqlConnection.getSchemaResult();
var mytableSchema = schemaResult.tables

trace(mytableSchema) // = "undefined"

Any ideas on a workaround ?


-- 
*Ben Marchbanks*

www.magazooms.com 
Signature
Email: [EMAIL PROTECTED] 
Phone: (864) 284.9918
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite for embedded devices

2008-11-26 Thread Igor Augusto Guzzo
I get an ARM based embedded system (AT91SAM9260 - ATMEL), linux based,
with uclibc library and my code, developed in C with the sqlite3
library, runs fine only in my host linux (Fedora).

Firstly, I compiled the code on Makefile project (the main line is...
arm-linux-gcc -o $(PROJECT) $(PROJECT).c -L/usr/local/lib -lsqlite3)
And get the error...
/opt/eldk/usr/bin/../lib/gcc/arm-linux/4.0.0/../../../../arm-linux/bin/ld:
skipping incompatible /usr/local/lib/libsqlite3.so when searching for
-lsqlite3
/opt/eldk/usr/bin/../lib/gcc/arm-linux/4.0.0/../../../../arm-linux/bin/ld:
skipping incompatible /usr/local/lib/libsqlite3.a when searching for
-lsqlite3
/opt/eldk/usr/bin/../lib/gcc/arm-linux/4.0.0/../../../../arm-linux/bin/ld:
cannot find -lsqlite3
collect2: ld returned 1 exit status
make: ** [test_arm] Erro 1

My second attempt was to run the arm-linux-gcc without makefiles...

[test_arm]# arm-linux-gcc test_arm.c -o test_arm

/tmp/ccK8a2yE.o: In function `select_stmt':
test_arm.c:(.text+0x1b8): undefined reference to `sqlite3_exec'
/tmp/ccK8a2yE.o: In function `sql_stmt':
test_arm.c:(.text+0x248): undefined reference to `sqlite3_exec'
/tmp/ccK8a2yE.o: In function `main':
test_arm.c:(.text+0x4a0): undefined reference to `sqlite3_open'
test_arm.c:(.text+0x548): undefined reference to `sqlite3_close'
collect2: ld returned 1 exit status

What can I do to run this code on ARM?
Any help or suggestion will be welcome!

Best Regards,
Igor Guzzo
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Ti Ny

I am trying to build 64bit version of SQLite on Windows Vista, but I am facing 
some severe troubles with it. 
It seems I am unable to get it to work - I have 64bit build and if I try to 
invoke some function it fails that
module cannot be found. I assume there are some missing dependencies, however 
using dependency walker
it seems all of them are there. Even it shows x86 dependencies, but I assume 
WOW64 should handle it.

Is it even possible to compile 64bit version of SQLite with the current source 
files? I do not want to try if
my head is stronger than a wall ;-) Thanks.

Ti Ny.

> Date: Wed, 26 Nov 2008 01:04:46 +0100
> From: [EMAIL PROTECTED]
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b
> 
> That'd happen if you use the 32bit DLL with 64bit application... F.
> 
> On Tue, Nov 25, 2008 at 1:59 PM, Ti Ny <[EMAIL PROTECTED]> wrote:
> >
> > I am getting an exception: An attempt was made to load a program with a 
> > incorrect format. (HRESULT: 0x8007000B) when I am trying to use 
> > sqlite3_open16 on Windows Vista 64b. On 32b or XP 32bit it works correctly.


_
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] how to copy a big table in limited memory

2008-11-26 Thread Jack g
 November 26, 2008
Dear all,

  I use sqlite3 on resource limited embedded devices, and  it
provide only 250K memory for sqlite.
Now, I have a table named test_tab,whose size is 300K bytes.
If I want to copy this big table to another table, this operation will fail
because of limitde memory.
The SQL sentence  as follows:

--
/*
sqlite3 *db;char *sql;
tab2 is a empty table,and it has the same structure as test_tab
   */
 ...
 ...
sql = "insert into tab2 select * from test_tab order by id DESC;";
sqlite3_exec(db, sql, 0, 0, 0);

--
How can do?

Can anyone answer this for me?  Or give me any information .
Thank you for your reply, thanks very much!

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Filip Navara
That'd happen if you use the 32bit DLL with 64bit application... F.

On Tue, Nov 25, 2008 at 1:59 PM, Ti Ny <[EMAIL PROTECTED]> wrote:
>
> I am getting an exception: An attempt was made to load a program with a 
> incorrect format. (HRESULT: 0x8007000B) when I am trying to use 
> sqlite3_open16 on Windows Vista 64b. On 32b or XP 32bit it works correctly.
>
> _
> Invite your mail contacts to join your friends list with Windows Live Spaces. 
> It's easy!
> http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
> ___
> 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] Arranging of ids in Sqlite3

2008-11-26 Thread Igor Tandetnik
"Nikhil Kansal" <[EMAIL PROTECTED]>
wrote in message
news:[EMAIL PROTECTED]
> I am using id as a integer primary key...
> like
> CREATE TABLE history( id INTEGER PRIMARY KEY, filename varchar NOT
> NULL) now if i delete a entry from this table and add a entry again
> then a id will be left blank in between.

Why does it bother you? Why do you want to avoid non-sequential IDs? 
What problem do you believe they cause?

Igor Tandetnik



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


Re: [sqlite] database lock owner

2008-11-26 Thread Dan

On Nov 26, 2008, at 4:38 PM, Ronnel P. Maglasang wrote:

> Hi All,
>
> Is there a way to identify which process currently
> holding the lock (I am aware of several type locks) of
> the database? And how long the lock has been held. I am
> looking for a functionality similar to Unix semaphores. I
> initially thought that these information are stored in the
> database, or are they?

No. If this is possible, it probably involves some operating
system API to query file locks.

Dan.

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Ti Ny

It throws an exception: unable to find entry point sqlite3_open16

Ti Ny

> From: [EMAIL PROTECTED]
> To: sqlite-users@sqlite.org
> Date: Wed, 26 Nov 2008 11:39:49 +0100
> Subject: Re: [sqlite] SPAM:   sqlite3_open16 fails on Windows Vista 64b
> 
> 
> I did the 64bit build of SQLite3, but I am still getting the same error on 
> 64bit system :(
> 
> Ti Ny
> 
> > From: [EMAIL PROTECTED]
> > To: sqlite-users@sqlite.org
> > Date: Tue, 25 Nov 2008 10:27:28 -0700
> > Subject: Re: [sqlite] SPAM:   sqlite3_open16 fails on Windows Vista 64b
> > 
> > This can happen if you're accessing the precompiled sqlite library from a
> > 64-bit application.  The binary provided by sqlite.org is 32-bit.  A lot of
> > .NET managed people get tripped by this, since .NET programs are (by
> > default) compiled as "Any CPU" which means on a 64-bit machine, the .NET
> > program runs in 64-bit.
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Ti Ny
> > Sent: Tuesday, November 25, 2008 6:00 AM
> > To: sqlite-users@sqlite.org
> > Subject: SPAM: [sqlite] sqlite3_open16 fails on Windows Vista 64b
> > 
> > 
> > I am getting an exception: An attempt was made to load a program with a
> > incorrect format. (HRESULT: 0x8007000B) when I am trying to use
> > sqlite3_open16 on Windows Vista 64b. On 32b or XP 32bit it works correctly.
> > 
> > _
> > Invite your mail contacts to join your friends list with Windows Live
> > Spaces. It's easy!
> > http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&;
> > mkt=en-us
> > ___
> > 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
> 
> _
> Discover the new Windows Vista
> http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Arranging of ids in Sqlite3

2008-11-26 Thread Nikhil Kansal
But if I delete a chunk of data then how can I know the id number.

Nikhil

On Wed, Nov 26, 2008 at 4:08 PM, Martin Engelschalk <
[EMAIL PROTECTED]> wrote:

> Hi,
>
> after a
> delete from history where id = 15
> you could do a
> update history set id = id - 1 where id > 15
>
> However, it is not a good idea to change a primary key, especially if
> there are other data in other tables depending on it.
>
> Martin
>
> Nikhil Kansal wrote:
> > Hi,
> >
> > I am using id as a integer primary key...
> > like
> > CREATE TABLE history( id INTEGER PRIMARY KEY, filename varchar NOT NULL)
> > now if i delete a entry from this table and add a entry again then a id
> will
> > be left blank in between.
> >
> > Can we rearrange this ID.
> >
> > Regards,
> > Nikhil
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
>
> --
>
> * Codeswift GmbH *
> Traunstr. 30
> A-5026 Salzburg-Aigen
> Tel: +49 (0) 8662 / 494330
> Mob: +49 (0) 171 / 4487687
> Fax: +49 (0) 12120 / 204645
> [EMAIL PROTECTED]
> www.codeswift.com / www.swiftcash.at
>
> Codeswift Professional IT Services GmbH
> Firmenbuch-Nr. FN 202820s
> UID-Nr. ATU 50576309
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Nikhil Kumar Kansal
Software Engineer,
Mango Technologies,
Jaipur
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SPAM: sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Ti Ny

I did the 64bit build of SQLite3, but I am still getting the same error on 
64bit system :(

Ti Ny

> From: [EMAIL PROTECTED]
> To: sqlite-users@sqlite.org
> Date: Tue, 25 Nov 2008 10:27:28 -0700
> Subject: Re: [sqlite] SPAM:   sqlite3_open16 fails on Windows Vista 64b
> 
> This can happen if you're accessing the precompiled sqlite library from a
> 64-bit application.  The binary provided by sqlite.org is 32-bit.  A lot of
> .NET managed people get tripped by this, since .NET programs are (by
> default) compiled as "Any CPU" which means on a 64-bit machine, the .NET
> program runs in 64-bit.
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Ti Ny
> Sent: Tuesday, November 25, 2008 6:00 AM
> To: sqlite-users@sqlite.org
> Subject: SPAM: [sqlite] sqlite3_open16 fails on Windows Vista 64b
> 
> 
> I am getting an exception: An attempt was made to load a program with a
> incorrect format. (HRESULT: 0x8007000B) when I am trying to use
> sqlite3_open16 on Windows Vista 64b. On 32b or XP 32bit it works correctly.
> 
> _
> Invite your mail contacts to join your friends list with Windows Live
> Spaces. It's easy!
> http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&;
> mkt=en-us
> ___
> 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

_
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Arranging of ids in Sqlite3

2008-11-26 Thread Martin Engelschalk
Hi,

after a
delete from history where id = 15
you could do a
update history set id = id - 1 where id > 15

However, it is not a good idea to change a primary key, especially if 
there are other data in other tables depending on it.

Martin

Nikhil Kansal wrote:
> Hi,
>
> I am using id as a integer primary key...
> like
> CREATE TABLE history( id INTEGER PRIMARY KEY, filename varchar NOT NULL)
> now if i delete a entry from this table and add a entry again then a id will
> be left blank in between.
>
> Can we rearrange this ID.
>
> Regards,
> Nikhil
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   

-- 

* Codeswift GmbH *
Traunstr. 30
A-5026 Salzburg-Aigen
Tel: +49 (0) 8662 / 494330
Mob: +49 (0) 171 / 4487687
Fax: +49 (0) 12120 / 204645
[EMAIL PROTECTED]
www.codeswift.com / www.swiftcash.at

Codeswift Professional IT Services GmbH
Firmenbuch-Nr. FN 202820s
UID-Nr. ATU 50576309

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


[sqlite] Arranging of ids in Sqlite3

2008-11-26 Thread Nikhil Kansal
Hi,

I am using id as a integer primary key...
like
CREATE TABLE history( id INTEGER PRIMARY KEY, filename varchar NOT NULL)
now if i delete a entry from this table and add a entry again then a id will
be left blank in between.

Can we rearrange this ID.

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


[sqlite] database lock owner

2008-11-26 Thread Ronnel P. Maglasang
Hi All,

Is there a way to identify which process currently
holding the lock (I am aware of several type locks) of
the database? And how long the lock has been held. I am
looking for a functionality similar to Unix semaphores. I
initially thought that these information are stored in the
database, or are they?

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