Re: [sqlite] Make Windows use UTF-8

2005-07-13 Thread Will Leshner
On Jul 13, 2005, at 3:28 AM, Simon Posnjak wrote: is there a way to make Windows (2k, XP, ...) write the sqlite db in UTF-8 format? I need to do this becouse I will use the db on Linux box which uses UTF-8. Thank you. If you insert only UTF-8 data into the database, it will be UTF-8. SQLite

[sqlite] possible bug in lockBtree

2005-07-10 Thread Will Leshner
I think there might be a bug in this code in lockBtree: if( sqlite3pager_pagecount(pBt->pPager)>0 ){ u8 *page1 = pPage1->aData; if( memcmp(page1, zMagicHeader, 16)!=0 ){ goto page1_init_failed; The problem is if you are trying to open a non-sqlite file that is smaller than pa

Re: [sqlite] Update variable problems. Bug?

2005-07-03 Thread Will Leshner
On Jul 3, 2005, at 11:59 AM, Tom Shaw wrote: Now there should be nothing wrong with the above that I can see BUT if I change the DB variable name from ip to ip_num all works OK Strings are quoted with single quotes, not double quotes. Double- quoted strings are interpreted as column names.

Re: [sqlite] Error : Library routine called out of sequence

2005-06-28 Thread Will Leshner
On Jun 28, 2005, at 5:08 AM, Ajay wrote: I am trying to insert values into table and executing that query from thread. There are 2 more threads that accesses same table. Do all the threads use the same sqlite handle? I believe that can cause problems.

Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Will Leshner
On Jun 20, 2005, at 7:42 AM, Jay Sprenkle wrote: for i:=1 to 1000 do begin tran insert or on conflict fail into testtable(val) values(StringN); commit end for Shouldn't the transaction wrap the loop?

Re: [sqlite] How to Lock other threads out of DB until specifically UNlocking the DB?

2005-06-17 Thread Will Leshner
On Jun 17, 2005, at 11:18 AM, [EMAIL PROTECTED] wrote: However, I need transactions for other purposes, as my process is running it will need to BEGIN and COMMIT/ROLLBACK transactions all the while holding the lock on the file. Ah. You were hoping the transactions would be nested? That is

Re: [sqlite] How to Lock other threads out of DB until specifically UNlocking the DB?

2005-06-17 Thread Will Leshner
On Jun 17, 2005, at 10:52 AM, [EMAIL PROTECTED] wrote: Yes, a BEGIN EXCLUSIVE does lock it, but then as soon as I do some other SQL, it automatically UN LOCKS the db unfortunately. I need to keep it locked until I unlock it. I'm not sure I believe you :) I would assume the database would be

Re: [sqlite] How to Lock other threads out of DB until specifically UNlocking the DB?

2005-06-17 Thread Will Leshner
On Jun 17, 2005, at 9:57 AM, de f wrote: The automatic locking of Transactions in sqlite does not give me direct control and is of no use to me (those locks go away automatically, leaving me no control over them.) Are you sure? Have you investigated BEGIN EXCLUSIVE?

Re: [sqlite] Row Locking

2005-06-13 Thread Will Leshner
On Jun 13, 2005, at 12:47 AM, Ben Clewett wrote: If any users have any ideas or comments, I would be very interested. I use triggers, but I also use a custom function I have registered that takes care of determining if a given record is locked. That way I don't have to use a special tabl

Re: [sqlite] Tiger: Error: file is encrypted or is not a database

2005-06-06 Thread Will Leshner
On Jun 6, 2005, at 6:01 PM, Helmut Tschemernjak wrote: Just do a less on the .db files and you can see the information is in clear text. I will investigate into it a little bit more. I did on one file, but it was not clear text. Do you see a SQLite header on the files?

Re: [sqlite] Tiger: Error: file is encrypted or is not a database

2005-06-06 Thread Will Leshner
On Jun 6, 2005, at 7:36 AM, Helmut Tschemernjak wrote: The data is not encrypted. What makes you think it is a SQLite database (a slightly rhetorical question as I'm pretty sure I know what makes you think that). But, and this isn't rhetorical, what makes you think it isn't encrypted?

Re: [sqlite] short_column_name(s)

2005-05-26 Thread Will Leshner
On May 26, 2005, at 12:58 PM, Hans Bieshaar wrote: Enter ".help" for instructions sqlite> .mode columns sqlite> .header on sqlite> pragma short_column_names; short_column_names Ok. I am an idiot. The 's' was just being truncated. Sorry for the noise.

Re: [sqlite] short_column_name(s)

2005-05-26 Thread Will Leshner
On May 26, 2005, at 12:58 PM, Hans Bieshaar wrote: Enter ".help" for instructions sqlite> .mode columns sqlite> .header on sqlite> pragma short_column_names; short_column_names Interesting. Then this may be a bug in my wrapper. Thanks for doing the sanity check.

[sqlite] short_column_name(s)

2005-05-26 Thread Will Leshner
I don't know if I'd call this a bug, exactly, but if you do PRAGMA short_column_names to get the short_column_names setting, the result you get back has a column named "short_column_name". In other words, the column name lacks an 's' at the end.

Re: [sqlite] qualified names in WHERE clause

2005-05-26 Thread Will Leshner
On May 26, 2005, at 7:49 AM, Thomas Briggs wrote: It's been our experience that the only truly reliable way to avoid this problem is to be explicit. I agree, and that's what I've always done up until now because it never occurred to me that the SQL engine would be able to figure it ou

Re: [sqlite] qualified names in WHERE clause

2005-05-26 Thread Will Leshner
On May 26, 2005, at 7:23 AM, Gregory Letellier wrote: try SELECT Test2.* FROM test2 inner join test11 ON test2.id=test11.id ORDER By Name; Thanks. I know there are ways to get the query to work. I think the problem is when people are migrating over from another database engine and they

[sqlite] qualified names in WHERE clause

2005-05-26 Thread Will Leshner
I guess I never really noticed this before (since I only use SQLite, of course :) ). But consider a query like this: SELECT test2.* FROM test2,test11 WHERE test2.id=test11.id ORDER BY name If the 'name' column happens to be a column in both test2 and test11, then SQLite will return an error.

Re: [sqlite] philosophy behind public domain?

2005-05-25 Thread Will Leshner
On May 25, 2005, at 11:43 AM, D. Richard Hipp wrote: Sounds like a folk legend to me Most likely :)

Re: [sqlite] philosophy behind public domain?

2005-05-25 Thread Will Leshner
On May 25, 2005, at 11:36 AM, Darren Duncan wrote: I think the gist was that the software couldn't have a disclaimer of liability if it is public domain, and so anyone could sue the author if something went wrong when using it. I don't know how true this is or not, but would like to see i

Re: [sqlite] bug, or whacky SQL?

2005-05-20 Thread Will Leshner
On May 20, 2005, at 11:46 AM, Rob Laveaux wrote: You can't use a WHERE clause on the result of an aggregation. Use HAVING instead. This should work: select sum(ft) as Pts, pkey from playergame group by pkey having Pts > 15 Doh! Yes, that is it. Thanks a lot.

[sqlite] bug, or whacky SQL?

2005-05-20 Thread Will Leshner
I'm not sure if this is a bug in SQLite, or just whacky sql, but lets say I've got a table called playergame with two integer columns, one called ft and the other called pkey and I try to do something like this: select sum(ft) as Pts, pkey from playergame where group by pkey I get back the sum

Re: [sqlite] updating records problem

2005-05-18 Thread Will Leshner
On May 18, 2005, at 10:40 AM, John LeSueur wrote: Myself, I'm not a big fan of high-level abstraction from the sql being performed, so I wouldn't use the originally posted idea of editing a recordset. I don't tend to use it either. But some people like to do things that way and I'd like to ma

Re: [sqlite] updating records problem

2005-05-18 Thread Will Leshner
On May 18, 2005, at 8:26 AM, Jay Sprenkle wrote: I didnt let users enter SQL. I provided a form with fields that correspond to the columns in the table. They could enter a search string into the form in the name field if they wanted to search by name, in the city field if they wanted a specif

Re: [sqlite] How to get transaction state?

2005-05-18 Thread Will Leshner
On May 18, 2005, at 8:22 AM, Mike Owens wrote: What about sqlite3_set_authorizer()? Implement a callback function and monitor changes in transaction state for each connection object: open_database(...) { ... sqlite3* db = ... connection_object* object = ... sqlite3_set_authorizer(db

Re: [sqlite] updating records problem

2005-05-18 Thread Will Leshner
On May 18, 2005, at 8:02 AM, Jay Sprenkle wrote: When I wrote applications that allowed the user to enter queries I added the unique key row to their query. I presented them with the data they requested and either did not show the record id, or made it read only. This allowed me to correctly identi

Re: [sqlite] How to get transaction state?

2005-05-18 Thread Will Leshner
On May 18, 2005, at 7:33 AM, Gerhard Haering wrote: Basically I would have that information already if I peeked in the sqlite3 struct, right? But as pysqlite is not just for me personally, I cannot do such hacks ;-) I'd need an API call that returns that flag for me. I would really like to see

Re: [sqlite] How to get transaction state?

2005-05-18 Thread Will Leshner
On May 18, 2005, at 6:02 AM, D. Richard Hipp wrote: Question: Might it be that you really want to know if SQLite is in auto-commit mode or not? That is a very different thing and is a much easier question to answer. Yes, I have the same need and that is exactly what I want to know. I am current

Re: [sqlite] updating records problem

2005-05-17 Thread Will Leshner
On May 17, 2005, at 8:11 PM, Ken & Deb Allen wrote: By ensuring that each record receives a unique identifier and including that in all queries, the main issue is resolved. Right, but the problem is that the user didn't use the unique identifier in the query and now I'm faced with the prospect

[sqlite] autoCommit

2005-05-17 Thread Will Leshner
I see there is an autoCommit flag in the sqlite3 structure. That is, of course, an opaque structure and technically I shouldn't be looking at it. But I wonder how evil it would be to expose that flag so that I can use it to detect whether or not SQLite is currently in a transaction. Thanks

Re: [sqlite] updating records problem

2005-05-17 Thread Will Leshner
On May 17, 2005, at 2:07 PM, Jay Sprenkle wrote: rowid won't work in a multiuser database. It's just the row number within the result set you retrieved. This sort of problem is the reason why people use a unique id field. The database automatically assigns you a number that won't change and isn

[sqlite] updating records problem

2005-05-17 Thread Will Leshner
I develop a database wrapper for SQLite and I have an interesting problem that I'm curious how other people solve. Basically, the users of my wrapper have the option of editing database records indirectly through the wrapper, rather than directly, using UPDATE. The database wrapper is a set

Re: [sqlite] Attach and in memory databases.

2005-05-08 Thread Will Leshner
On May 8, 2005, at 9:53 AM, Randy Graham wrote: 1.Can an in memory database be attached to another in memory database? (Seems not). I guess the limitation is that there is no syntax for it. Perhaps there could be something added to the API that would allow attaching one database to anoth

Re: [sqlite] request for additions to sqlite 3.xx

2005-05-07 Thread Will Leshner
On May 7, 2005, at 4:13 PM, Darren Duncan wrote: That said, if this were a large database engine, there wouldn't be any excuse to leave this feature out of the core. Yes, that is a good point.

Re: [sqlite] alter table rename column

2005-05-07 Thread Will Leshner
On May 7, 2005, at 3:14 PM, Kurt Welgehausen wrote: SQLite's version of the ALTER TABLE command allows the user to rename, or add a new column to, an existing table. Aha. Ok. I get it now :)

[sqlite] alter table rename column

2005-05-07 Thread Will Leshner
The SQLite documentation has the following sentence on the page for "Alter Table": "SQLite's version of the ALTER TABLE command allows the user to rename or add a new column to an existing table." It would appear, however, that while we can add columns to a table, we can't rename them. At l

Re: [sqlite] request for additions to sqlite 3.xx

2005-05-07 Thread Will Leshner
On May 7, 2005, at 11:50 AM, Darren Duncan wrote: However, row-level locking is something else; I see this as being too complex to implement in the 3.x series, if SQLite ever implements it; so no vote for this. In fact, the existing support to lock the whole database that 3.x supports now, w

[sqlite] opening illegal database files

2005-05-07 Thread Will Leshner
It would seem that at least for some files I've tried, if a file has content but it isn't a SQLite, SQLite (3) will open the file and overwrite whatever was there. Is this the expected behavior? As a workaround, I can look for the header string, but I'd really like it if the SQLite library

Re: [sqlite] request for additions to sqlite 3.xx

2005-05-07 Thread Will Leshner
On May 7, 2005, at 7:42 AM, basil thomas wrote: 1) row locking - this seems to be a touchy subject as any mention of explicit row locking will take SQLite from a standalone/embedded library to a full-blown client/server type architecture. I do not know all the internals of SQLite locking exce

Re: [sqlite] SQLite on Tiger.

2005-04-30 Thread Will Leshner
On 4/29/05, Bill Bumgarner <[EMAIL PROTECTED]> wrote: > Tiger ships with SQLite 3.1.3 + a couple of tweaks. Specifically, > the SQLite3 on Tiger supports locking on network filesystems, > including AFP and Samba. Woohoo!

Re: [sqlite] strftime and the %f option

2005-04-23 Thread Will Leshner
On 4/22/05, Kurt Welgehausen <[EMAIL PROTECTED]> wrote: > Is that always true, or just when the date is 'now'? > I suspect that 'now' is producing an integer. Aha. I bet you are right. I wish I had thought to test that. Thanks.

[sqlite] strftime and the %f option

2005-04-23 Thread Will Leshner
It would appear that for a sqlite library built with CodeWarrior on the Mac, the %f option to strftime only ever retuns '000' for the milliseconds portion of the time. I'm wondering if this could be a problem with CodeWarrior, or if that's just the way things are.

Re: [sqlite] how to localize the errror message?

2005-04-20 Thread Will Leshner
On 4/20/05, liigo <[EMAIL PROTECTED]> wrote: > I want to localize the error message of sqlite, such as: > > errcode=1: "No such table: xx" > > But where is the message in the source file? Many of the error strings are in main.c.

Re: [sqlite] Re: SEGV (from Perl DBI) trying to run $sth->{TYPE}->[n] on a view

2005-04-20 Thread Will Leshner
On 4/19/05, Peter Shenkin <[EMAIL PROTECTED]> wrote: > In response to Will Leshner, could you tell me how to access this > functionality from the sqlite3 shell? I'll then try it and > respond. Thanks, -P. Ah. Good point. You can't. Sorry about that. I was trying to th

Re: [sqlite] SEGV (from Perl DBI) trying to run $sth->{TYPE}->[n] on a view

2005-04-19 Thread Will Leshner
On 4/19/05, Peter Shenkin <[EMAIL PROTECTED]> wrote: > I have no such problem obtaining the TYPE information in a TABLE; > I only have the problem in a VIEW. Do you have the same problem with the sqlite3 shell?

Re: [sqlite] Locking Methods

2005-04-18 Thread Will Leshner
On 4/18/05, Ben Clewett <[EMAIL PROTECTED]> wrote: > I see in the manual there are plans use Row Locking. This would solve > my problems. Allowing me to load the database from multiple processes > to a far greater amount without fear of SQL_BUSY. As well as > simplifying my programs. I am curr

Re: [sqlite] determing the primary key

2005-04-12 Thread Will Leshner
On 4/12/05, Thomas Briggs <[EMAIL PROTECTED]> wrote: > >Aliases rowid to rowid seems to work for me, i.e. Aha. I forgot about that trick. Thanks!

[sqlite] determing the primary key

2005-04-12 Thread Will Leshner
I realize that in sqlite 3, if I construct a query with 'rowid' as one of the columns, and the table I am querying explicitly declares an integer primary key column, my results have the table's name for the column and not 'rowid'. What I'm wondering is if there is a good way to determine which of t

Re: [sqlite] Re: using triggers to lock records

2005-04-07 Thread Will Leshner
On Apr 7, 2005 7:44 AM, Kervin L. Pierre <[EMAIL PROTECTED]> wrote: > I know your pain :) . Finer grain locking would be > great. Yes. We may simply be trying to use SQLite for something it just wasn't designed for. On the other hand, if you are using SQLite as your single-user database, it woul

