[sqlite] Two Phase commit using sqlite

2008-03-09 Thread Shailesh Madhukar Birari
Hello, I want to implement a distributed database using sqlite. Can some one give me information of whether SQLite supports two phase commit? Thanks, Shailesh. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] group_concat for binary?

2008-03-09 Thread He Shiming
Well, I didn't think BLOB stores text more efficiently. It's just that my data is actually in binary. To store it in text I'll have to encode it, which thus require twice storage as large. Anyway, I've managed to create my own custom aggregate function to accomplish this. The initial results

Re: [sqlite] group_concat for binary?

2008-03-09 Thread John Stanton
Why do you think a BLOB stores text more efficiently? Do you compress it? He Shiming wrote: > Hi, > > I would like to know if there is some workaround to use group_concat on > binary columns. > > For performance consideration, I need to query two tables and accomplish > data retrieval in a

[sqlite] group_concat for binary?

2008-03-09 Thread He Shiming
Hi, I would like to know if there is some workaround to use group_concat on binary columns. For performance consideration, I need to query two tables and accomplish data retrieval in a single SELECT. There is this BLOB column, originally designed as BLOB rather than text so that the storage

Re: [sqlite] Beginners bad luck

2008-03-09 Thread Robert L Cochran
When you call phpinfo(); do you see that the PDO functionality is enabled? Is SQLite listed as one of the databases? http://us.php.net/manual/en/function.phpinfo.php Also look at your /etc/php.ini file. Assuming your binary of php is using extensions, are the extensions for sqlite being loaded?

Re: [sqlite] Beginners bad luck

2008-03-09 Thread Edward Macnaghten
Aharon (Rony) Shapira wrote: > > > $db = new SQLiteDatabase($file) or die("Could not open database"); > > I got the following: > > Fatal error: Uncaught exception 'SQLiteException' with message > 'SQLiteDatabase::__construct() [

Re: [sqlite] Beginners bad luck

2008-03-09 Thread Eugene Wee
Hi, It looks like the PDO extension was not installed/enabled. This is a little unusual since "PDO ships with PHP 5.1", according to the PHP Manual. I suggest that you install and enable the PDO extension. Read: http://www.php.net/manual/en/ref.pdo.php

Re: [sqlite] Beginners bad luck

2008-03-09 Thread John Stanton
Looks like you need to recompile PHP with the option. Aharon (Rony) Shapira wrote: > I tried using PDO as follows : > // create a SQLite3 database file with PDO and return a database handle > > try{ > > $dbHandle = new > PDO('sqlite:'.$_SERVER['DOCUMENT_ROOT'].'/../pdoTutorial.sqlite3'); > >

Re: [sqlite] Beginners bad luck

2008-03-09 Thread John Stanton
I haven't tried to get it but I understand the Sqlite.org CVS server has it archived. You should also be able to create the DB from PHP. Sqlite open creates a DB if the file does not exist. Aharon (Rony) Shapira wrote: > Great. PHP has sqlite2 as you said. I could use it to create a db and

Re: [sqlite] Beginners bad luck

2008-03-09 Thread Aharon (Rony) Shapira
Great. PHP has sqlite2 as you said. I could use it to create a db and add a table. But when downloaded from the server to my pc couldn't get hold of it. I have a command-line program for accessing and modifying SQLite3 databases which seems not to recognise it. How do I get one for sqlite2?

Re: [sqlite] Beginners bad luck

2008-03-09 Thread Aharon (Rony) Shapira
I tried using PDO as follows : // create a SQLite3 database file with PDO and return a database handle try{ $dbHandle = new PDO('sqlite:'.$_SERVER['DOCUMENT_ROOT'].'/../pdoTutorial.sqlite3'); }catch( PDOException $exception ){ die($exception->getMessage()); } but got the following error

Re: [sqlite] Beginners bad luck

2008-03-09 Thread John Stanton
PHP has Sqlite V2 embedded. Use PDO to get Sqlite3. P Kishor wrote: > On 3/9/08, Aharon (Rony) Shapira <[EMAIL PROTECTED]> wrote: > >>Sorry. When I set $db and use $db the message I get is: >> >> Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a >> database in

Re: [sqlite] Beginners bad luck

2008-03-09 Thread Zbigniew Baniewski
On Sun, Mar 09, 2008 at 03:51:23PM +0300, Aharon (Rony) Shapira wrote: > I created a simple table named "books" in "library.db". > After entering "select * from books" I saw the data that I put into it. > > When trying to access it through php: > $file = "library.db"; > // open database file >

Re: [sqlite] Beginners bad luck

2008-03-09 Thread P Kishor
On 3/9/08, Aharon (Rony) Shapira <[EMAIL PROTECTED]> wrote: > Sorry. When I set $db and use $db the message I get is: > > Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a > database in /home/zbfckla/public_html/Ocx.php on line 49 > Could not open database > again,

Re: [sqlite] Beginners bad luck

2008-03-09 Thread Aharon (Rony) Shapira
Sorry. When I set $db and use $db the message I get is: Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in /home/zbfckla/public_html/Ocx.php on line 49 Could not open database - Original Message - From: "P Kishor" <[EMAIL PROTECTED]> To: "General

Re: [sqlite] Beginners bad luck

2008-03-09 Thread P Kishor
I don't know how PHP's db connector works but... On 3/9/08, Aharon (Rony) Shapira <[EMAIL PROTECTED]> wrote: > > I created a simple table named "books" in "library.db". > After entering "select * from books" I saw the data that I put into it. > > When trying to access it through php: > $file

[sqlite] Beginners bad luck

2008-03-09 Thread Aharon (Rony) Shapira
I created a simple table named "books" in "library.db". After entering "select * from books" I saw the data that I put into it. When trying to access it through php: $file = "library.db"; // open database file $handle = sqlite_open($db) or die("Could not open database"); I got the following:

Re: [sqlite] Bulk insert

2008-03-09 Thread Vincent Vega
Eliedaat, Thanks a lot , it really helped. I have added sqlite3_exec(db,"BEGIN;",NULL,NULL,) before the for loop and sqlite3_exec(db,"END;",NULL,NULL,) after the loop and now it takes only 250 milliseconds instead of 2 secs. Marco. "Adler, Eliedaat" <[EMAIL PROTECTED]> wrote:

Re: [sqlite] Bulk insert

2008-03-09 Thread Adler, Eliedaat
Executing BEGIN TRANSACTION before and END TRANSACTION after the full insert will greatly improve Your performance. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vincent Vega Sent: Sunday, March 09, 2008 12:44 PM To: sqlite-users@sqlite.org Subject:

[sqlite] Bulk insert

2008-03-09 Thread Vincent Vega
Hi all , I need to insert 500 records (each record has 12 bytes) to a table and it takes me approximately 2 seconds. Is there a way to improve my code so it can do it faster? Thanks in advance, Marco. Here is my code: query = sqlite3_mprintf("Insert into Inventory (Tag)