Amy Gibbs | 20 Aug 12:42

sqlite 3 and php

I'm trying to use php to maniupltate an sqlite database using the  
following code, but it doesn't seem to be running the update query.  
I'm not getting any error, but the datbase values are not changing.

Can anyone help?

<?php
error_reporting(E_ALL);

$inv=file('audit.txt');
$sesfile = "wtc.sqlite3";

$sesdb = new PDO('sqlite:wtc.sqlite3');

$query="SELECT ZNAME, ZQUANTITY, ZPRODUCTID FROM ZITEM WHERE  
ZCategory != 14";

$statement= $sesdb->query($query);
$result=$statement->fetchAll();
$statement=null;

foreach ($result as $product) {
$prodname=$product[0];
$prodqty = $product[1];
$prodid=$product[2];

$sql = "UPDATE ZITEM SET ZQUANTITY=0 WHERE ZPRODUCTID={$prodid}";
$sesdb->exec($sql);

$sesdb2 = null;
(Continue reading)

Kershaw, Anthony (UK | 20 Aug 10:12

Problems building for VxWorks...


Hi,
Have been trying to compile (and run) the amalgamated version of sqlite
3.6.1 for VxWorks <http://www.sqlite.org/cvstrac/wiki?p=VxWorks>  5.5,
which is proving quite trouble-some. 

I am currently using these switches 
-DSQLITE_OMIT_BUILTIN_TEST 
-DSQLITE_TEMP_STORE=3 
-DSQLITE_HOMEGROWN_RECURSIVE_MUTEX 
-DSQLITE_OMIT_AUTOVACUUM 
-DSQLITE_OMIT_LOAD_EXTENSION 
-DSQLITE_OMIT_LOCALTIME 
-DSQLITE_OMIT_TCL_VARIABLE 
-DNO_GETTOD 

Which will allow it to compile, but there are missing symbols, mainly
because they don't occur in vxworks, the following functions don't
exist. 
fctrl
dup
fsync
access
getpid 

Any work arounds people could think of would be greatly appreciated. I
appreciate this heavily hits the locking mechanism code within sqlite...

Regards,
  Ant
(Continue reading)

Jeffrey Needle | 20 Aug 06:30

Help with Sqlite

I'm using the install of Firefox that comes with the Wubi install of
Linux.  I like sqlite, but have a little problem.  Perhaps someone can
help.

When I add a new record to a database, an entry screen comes up with my
fields and the ability to enter the new record.  But the information I
type into the input field seems placed in the field a bit too low --
about half of each letter is cut off at the bottom and I can't really
read what I'm typing.

Is there a way to fix this?  Has anyone else had this experience?

Thanks.

--

-- 

--------------------------------
Jeffrey Needle
jeff.needle@...

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

Brown, Daniel | 20 Aug 00:24

Reducing SQLite Memory footprint(!)

Good afternoon list,

Are there any known techniques for reducing SQLite's memory footprint?
I am currently evaluating SQLite as a possible replacement to our
current proprietary database solution.  However SQLite is very memory
intensive compared to our current solution (although SQLite is faster
and more feature rich), e.g. 9MB for our current solution versus 28 MB
for SQLite with the same source data.  Due to our platforms limitations
we need to be able to run our database solution completely in RAM in our
worst case environment we don't have any writable storage available:
this prevents the use of SQLite's paging facility except for read only
tables.  Our current solution achieves its small memory footprint by bit
packing where we specify the minimum and maximum values for each column
the system then uses the smallest number of bits possible to represent
integer, bit and float values, strings are the exception which we use
UTF-8 to store.  

So is there any existing techniques I can leverage to reduce the memory
footprint for SQLite?  Ideally I'd like to be able to stay inside our
original memory footprint of 9 MB, which I think could be achievable
with a combination of paging our read only tables from disc and keeping
our writable tables 100% in memory with some sort of compression being
applied.

Cheers,

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

_______________________________________________
(Continue reading)

vincent cridlig | 20 Aug 00:15

Multiple connection to in-memory database

Hi,

I would like to use transactions from separate threads, each thread having one connection to a single
in-memory db.

I just read in the sqlite doc that in-memory sqlite databases (using sqlite3_open(":memory:", ...)) are
private to a single connection.
Is there a way to open a second connection to the same in-memory database (for example from a second thread)?
Has someone ever tried to do (or implement) that?

Any help appreciated.

Thanks
Vincent

      _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
_______________________________________________
sqlite-users mailing list
sqlite-users@...
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp | 19 Aug 22:58

Correct SQL name resolution on AS clauses in a SELECT?

Consider a table:

     CREATE TABLE t1(a INTEGER, b INTEGER);
     INSERT INTO t1 VALUES(1,2);
     INSERT INTO t1 VALUES(9,8);

I am reworking (read: trying to fix) the name resolution algorithm in  
SQLite and I am wondering what is the correct behavior of the  
following queries?  Can anybody tell me what PostgreSQL or MySQL or  
SQL Server or Oracle do with these?

     SELECT a AS b, b AS a FROM t1 ORDER BY a;
     SELECT b AS a, a AS b FROM t1 ORDER BY a;
     SELECT a, b AS a FROM t1 ORDER BY a;
     SELECT a AS x, b AS x ORDER BY x;

     SELECT a AS b, b AS a WHERE a=1;
     SELECT a AS b, b AS a WHERE a=2;
     SELECT a AS x, b AS x WHERE x=1;

D. Richard Hipp
drh@...

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

Wilson, Ron P | 19 Aug 22:45

.import with .separator and quoted strings

I'm trying to import a table using the command line tool.

sqlite> .separator ,

sqlite> .import export.csv library

export.csv line 1: expected 53 columns of data but found 77

sqlite> .mode csv

sqlite> .import export.csv library

export.csv line 1: expected 53 columns of data but found 77

All entries are quoted strings, but some of them have commas within the
strings.  It appears that SQLite is ignoring the string quoting and
taking all commas literally.  Is this intended?  The same import works
fine in Excel with 53 columns resulting.  I have also tried tab
delimited and apparently some of the strings in this dataset also
contain tabs.

sqlite> .mode tabs

sqlite> .import export.txt library

export.txt line 162: expected 53 columns of data but found 55

I don't control the data source, and I would really like to avoid
pre-munging the data.

(Continue reading)

Julian Qian | 19 Aug 22:03

sqlite 4 bytes write

I would like us to understand the write patterns of Sqlite. . That
write pattern happens first to the journal then to the database. I
found a lot of 4 byte writes.

What are these 4 byte writes and can the be avoided? I would also like
data on the write patterns for a 1k,2k,128k, and 256k writes to a
database. Is there some flags we can set in Sqlite to less these
writes?

below is the write log of 3.5.9
[pid  3452] lseek(54, 0, SEEK_SET)      = 0
[pid  3452] write(54, "??\5?
?c?\0\0\0\0iܷ?\0\0\4?\0\0\2\0\0\0\10\0ttac"..., 512) = 512
[pid  3452] lseek(54, 512, SEEK_SET)    = 512
[pid  3452] write(54, "\0\0\0\7", 4)    = 4
[pid  3452] lseek(54, 516, SEEK_SET)    = 516
[pid  3452] write(54,
"\n\0\0\0\22\6K\0\7\227\7q\7E\6?\7?\6?\7?\6?\7?\7$\6K\6"..., 1024) =
1024
[pid  3452] lseek(54, 2564, SEEK_SET)   = 2564
[pid  3452] write(54, "iܸ?", 4)        = 4
[pid  3452] lseek(54, 2568, SEEK_SET)   = 2568
[pid  3452] write(54, "\0\0\0\6", 4)    = 4
[pid  3452] lseek(54, 2572, SEEK_SET)   = 2572
[pid  3452] write(54,
"\r\7\212\0\22\4C\2\7?\7r\0070\6?\6?\6\234\6l\7`\6Q\4?\7"..., 1024) =
1024
[pid  3452] lseek(54, 4620, SEEK_SET)   = 4620
[pid  3452] write(54, "iܹ=", 4)        = 4
[pid  3452] lseek(54, 4624, SEEK_SET)   = 4624
(Continue reading)

Paul Simon | 19 Aug 19:55

Segmentation fault

Hi List, I get the following segmentation fault whenever I exit sqlite3. The segmentation fault does not
seem to happen If I write something to the database then exit.

sqlite3(27109,0xa000ed88) malloc: *** error for object 0x1806c00: incorrect checksum for freed object
- object was probably modified after being freed, break at szone_error to debug
sqlite3(27109,0xa000ed88) malloc: *** set a breakpoint in szone_error to debug
Segmentation fault

Is this a bug? Or do I need to compile the source differently than what the README file directs?

sqlite 3.6.1
mac ox 10.4 power-pc

Thanks,
Paul

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

Imran Habib | 19 Aug 18:25

Detecting DB Integrity and Recovery

I am currently writing a method that detects that database is corrupt or not
and return SQLITE_OK if OK otherwise an error.

If I detect an error then I delete the existing database file.and then
Create the new database file with the same name and after that populate the
database file with the default data or some known data. I know it is quite
bad approach.

The C language code of the method is like this.

int Verify_DB_integrity(sqlite3 *db_Handle)
{

   int  rVal = SQLITE_OK;
   char errMsg[400];
   sqlite3_stmt *pStmt;

   rVal = sqlite3_prepare(db_Handle, "PRAGMA integrity_check", sizeof(PRAGMA
integrity_check),
                                &pStmt, NU_NULL);

   if((rVal != SQLITE_OK) || (pStmt == NU_NULL))
   {
       return rVal;
   }

   rVal = sqlite3_step(pStmt);

   if (rVal == SQLITE_ROW)
   {
(Continue reading)

rob | 19 Aug 16:30

"Database is Locked"

I currently have a project that runs on a Windows XP machine. The project was working with
SQLite 3.5.7, but I recently upgraded to 3.6.1 . Since the upgrade I have been getting
an "Database is Locked" error message on any type of query that is ran after the database is
"opened". I am assuming that when the database is opened it is being locked somehow. I am
using sqlite3_open16 to open the database and sqlite3_exec to execute a simple PRAGMA
statement. If anyone knows of a solution to this problem I would appreciate the help.

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


Gmane