[sqlite] Re: using triggers to lock records

2005-04-06 Thread Will Leshner
On Apr 6, 2005 10:43 AM, Will Leshner <[EMAIL PROTECTED]> wrote: > How feasible would it be to use triggers as a way to implement record > locking in SQLite? It seems like if you create a BEFORE trigger for a > particular record id and have that trigger RAISE an error for update

[sqlite] using triggers to lock records

2005-04-06 Thread Will Leshner
How feasible would it be to use triggers as a way to implement record locking in SQLite? It seems like if you create a BEFORE trigger for a particular record id and have that trigger RAISE an error for updates and deletes, you've basically locked the record. Hmm. I guess the problem is that the rec

Re: [sqlite] What forms of comments does SQLite honor?

2005-02-09 Thread Will Leshner
On Wed, 9 Feb 2005 02:00:07 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > see whether > a /* comments to the end of text without a */ being syntactically > necessary. Not in C. The closing */ is necessary.

Re: [sqlite] autoincrement weirdnesses

2005-02-05 Thread Will Leshner
On Sun, 6 Feb 2005 01:17:45 -0500, Randall Randall <[EMAIL PROTECTED]> wrote: > > Okay, I know there's something obvious I must be > missing: > > sqlite> create table package (rowid integer primary key autoincrement, > name text); > SQL error: near "autoincrement": syntax error > > What am I doi

