[sqlite] How to Embed SQLite in VC++

2005-04-14 Thread Mahendra Batra
Someone, plz tell me how could i embed SQLite. I included sqlite.h but getting unresolved errors i.e the definition of functions like sqlite3_open(..) and sqlite3_exec(..) can not be found. Please favor me as soon as possible. regards, Mahendra Batra

[sqlite] How to Embed SQLite in VC++

2005-04-14 Thread Mahendra Batra
Someone, plz tell me how could i embed SQLite. I included sqlite.h but getting unresolved errors i.e the definition of functions like sqlite3_open(..) and sqlite3_exec(..) can not be found. Please favor me as soon as possible. regards, Mahendra Batra

Re: [sqlite] Problem storing integers

2005-04-14 Thread Nuno Lucas
[15-04-2005 5:47, Gé Weijers escreveu] Same thing on Mac OSX. Must be a platform-independent issue. Same thing on v3.2.1 on linux (gentoo ebuild). It looks like a bug... ~Nuno Lucas Richard Boulton wrote: CREATE TABLE test (a INTEGER); INSERT INTO test VALUES(4294967295); INSERT INTO test

Re: [sqlite] Problem storing integers

2005-04-14 Thread Gé Weijers
Same thing on Mac OSX. Must be a platform-independent issue. Gé Richard Boulton wrote: >Hi, > >I'm running the latest sqlite 3.2.1 command line tool on Windows XP and have >noticed that I don't seem to be able to store 48bit integers anymore :-S > >CREATE TABLE test (a INTEGER); >INSERT INTO

Re: [sqlite] Copying a table between databases

2005-04-14 Thread Dennis Volodomanov
Thank you Derrell and Cory, I can create triggers when I create the database file and I'm not using indexes in this particular program, so that seems like the way to go. Wouldn't a function like sqlite3_copytable(sqlite3 *pDest, sqlite3 *pSrc, ...) be a good idea? Or it would make SQLite more

Re: [sqlite] db not writable

2005-04-14 Thread tom
Thanks Dan, That's all it was. Knock on wood (tap head). On 4/14/05, Dan Kennedy <[EMAIL PROTECTED]> wrote: > SQLite needs write permission to the directory as well. It could be > that. >

Re: [sqlite] Multiple Tables on one Flat File

2005-04-14 Thread Jay Sprenkle
The sqlite_master table keeps the sql used to create the table automatically. check out select * from sqlite_master; On 4/14/05, Eric Bohlman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I ended up creating a %dbh hash with $table as the index along with one > > Operating System

Re: [sqlite] Multiple Tables on one Flat File

2005-04-14 Thread Eric Bohlman
[EMAIL PROTECTED] wrote: I ended up creating a %dbh hash with $table as the index along with one Operating System file for each table. I was hoping there was a way not to create so many Operating System files because of the extra Administration they require. can you think of any way around this? I

[sqlite] Problem storing integers

2005-04-14 Thread Richard Boulton
Hi, I'm running the latest sqlite 3.2.1 command line tool on Windows XP and have noticed that I don't seem to be able to store 48bit integers anymore :-S CREATE TABLE test (a INTEGER); INSERT INTO test VALUES(4294967295); INSERT INTO test VALUES(1099511627775); INSERT INTO test

AW: [sqlite] bug in ORDER BY ?

2005-04-14 Thread Christian Schwarz
Does "select * from mactor order by id desc limit 1" and "select * from mactor order by id limit 1" not work? Greetings, Christian

Re: [sqlite] bug in ORDER BY ?

2005-04-14 Thread Thomas Steffen
On 4/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > EXPLAIN is your friend. As can be seen by EXPLAINing each query (see below), > there are fewer instructions involved in the one with the subquery, and no > sorts or loops as are done in the initial method. Well, not everybody is a

Re: [sqlite] bug in ORDER BY ?

2005-04-14 Thread Derrell . Lipman
Thomas Steffen <[EMAIL PROTECTED]> writes: > On 4/14/05, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: >> How about these: >> >> SELECT * from Mactor WHERE id = (SELECT MAX(id) FROM Mactor); >> SELECT * from Mactor WHERE id = (SELECT MIN(id) FROM Mactor); > > I am working on a similar

Re: [sqlite] Multiple Tables on one Flat File

2005-04-14 Thread John LeSueur
[EMAIL PROTECTED] wrote: Eric: thank you for your reply. I ended up creating a %dbh hash with $table as the index along with one Operating System file for each table. I was hoping there was a way not to create so many Operating System files because of the extra Administration they require. can

Re: [sqlite] api questions about data lifetimes

