Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Stephan Beal
On Thu, Jul 7, 2011 at 7:52 AM, James_21th wrote: > Dear all, > > I'm able to connect to sqlite3 DB and display the data inside, but when > insert > data, no matter how to try, just don't work, there's no error, but no data > inserted. > ... > Any feed back will be greately

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread James_21th
The table already created with some data inside, the existing data can be display use "select * from tbl1". - Original Message From: Michael Stephenson To: General Discussion of SQLite Database Sent: Thu, 7 July, 2011 1:59:40 PM

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Stephan Beal
On Thu, Jul 7, 2011 at 8:24 AM, James_21th wrote: > The table already created with some data inside, the existing data can be > display use "select * from tbl1". Are you 100% sure that the test.db being opened here is the same test.db being used in the rest of he code

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread James_21th
Yes, 100% sure, because I only have one copy on my PC, and the script which can display the db's data also on the same directory.   I also tried below, but no error captured, just nothing happened.   try { $result=$dbh->exec("INSERT INTO tbl1(one,two) VALUES ('new1','new2')"); }

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Michael Stephenson
What if you put a semicolon at the end of the query text? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of James_21th Sent: Thursday, July 07, 2011 3:32 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Insert

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread James_21th
semicolon added and tried again, still no use. - Original Message From: Michael Stephenson To: General Discussion of SQLite Database Sent: Thu, 7 July, 2011 3:46:35 PM Subject: Re: [sqlite] Insert not working for sqlite3 What if you

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Stephan Beal
On Thu, Jul 7, 2011 at 9:31 AM, James_21th wrote: > try { > $result=$dbh->exec("INSERT INTO tbl1(one,two) VALUES ('new1','new2')"); > } catch(PDOExecption $e) { > print "Error!: " . $e->getMessage() . ""; > } > PDO _only_ throws exceptions if you set the exceptions

[sqlite] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Benjamin Savs
Hello everybody, I stumbled upon this mailing list via http://system.data.sqlite.org/ and hope it is the right place to ask. I'm doing queries with c# and linq using System.Data.SQLite and noticed that it doesn't seem to be possible to do concurrent reads on the data. If I run Linq-queries from

Re: [sqlite] FTS4 code from the website

2011-07-07 Thread Ryan Henrie
So, can anyone provide a working example of how this can work? Or, look at the code I have to figure out what I have wrong? I'm still not getting anything to work. To recap: Overall, I'd like to be able to set up 2 *sqlite3* FTS databases. One that holds quotes, with ranked search

[sqlite] Get extent of RTree quickly

2011-07-07 Thread Felix Obermaier
Hello everyone, is there a faster way to get the spanning bounds of an RTree virtual table than querying its min/max values? thanks Felix Obermaier -- Ingenieurgruppe IVV GmbH & Co. KG Dipl.-Ing. Felix Obermaier Oppenhoffallee 171 52066 Aachen Telefon:

Re: [sqlite] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Joe Mistachkin
Benjamin Savs wrote: If I run Linq-queries from several threads I will get an exception that states "*DataReader has been closed*". Is this normal or should there be a way to issue concurrent reads? Are you trying to share a single SQLiteDataReader object instance between threads or just the

Re: [sqlite] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Benjamin Savs
I probably am using a single SQLiteDataReader, although I never explicitly handle one. context = new DataContext(_connection); context.GetTable(); I do all queries on such a table object via Linq. Is there a way to control the DataReader involved with such a query? On Thu, Jul 7, 2011 at

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Jaco Breitenbach
Are you missing a COMMIT perhaps? On 7 July 2011 09:11, Stephan Beal wrote: > On Thu, Jul 7, 2011 at 9:31 AM, James_21th wrote: > > > try { > > $result=$dbh->exec("INSERT INTO tbl1(one,two) VALUES ('new1','new2')"); > > } catch(PDOExecption $e) { >

Re: [sqlite] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Joe Mistachkin
I do not see anything obviously wrong with using the same connection to construct two or more LINQ data contexts; however, my knowledge of LINQ and its use of threads is somewhat limited. -- Joe Mistachkin ___ sqlite-users mailing list

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Black, Michael (IS)
You're going to have to create a complete stand-alone example if you want us to debug your code for you. Make a simple program that only does that one insert and share that with us. Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate

Re: [sqlite] System.Data.SQLite c#/Linq concurrent reads

2011-07-07 Thread Benjamin Savs
Thanks for the hint. Using a separate data context for the other thread solves the problem. But it doesn't make the situation much better, because the data context seem to have separate cashes. So it does not help to cash stuff in the background, because it won't be ready for the main thread

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Simon Slavin
On 7 Jul 2011, at 6:52am, James_21th wrote: > $dbh = new PDO('sqlite:test.db'); > $result=$dbh->query("INSERT INTO tbl1(one,two) VALUES ('new1','new2')"); Make one application which does DROP table IF EXISTS CREATE the table Do the INSERT as above Do a SELECT for that data For each operation

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Stephan Beal
On Thu, Jul 7, 2011 at 2:17 PM, Simon Slavin wrote: > For each operation you should test the $result and check to see it's > SQLITE_OK. > Or enable exceptions and you don't have to check for errors (because they will cause an exception). -- - stephan beal

[sqlite] Suboptimal code in createCollation()

2011-07-07 Thread Dmitry
Hey. Currently createCollation() function in main.c is structured like this: 1. functions starts and immediately computes int nName = sqlite3Strlen30(zName); 2. then there's a ton oh checks some of those checks lead to early return 3. then there's if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 )