[sqlite] grabbing an in-memory database

2005-02-04 Thread Will Leshner
I wonder if it would be cool to be able to stream an in-memory database to a single chunk of memory, and to have SQLite initialize an in-memory database from a chunk of memory (perhaps, though, that isn't possible). That would allow you to do things like suck the entire contents of a file into memo

[sqlite] malformed 2.8.15 database

2005-02-03 Thread Will Leshner
I have a malformed 2.8.15 database and I'm reasonably sure it is my own fault. But would anybody be interested in looking at it just in case? When I run integrity_check on it, I get a lot of these: rowid 536 missing from index (els_task_score autoindex 1) And then finally: SQL error: database di

Re: [sqlite] AUTOINCREMENT of a not PRIMARY KEY

2005-01-29 Thread Will Leshner
On Sat, 29 Jan 2005 12:07:31 +0100, Serge Ratke <[EMAIL PROTECTED]> wrote: > Hi List. > > What i need is a Table which is quite simple > > CRATE TABLE entry ( > id INTEGER, > parent_id INTEGER, > name TEXT, > PRIMARY KEY(parent_id, name) > ); > > Now the problem is, i wan

Re: [sqlite] Printing ?

2005-01-28 Thread Will Leshner
On Fri, 28 Jan 2005 08:46:35 -0500, Richard <[EMAIL PROTECTED]> wrote: > So, one would need some kind of Report Software, > to interface wth SQlite? On-Target Reports supports SQLite:

Re: [sqlite] Unicode select problem

2005-01-27 Thread Will Leshner
On Thu, 27 Jan 2005 13:59:45 -0800, Cory Nelson <[EMAIL PROTECTED]> wrote: > Are there some limitations in SQLite's Unicode support? > > I'm trying to select some rows that contain Japanese in them. It > seems that when I do "where value='ãã'" I get no results. But with > "where value like '%ãã%

Re: [sqlite] Determining the primary key of a table?

2005-01-23 Thread Will Leshner
On Sun, 23 Jan 2005 16:15:44 -0500, Ned Batchelder <[EMAIL PROTECTED]> wrote: > The pk column in the table_info pragma is populated, but as I said, the > index_list pragma doesn't mention an index. Woops. So you do. Sorry about that.

Re: [sqlite] Determining the primary key of a table?

2005-01-23 Thread Will Leshner
On Sun, 23 Jan 2005 13:18:27 -0500, Ned Batchelder <[EMAIL PROTECTED]> wrote: > One more twist I just discovered: > > If the primary key is a single column that auto-increments, there is no > information in the pragma index_list about the primary key at all: Are you sure? I'm pretty sure I use th

Re: [sqlite] v2 -> v3 upgrade

2005-01-21 Thread Will Leshner
On Fri, 21 Jan 2005 15:59:36 -, Drew, Stephen <[EMAIL PROTECTED]> wrote: > Will, > From the documentation, it appears that sqlite3_column_type returns one > of five defined types, none of which is a date (obviously, as SQLite > doesn't distinguish dates). Is there a way I can continue using th

Re: [sqlite] v2 -> v3 upgrade

2005-01-21 Thread Will Leshner
On Fri, 21 Jan 2005 14:30:01 -, Drew, Stephen <[EMAIL PROTECTED]> wrote: > However, with version 3 and its new data types, I can't seem to be able to > replicate this. It seems as though it will just be treated as a numeric > data type. Does anyone know how I can achieve the same functionalit

Re: [sqlite] possible workaround for bug #301

2005-01-19 Thread Will Leshner
On Wed, 19 Jan 2005 10:57:13 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > If you were to guarantee that there is only one reader and only one > writer-- not just one process, but a single thread and only one > sqlite3_open() against any one file-- accessing the SQLite database, > then it

[sqlite] possible workaround for bug #301

2005-01-19 Thread Will Leshner
Bug #301 says that, because fcntl isn't supported for remove volumes on OS X, SQLite can't acquire a lock, which, I think, pretty much means you can't use SQLite databases that are on AFP or SMB volumes on OS X. What would happen if I simply made the calls in os.c that acquire locks NOOPs? I realiz

Re: [sqlite] perfromance of UPDATE

2005-01-17 Thread Will Leshner
On Mon, 17 Jan 2005 19:09:14 +, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > My question is, why did the two UPDATES take so much time, compared to INSERT. How fast are all those INSERTs and UPDATEs if you put them into a transaction?

Re: [sqlite] wchar for sqlite prolem

2005-01-15 Thread Will Leshner
On Sat, 15 Jan 2005 10:51:03 -0400, LIN, Ming Q. <[EMAIL PROTECTED]> wrote: > I am new to sqlite, I am using it for my unicode project in windows > platform. In windows, Unicode uses wchar variable, but it looks like the > sqlite only take char for parameters. Do anyone know how to store unicode >

Re: [sqlite] excessive malloc() calls

2005-01-10 Thread Will Leshner
On Mon, 10 Jan 2005 17:07:11 -0500, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > This is a standard SQL thing, apparently. It surprised me too > when I first found out about it (and had to fix SQLite to do it.) Very interesting. Thanks.

Re: [sqlite] excessive malloc() calls

2005-01-10 Thread Will Leshner
On Mon, 10 Jan 2005 13:49:21 -0800, [EMAIL PROTECTED] > By the way, "ORDER BY 1" I believe to mean order by column id = 1. So it's > not really a meaningless statement. Is that true? I don't get the from the documentation, but I'm probably just looking at it wrong.

Re: [sqlite] excessive malloc() calls

2005-01-10 Thread Will Leshner
On Mon, 10 Jan 2005 13:43:20 -0800, [EMAIL PROTECTED] > This does point out however, that Win32 users who need to use ORDER BY on a > large table are paying a hefty price. Is that true even if they are using ORDER BY properly?

Re: [sqlite] How to retrieve ROWID without explicite request

2004-12-23 Thread Will Leshner
On Thu, 23 Dec 2004 19:08:05 -0500, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > (3) This would be a huge change that would require > a lot of code. Isn't it easier just to add > "rowid," in from of the "*" in your query? > How hard is it really to write a routine

Re: [sqlite] How to retrieve ROWID without explicite request

2004-12-23 Thread Will Leshner
On Thu, 23 Dec 2004 14:47:28 -0800, Will Leshner <[EMAIL PROTECTED]> wrote: > What would be neat, I think, is if there were a > PRAGMA we could add to a query that would tell SQLite to add the > 'rowid' column to any result set for which 'rowid' wasn't alr

Re: [sqlite] How to retrieve ROWID without explicite request

2004-12-23 Thread Will Leshner
On Thu, 23 Dec 2004 20:33:01 -0200, pascalive <[EMAIL PROTECTED]> wrote: > I'd like to know if there's a way to retrieve the _rowid_ of each returned > row without asking for it. Actually, this is something I've been meaning to feature-request, and for exactly the same reason. What I do, and it

Re: [sqlite] Bug in CREATE TABLE?

2004-11-19 Thread Will Leshner
On Nov 19, 2004, at 5:38 PM, Tito Ciuro wrote: Well, it didn't really stripped it. It seems to have reordered the columns. Also, in version 2 (I don't know if it's still the case), if you omitted the ROWID in the CREATE TABLE statement, this column would still be created, but if would be invisib

Re: [sqlite] Bug in CREATE TABLE?

2004-11-19 Thread Will Leshner
On Nov 19, 2004, at 4:59 PM, Tito Ciuro wrote: When I create an 'address' table, I pass this string to SQLite: 1) CREATE TABLE address(ROWID INTEGER PRIMARY KEY,First QLString,Last QLString,ZIP QLString,Country QLString); 2) CREATE TABLE address_mem_2(ROWID INTEGER PRIMARY KEY,First QLString,Last

Re: [sqlite] Configure script

2004-10-31 Thread Will Leshner
On Oct 31, 2004, at 1:37 AM, Tomas Franzén wrote: On 2004-10-31, at 02.53, Will Leshner wrote: Do you have the developer tools installed? That's about all I can think might be the problem. Yes, I have Dev Tools and XCode installed. Ok, I'm just grasping at straws here, but maybe you&#x

Re: [sqlite] Configure script

2004-10-30 Thread Will Leshner
On Oct 30, 2004, at 2:08 PM, Tomas Franzén wrote: I'm a newbie trying to compile SQLite on Mac OS X. When running the configure script for 2.8.15, the script stops after a while with this message: Do you have the developer tools installed? That's about all I can think might be the problem.

Re: [sqlite] Preventing TableNames.columns inside SELECT

2004-10-24 Thread Will Leshner
On Oct 24, 2004, at 2:59 PM, Raymond Irving wrote: I would like to only return the field names and not table.fieldnames... SELECT t1.column1,t2.clumn2 FROM tableA t1,table2 t2 Can't you just use "as": SELECT t1.column1 as column1, t2.column2 as column2 FROM tableA t1, table2 t2

Re: [sqlite] Warnings during compilation

2004-10-24 Thread Will Leshner
On Oct 24, 2004, at 8:42 AM, Ng Pheng Siong wrote: So if people cast to make the compiler happy then people won't be nervous? ;-) Good point. I didn't word that very well. I guess what I'm thinking is that if you put in an explicit cast then you are indicating that you are well aware that ther

Re: [sqlite] Warnings during compilation

2004-10-24 Thread Will Leshner
On Oct 24, 2004, at 12:21 AM, Steven Van Ingelgem wrote: Hi, I just downloaded the sqlite sources (pre-build for windows & 3.0.8). Now during compilation I get this: 0 error(s), 539 warning(s) Is this normal? Are these type conversion errors? I was going to ask about this myself. We are using

Re: [sqlite] SQLite now supports ALTER Table?

2004-10-22 Thread Will Leshner
Raymond Irving wrote: Hey check this out: This SQLiteDB php class allows you to use ALTER TABLE with your sqlite database. http://code.jenseng.com/db/ I'd really be interested to know how they handle tables with UNIQUE columns, because those are tricky.

Re: [sqlite] BLOBs and sqlite_exec

2004-10-16 Thread Will Leshner
On Oct 16, 2004, at 2:04 AM, D. Richard Hipp wrote: Will Leshner wrote: Sorry if this is terribly obvious, but I'm assuming that, in SQLite3, we can't use the sqlite_exec convenience API to store BLOBs, right? Correct. The only way to insert a BLOB is using sqlite3_prepare() f

Re: [sqlite] BLOBs and sqlite_exec

2004-10-15 Thread Will Leshner
On Oct 15, 2004, at 9:43 AM, john mcnicholas wrote: Sorry, I couldn't be of more help but perhaps this will lead you in the right direction. Actually, this is extremely helpful. I should have realized that I could use the binding interface to bind blob data to a SQL statement. I'll play with tha

Re: [sqlite] BLOBs and sqlite_exec

2004-10-15 Thread Will Leshner
On Oct 15, 2004, at 7:50 AM, Will Leshner wrote: Sorry if this is terribly obvious, but I'm assuming that, in SQLite3, we can't use the sqlite_exec convenience API to store BLOBs, right? I see that if we go through the VM directly the API allows us to specify a data size, so that

[sqlite] BLOBs and sqlite_exec

2004-10-15 Thread Will Leshner
Sorry if this is terribly obvious, but I'm assuming that, in SQLite3, we can't use the sqlite_exec convenience API to store BLOBs, right? I see that if we go through the VM directly the API allows us to specify a data size, so that it doesn't depend on NULL-terminated C strings. But sqlite_exec

Re: [sqlite] strange rounding problem

2004-10-13 Thread Will Leshner
[EMAIL PROTECTED] wrote: Can you come up with a minimal test case that exhibits this behaviour? Ideally, it would be a series of SQL statements written into the sqlite shell program that results in something visibly wrong. The second best case would be a short (10-20 line) C program that uses t

Re: [sqlite] strange rounding problem

2004-10-13 Thread Will Leshner
Griggs, Donald wrote: If I'm missing the (decimal) point, here, forgive me. The point is that the number is in the database as '358', but by the time we get it back from a query it has become '357.999'. We aren't doing any floating point with the number. It is (apparently) happening for us in the S

Re: [sqlite] strange rounding problem

2004-10-13 Thread Will Leshner
Will Leshner wrote: I've tracked my rounding problem down to this line in vxprintf(): I'm sorry to say that is a false alarm. It turns out that we were being fooled by the debugger in Dev Studio. What is the case, however, is that a value is coming out of the database and at some point

Re: [sqlite] strange rounding problem

2004-10-13 Thread Will Leshner
I've tracked my rounding problem down to this line in vxprintf(): while( realvalue>=10.0 && exp<=350 ){ realvalue *= .1; exp++; } Apparently, on some hardware, sometimes, multiplying a number like '358' by .1 results in a number like '35.79' or thereabouts. Now what's really strange is that

Re: [sqlite] strange rounding problem

2004-10-13 Thread Will Leshner
On Oct 13, 2004, at 3:00 AM, Bogusław Brandys wrote: Not a solution, but ... get any sqlite manager like sqliteadmin or sqliteexplorer and check what is really stored in database table. Thanks. I did that and what's stored there is exactly what I expect to be store there. In other words, the col

[sqlite] strange rounding problem

2004-10-12 Thread Will Leshner
In version SQLite 2.8.15 I'm having a situation with a query that I don't quite understand. This only happens on some machines. Basically I have a table with an Integer field that contains integers. And I have a query that is returning those integers as real numbers. So, for example, if I have 234

Re: [sqlite] Get a table's primary key?

2004-10-05 Thread Will Leshner
Tito Ciuro wrote: 3) Then I parse the CREATE TABLE... statement and separate columns from datatypes. You can look for INTEGER PRIMARY KEY. Would that work for you? In practice, how safe is it to parse the CREATE SQL? Unless, of course, you have a full SQL parser at your disposal.