2005-04-14 Thread Austin Gilbert
Not to discourage you from rolling your own, but what about CppSQLite?? www.codeproject.com/database/CppSQLite.asp (the site is down at the moment, here is the google cache: http://64.233.167.104/search?q=cache:qULjzgqRl0oJ:www.codeproject.com/ database/CppSQLite.asp+CppSQLite=en=safari ) It

[sqlite] Question regarding Memory Tables

2005-04-14 Thread Brandon, Nicholas
Hello, I was thinking about using memory tables for short term data and was wondering whether SQLite does anything to stop the OS paging the memory to disk? I know there is a POSIX function "mlock" that stop memory being paged to disk but I believe the program has to run as root/admin since

Re: [sqlite] bug in ORDER BY ?

2005-04-14 Thread Thomas Steffen
On 4/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How about these: > > SELECT * from Mactor WHERE id = (SELECT MAX(id) FROM Mactor); > SELECT * from Mactor WHERE id = (SELECT MIN(id) FROM Mactor); I am working on a similar problem at the moment, but unless I missed something, ORDER

[sqlite] api questions about data lifetimes

2005-04-14 Thread Brian Swetland
I'm wrapping sqlite3 with a lightweight little C++ API to allow me to use it more easily from C++ code and I have a couple questions about the lifespan of data passed into and received from the sqlite3 API: 1. Will the const char* returned by sqlite3_column_name() persist until the statement

Re: [sqlite] bug in ORDER BY ?

2005-04-14 Thread Derrell . Lipman
"Miha Vrhovnik"<[EMAIL PROTECTED]> writes: > SELECT * FROM Mactor WHERE id < 9223372036854775807 ORDER BY id DESC LIMIT 1; > > where 9223372036854775807 is Maximum value of signed Int64. > > P.S. If anybody has better Idea of how to get the last/first row (the one > with highest/lowest ID) then

Re: [sqlite] bug in ORDER BY ?

2005-04-14 Thread Xavier Aguila
try SELECT * FROM Mactor WHERE id=(Select max(id) from Mactor); //with this you get last id. SELECT * FROM Mactor WHERE id=(Select min(id) from Mactor); //with this you get first id. Xavier Miha Vrhovnik wrote: Hi, sqlite dll is 3.2.1 I have the folowing query: SELECT * FROM Mactor WHERE id <

[sqlite] bug in ORDER BY ?

2005-04-14 Thread Miha Vrhovnik
Hi, sqlite dll is 3.2.1 I have the folowing query: SELECT * FROM Mactor WHERE id < 9223372036854775807 ORDER BY id DESC LIMIT 1; where 9223372036854775807 is Maximum value of signed Int64. Table is defined as: CREATE TABLE Mactor ( id INTEGER PRIMARY KEY, name TEXT, birthName TEXT, birthday

RE: [sqlite] Indexing problem

2005-04-14 Thread Thomas Briggs
Without having seen the EXPLAIN output for the query both with and without the indexes present: the indexes you've created don't really support your query very well. Of the six indexes that you've created, I believe that only one can be used, so I'd speculate that the cause of the slowdown is

Re: [sqlite] Copying a table between databases

2005-04-14 Thread Cory Nelson
field types are retained but indexes and triggers won't be copied On 4/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > "Dennis Volodomanov" <[EMAIL PROTECTED]> writes: > > > So, "CREATE TABLE AS" will basically duplicate the table that I have (if > > I say for example, "CREATE TABLE AS

[sqlite] Indexing problem

2005-04-14 Thread John Proudlove
Hello, Can anyone shed light on the following problem, experienced with the SQLite command line utility (v3.0.8) on Solaris/SPARC? The query below hangs (fails to complete within 5 minutes) using the indices shown, but after removing the index on the Season column (used in the WHERE condition),

Re: [sqlite] Multiple Tables on one Flat File

2005-04-14 Thread Uriel_Carrasquilla
Eric: thank you for your reply. I ended up creating a %dbh hash with $table as the index along with one Operating System file for each table. I was hoping there was a way not to create so many Operating System files because of the extra Administration they require. can you think of any way

Re: [sqlite] Copying a table between databases

2005-04-14 Thread Derrell . Lipman
"Dennis Volodomanov" <[EMAIL PROTECTED]> writes: > So, "CREATE TABLE AS" will basically duplicate the table that I have (if > I say for example, "CREATE TABLE AS myNewTable AS SELECT * FROM > myOldTable")? Sounds good if that's true :-) You have one too many "AS" in your example. (No "AS"

RE: [sqlite] Some Functional Questions

2005-04-14 Thread Griggs, Donald
Hi Ken, I don't know enough to respond to all of your questions, but maybe the following will help for a few of them. Locking and concurrancy info: http://www.sqlite.org/lockingv3.html Date/timestamp variables: http://www.sqlite.org/lang_createtable.html Date/time manipulation

Re: [sqlite] How to Install SQLite

2005-04-14 Thread Cory Nelson
just put sqlite3.exe in your path (like windows folder), then you can open a command window and play with it from there. On 4/14/05, Mahendra Batra <[EMAIL PROTECTED]> wrote: > I refered www.sqlite.org for dowloading sqlite and i am working in Windows. I > followed this link :- > >

Re: [sqlite] Cross compiling SQLite for Power PC

2005-04-14 Thread F.W.A. van Leeuwen
Why not have config.h statically contain: #define SQLITE_PTR_SZ (sizeof(char*)) Wouldn't that be much easier? Best regards, Frank.