[sqlite] DROP TABLE yields SQLITE_LOCKED from user-defined function

2011-07-07 Thread Ben Harper
I have a user-defined function that I register with create_function. Inside my function I try to drop an r-tree virtual table, but I get the error SQLITE_LOCKED. Is there something special one needs to do in order to drop a table from inside a user-defined function? To test, I call it simply

Re: [sqlite] DROP TABLE yields SQLITE_LOCKED from user-defined function

2011-07-07 Thread Pavel Ivanov
> Is there something special one needs to do in order to drop a table from > inside a user-defined function? > > To test, I call it simply like so: > SELECT my_function(); It shouldn't be ever possible to change the database from within a function called from SELECT statement. SELECT query

Re: [sqlite] multidimensional representation

2011-07-07 Thread e-mail mgbg25171
Luuk, Roger Yes it is like a pivot table. I was stuck on how you delete dimensions you decide you don't want anymore. After a day thinking about it I think I've cracked it so... Thanks very much for your assistance. ___ sqlite-users mailing list

Re: [sqlite] multidimensional representation

2011-07-07 Thread Kit
2011/7/6 e-mail mgbg25171 : >                                1990        1991  year   <= dimension > > north         sales        10            8 >                cogs         (5)           (4) > south        sales         6             5 >                cogs      

Re: [sqlite] DROP TABLE yields SQLITE_LOCKED from user-defined function

2011-07-07 Thread Ben Harper
OK. I'm assuming this is not a regular pattern that has an idiomatic workaround? Ben -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov Sent: 07 July 2011 05:18 PM To: General Discussion of SQLite Database

Re: [sqlite] DROP TABLE yields SQLITE_LOCKED from user-defined function

2011-07-07 Thread Igor Tandetnik
On 7/7/2011 10:38 AM, Ben Harper wrote: > I have a user-defined function that I register with create_function. > > Inside my function I try to drop an r-tree virtual table, but I get the error > SQLITE_LOCKED. > > Is there something special one needs to do in order to drop a table from > inside

[sqlite] SQLite Encryption Extension (SEE) and Public Domain Sqlite

2011-07-07 Thread Prakash Reddy Bande
Hi, I wanted to get an understanding of SQLite Encryption Extension. I am currently using sqlite-3.7.2, and if I want to use SEE, would it be equally compatible. Well, the http://www.hwaci.com/sw/sqlite/see.html page does not give much information, i.e. do still build sqlite from public and

Re: [sqlite] SQLite Encryption Extension (SEE) and Public Domain Sqlite

2011-07-07 Thread Simon Slavin
On 7 Jul 2011, at 7:41pm, Prakash Reddy Bande wrote: > I wanted to get an understanding of SQLite Encryption Extension. I am > currently using sqlite-3.7.2, and if I want to use SEE, would it be equally > compatible. Well, thehttp://www.hwaci.com/sw/sqlite/see.html page does not > give much

Re: [sqlite] SQLite Encryption Extension (SEE) and Public Domain Sqlite

2011-07-07 Thread Black, Michael (IS)
If you hash the username too you don't have that problem. Passwords should always be a 1-way hash. It's actually best to collapse username/password into a single one-way hash. That way it's very difficult to crack it. You can use a user "account#" value that users would have to track for

Re: [sqlite] DROP TABLE yields SQLITE_LOCKED from user-defined function

2011-07-07 Thread Pavel Ivanov
> I'm assuming this is not a regular pattern that has an idiomatic workaround? You are correct. With SQLite the only option you have is to call your user-defined function directly from your host language. Pavel On Thu, Jul 7, 2011 at 12:43 PM, Ben Harper wrote: > OK. > > I'm

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread James_21th
Dear all, Thank you for all your valuable suggestion, it's good idea to put the whole script here, also good idea everytime to check the result, so I put the whole script here: The $result always return false, it don't allow me to create a simple table, the table name surely not exist, I

Re: [sqlite] Insert not working for sqlite3

2011-07-07 Thread Simon Slavin
On 8 Jul 2011, at 2:50am, James_21th wrote: > $dbh = new PDO('sqlite:db1.db'); Make sure "extension=php_pdo_sqlite.dll" is enabled in php.ini. Do a find on 'sqlite' in it and see if anything looks disabled. Specify a full path for you database file, e.g. sqlite:/opt/databases/mydb.sq3 Make