Re: [sqlite] Get a table's primary key?

2004-10-05 Thread Will Leshner
Kirk Haines wrote: If, however, there is a way to get the name of the field from the API, then the driver could simply be patched to pass this info, like most of the drivers do, and then most of the time things should just work, without having to take extra steps. You can use #PRAGMA table_info() t

Re: [sqlite] Encryption?

2004-09-23 Thread Will Leshner
Bryan Ashby wrote: I have searched around and cannot find a definite answer -- We are working on a project that _requires_ a small, embedded and encrypted database. SQLite fits all of our needs except for the encryption part .. which I'm not totally sure about. I notice that in sqlite3.h there is a

Re: [sqlite] Improving Performance of INSERT INTO?

2004-09-15 Thread Will Leshner
Roger Dant wrote: I didn't realize sqlite3 had transaction support! I must have missed it in the documentation -- off to re-read it. Sqlite2 has transaction support and I don't think it's been removed for sqlite3.

Re: [sqlite] Improving Performance of INSERT INTO?

2004-09-15 Thread Will Leshner
Roger Dant wrote: Since INSERT INTO is the only way I know of to populate a table, I'm assuming that I'll have to find a way to optimize these calls. Do you have any tips for optimizing mass INSERTs in Sqlite? Try doing all the INSERTs in a single transaction.

Re: [sqlite] like-op

2004-09-14 Thread Will Leshner
Rod Dav4is wrote: I'm reminded of the guy who wanted to buy a loaf of bread and was told how to build a bakery. ;O) My guess is that most of us on this list are building bakeries and not just buying bread.

Re: [sqlite] Slow loading of large in-memory tables

2004-09-06 Thread Will Leshner
On Sep 6, 2004, at 10:14 PM, Philipp K. Janert, Ph.D. wrote: I am accessing sqlite from Python, using the pysqlite driver. I am loading all records first using cx.execute( "insert ..." ). Only once I have run cx.execute() for all records, I commit all the preceding inserts with conn.commit() For a

Re: [sqlite] Re: Cursor naming conflict

2004-09-06 Thread Will Leshner
On Sep 6, 2004, at 7:27 PM, Jeff Edwards wrote: There is also the question of compiling for windows with the same source, but not the same library on the OSX machine. Actually, I do use the same source. I just make a Windows library in CodeWarrior.

Re: [sqlite] Re: Cursor naming conflict

2004-09-06 Thread Will Leshner
On Sep 6, 2004, at 7:19 PM, Jeff Edwards wrote: We agree with you with the scenario that you build the sqlite library and then link it into a project, however in our scenario, which does not appear to be obscure, we take the entire sqlite source code and directly compile it into our project. Un

Re: [sqlite] Re: Cursor naming conflict

2004-09-06 Thread Will Leshner
On Sep 6, 2004, at 7:03 PM, D. Richard Hipp wrote: The "Cursor" object in SQLite is an internal name. It does not appear anywhere in "sqlite.h" or "sqlite3.h". Since the neither XCode nor Carbon are required to compile SQLite, the definition of Cursor should not appear in any of the files inclu

Re: [sqlite] Getting the Number of row returned by a query.

2004-08-21 Thread Will Leshner
On Aug 21, 2004, at 8:28 PM, WysG wrote: Is that the only way to get the record count ? You could use the Count() function.

<    1   2   3   >