Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread Keiichi McGuire
I'm even newer to Linux so I'm a bit confused when you mention that I need to recompile the lib file. How should I go about recompiling and test that out? It just seems weird to me that gcc is able to compile this, but arm-linux-gcc is not. could it be that arm-linux-gcc was setup incorrectly?

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread Keiichi McGuire
This is a bit confusing, especially since if I compile it using gcc it will compile w/o any problems. What would this "incompatibility" mean and what would a solution be to make it compatible and be found by the compiler? On 7/11/06, John Stanton <[EMAIL PROTECTED]> wrote: Now youhave a clean

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread John Stanton
Now youhave a clean compile,but no sqlite library. It is looking forlibsqlite.so or libsqlite.a. Seems to be finding an libsqlite.a which is incompatible with yhe object you compiled. Keiichi McGuire wrote: still no luck:( and yea I'm still a bit new to C. I have a few years experience in C

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread David Bicking
Your problem is that your copy of libsqlite.a is incompatible. Being a relative newbie too, I had a similar problem, but not with sqlite, and I had to recompile the lib file. After that, I was able to build my program. Perhaps you need to grab the source to sqlite and use arm-linux-gcc to compile

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread Keiichi McGuire
still no luck:( and yea I'm still a bit new to C. I have a few years experience in C during school, but mainly used for microcontrollers, so I've done a very little amount of system applications. anyways, with the pointer added to the errMsg, as well as the -lsqlite switch, i get the following:

Re: [sqlite] Unable to write to database

2006-07-11 Thread John Stanton
Gregary Hendricks wrote: Greetings fellow SQLiters, I am having a bad hair day as a result of an error I am getting with my SQLite database. I am running SQLite 3.3.6 on SuSE linux 9.3 I am trying to access it via a Perl CGI script on my website. I am using the Perl DBD::SQLite module to

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread John Stanton
Your program should look more like this - sqlite *db; char *errmsg = NULL;/*Ptr to possible error message.*/ int main() { printf("Hello!\n"); db = sqlite_open("sqlitetest", 0660, ); /*At this point if you get an error errmsg will not be null and will point to the error

Re: [sqlite] Unable to write to database

2006-07-11 Thread Nuno Lucas
On 7/12/06, Gregary Hendricks <[EMAIL PROTECTED]> wrote: Greetings fellow SQLiters, I am having a bad hair day as a result of an error I am getting with my SQLite database. I am running SQLite 3.3.6 on SuSE linux 9.3 I am trying to access it via a Perl CGI script on my website. I am using the

[sqlite] Re: Problem executing sqlite3_prepare command

2006-07-11 Thread Igor Tandetnik
Vitali Lovich <[EMAIL PROTECTED]> wrote: I'm trying to call the sqlite3_prepare command with the string 'CREATE TABLE $table ( $columns );'. You cannot parameterize on table name, nor on columns list. A parameter can only appear where an expression would be syntactically valid. Igor

[sqlite] Problem executing sqlite3_prepare command

2006-07-11 Thread Vitali Lovich
I'm trying to call the sqlite3_prepare command with the string 'CREATE TABLE $table ( $columns );'. It fails and the errmsg functions returns 'near "$table": syntax error'. I've tried using ? as well and I get the same message. What am I missing? Thanks

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread carl clemens
Maybe this" char errMsg; -> char *errMsg --- Keiichi McGuire <[EMAIL PROTECTED]> wrote: > Hi John, > I still get an error when i use the -lsqlite switch. > When i take that out it > says: > incompatible types in assignment > passing arg 3 of 'sqlite_open' from incompatible > pointer type > >

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread Keiichi McGuire
Hi John, I still get an error when i use the -lsqlite switch. When i take that out it says: incompatible types in assignment passing arg 3 of 'sqlite_open' from incompatible pointer type also I wanted to use v.3, but i'm working on a system where the disk space is limited to 64megs, and i

Re: [sqlite] id INTEGER PRIMARY KEY vs PRIMARY KEY (id) ???

2006-07-11 Thread carl clemens
yup --- John Stanton <[EMAIL PROTECTED]> wrote: > A simple program which uses the API will give you > the defined type and > the actual storage format selected by Sqlite. That > would leave you in > no doubt. > > RohitPatel wrote: > > Hi SQLite users, > > > > In SQLite3 (3.3.4), > > >

Re: [sqlite] Escape issue

2006-07-11 Thread Martin Jenkins
You need to import pysqlite, not sqlite. I think the latter has been deprecated - it's certainly quite old. AIUI pysqlite is built in to Python 2.5 so you'd import sqlite3 there. PythonWin 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2004

Re: [sqlite] SQLite String

2006-07-11 Thread Martin Jenkins
Ernesto Olmos wrote: > This is because I trasmit the database via HTTP (I encrypt the string Are you sure there won't be any endian-ness issues sending memory images between machines? I know disk based files are portable across different hardware but they're byte-swapped on read/write to disk.

Re: [sqlite] SQL error: database disk image is malformed

2006-07-11 Thread Jay Sprenkle
I am developping a freeware which uses SQLite. One of my beta testers informed me about an issue he had: with his DB, following the query which is sent to the DB, I have the error in the subject of this email. I did some testing, and when I succeeded in reproducing the error just by doing a

Re: [sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread John Stanton
Keiichi McGuire wrote: Hi everyone, I'm still a bit new to sqlite and also to crosscompiling programs. I've been having problems with being able to compile this test c program that should just connect to the database. My program looks like this: #include #include"sqlite.h> int main() {

[sqlite] SQL error: database disk image is malformed

2006-07-11 Thread Bull219
Dear all, I am developping a freeware which uses SQLite. One of my beta testers informed me about an issue he had: with his DB, following the query which is sent to the DB, I have the error in the subject of this email. I did some testing, and when I succeeded in reproducing the error just

[sqlite] problems compiling with arm-linux-gcc

2006-07-11 Thread Keiichi McGuire
Hi everyone, I'm still a bit new to sqlite and also to crosscompiling programs. I've been having problems with being able to compile this test c program that should just connect to the database. My program looks like this: #include #include"sqlite.h> int main() { printf("Hello!\n"); sqlite

Re: [sqlite] optimizing your sql

2006-07-11 Thread Jay Sprenkle
On 7/11/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote: OTOH sometimes a correlated subquery that just collects data is faster to execute or more readily optimisable when expressed as a JOIN. I remember such a case, but it wasn't in my code so I paid insufficient attention and now my memory of the

Re: [sqlite] optimizing your sql

2006-07-11 Thread A. Pagaltzis
* Jay Sprenkle <[EMAIL PROTECTED]> [2006-07-11 20:35]: > I think perhaps the correlated subquery optimization is really > another name for rewriting it so the smallest table is the > driving table. It probably doesn't matter how you write the sql > as long as you get the smallest table as the

Re: [sqlite] Working with database entirely from memory

2006-07-11 Thread John Stanton
Sqlite will let you turn off synchronous updates and acheve what you want. If you used precompiled SQL (using sqlite_prepare and sqlite_bind and sqlite_step) you will avoid continually compiling the same SQL. Yaniv Pe'er wrote: Even if I constantly access/save the data? By constantly I mean

Re: [sqlite] optimizing your sql

2006-07-11 Thread Jay Sprenkle
> >Not so fast there. I have accelerated queries by several 100 > >percent by turning joins into subqueries. On other occasions I > >did so by turning subqueries into joins. The performance of > >joins vs subqueries in any non-trivial query depends on a > >*lot* of variables. You can't just say

Re: [sqlite] optimizing your sql

2006-07-11 Thread A. Pagaltzis
* Jay Sprenkle <[EMAIL PROTECTED]> [2006-07-11 20:15]: > On 7/11/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote: > >* Jay Sprenkle <[EMAIL PROTECTED]> [2006-07-10 17:30]: > >> // - Use SQL Joins instead of using sub-queries > > > >Not so fast there. I have accelerated queries by several 100 > >percent

Re: [sqlite] optimizing your sql

2006-07-11 Thread Jay Sprenkle
On 7/11/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote: * Jay Sprenkle <[EMAIL PROTECTED]> [2006-07-10 17:30]: > // - Use SQL Joins instead of using sub-queries Not so fast there. I have accelerated queries by several 100 percent by turning joins into subqueries. On other occasions I did so by

Re: [sqlite] optimizing your sql

2006-07-11 Thread A. Pagaltzis
* Jay Sprenkle <[EMAIL PROTECTED]> [2006-07-10 17:30]: > // - Use SQL Joins instead of using sub-queries Not so fast there. I have accelerated queries by several 100 percent by turning joins into subqueries. On other occasions I did so by turning subqueries into joins. The performance of joins vs

Re: [sqlite] Curious join issue

2006-07-11 Thread Christian Smith
[EMAIL PROTECTED] uttered: "Brandon, Nicholas (UK)" <[EMAIL PROTECTED]> wrote: I don't want to hijack this thread (not too much anyway) but this got me thinking about JOINs since I have a database that uses a similar concept (one table holds a number of key-value pairs for another). As I

Re: [sqlite] Curious join issue

2006-07-11 Thread Christian Smith
[EMAIL PROTECTED] uttered: Christian Smith <[EMAIL PROTECTED]> wrote: select FROM instances as i inner join instance_fields as count using(instanceid) inner join instance_fields as first using (instanceid) inner join instance_fields as last using (instanceid) inner join

Re: [sqlite] Curious join issue

2006-07-11 Thread drh
"Brandon, Nicholas (UK)" <[EMAIL PROTECTED]> wrote: > > > select > > > FROM instances as i > > >inner join instance_fields as count using(instanceid) > > >inner join instance_fields as first using (instanceid) > > >inner join instance_fields as last using (instanceid) > > >

Re: [sqlite] create table command from listview in vb.net

2006-07-11 Thread John Newby
Hi Dennis, Yeah I know, I have posted several VB forums regarding this matter, I was just hoping there might have been an SQLite user that may have came accross this in the past. Sorry to have bothered you all. Thanks again John. On 11/07/06, Dennis Cote <[EMAIL PROTECTED]> wrote: John

Re: [sqlite] create table command from listview in vb.net

2006-07-11 Thread Dennis Cote
John Newby wrote: Do you know of a way I could get the details from the listview? John, This question is far more likely to be answered on a Visual Basic mailing list rather than this one. HTH Dennis Cote

Re: [sqlite] Curious join issue

2006-07-11 Thread drh
Christian Smith <[EMAIL PROTECTED]> wrote: > > select > > FROM instances as i > >inner join instance_fields as count using(instanceid) > >inner join instance_fields as first using (instanceid) > >inner join instance_fields as last using (instanceid) > >inner join

Re: [sqlite] Curious join issue

2006-07-11 Thread Christian Smith
Solved the problem. For reference, field instanceid in the instance_fields needs to be declared as an integer, thus: CREATE TABLE instance_fields ( instanceid integer references instances(instanceid), field, subscript default NULL, value, primary key (instanceid, field, subscript) );

Re: [sqlite] Escape issue

2006-07-11 Thread Jonathan Ballet
Adriano Monteiro wrote: > Wow... > > What a shame. I think I'm not using the right lib. > What's the diff between pysqlite2 and sqlite? > > > Cheers! 'sqlite' package seems to be linked to the SQLite 2.x version, and as far as I remember, it's not supported anymore. You should use pysqlite2,

Re: [sqlite] Escape issue

2006-07-11 Thread Adriano Monteiro
Wow... What a shame. I think I'm not using the right lib. What's the diff between pysqlite2 and sqlite? Cheers! On 7/11/06, Adriano Monteiro <[EMAIL PROTECTED]> wrote: Hi, It doesn't seen to work with me (or I cannot see the error at my code... :-/) >>> import sqlite >>> c =

Re: [sqlite] Escape issue

2006-07-11 Thread Adriano Monteiro
Hi, It doesn't seen to work with me (or I cannot see the error at my code... :-/) import sqlite c = sqlite.connect("/tmp/t") cur = c.cursor() cur.execute("CREATE TABLE TEST (id integer, name text)") cur.execute("INSERT INTO TEST VALUES (?, ?)", (1, "wow")) Traceback (most recent call last):

Re: [sqlite] Escape issue

2006-07-11 Thread Jonathan Ballet
Adriano Monteiro wrote: > Hi folks, > > I'm having a headache with escape chars at sqlite. I'm using pysqlite, > and everytime I try to insert data with a escape char it raises the > following exception: > > File "/usr/lib/python2.4/site-packages/sqlite/main.py", line 244, in > execute >

[sqlite] Escape issue

2006-07-11 Thread Adriano Monteiro
Hi folks, I'm having a headache with escape chars at sqlite. I'm using pysqlite, and everytime I try to insert data with a escape char it raises the following exception: File "/usr/lib/python2.4/site-packages/sqlite/main.py", line 244, in execute self.rs = self.con.db.execute(SQL)

Re: [sqlite] create table command from listview in vb.net

2006-07-11 Thread C.Peachment
Sorry, but I don't use proprietary programming languages and can not provide assistance with Visual Basic. On Tue, 11 Jul 2006 12:00:34 +0100, John Newby wrote: >Hi, thanks for your speedy reply, >Yes, you have understood my code correctly, this is the create table >statement, and at the time

Re: [sqlite] create table command from listview in vb.net

2006-07-11 Thread John Newby
Hi, thanks for your speedy reply, Yes, you have understood my code correctly, this is the create table statement, and at the time of execution all column names are known to the form, I am just unsure as how to get them from the listview to place into a create table statement, I think I will need

Re: [sqlite] create table command from listview in vb.net

2006-07-11 Thread C.Peachment
If understand your code correctly, this line creates a table with a single column. dbConn.createTable("CREATE TABLE " & tblName & "(" & fldName & " " & fldAttribute & ")") You describe a user interface to be used to create tables with multiple columns. You must do one of two

Re: [sqlite] id INTEGER PRIMARY KEY vs PRIMARY KEY (id) ???

2006-07-11 Thread drh
RohitPatel <[EMAIL PROTECTED]> wrote: > Hi SQLite users, > > In SQLite3 (3.3.4), > > Will both of the following statements create same tables ? > 'id' column will be internally same or different ? > > create table t1 > ( > id INTEGER PRIMARY KEY, > name CHAR(20) > ); > > create table

Re: [sqlite] Storage class and Affinity for BOOL/BOOLEAN, NUMBER, FLOAT, DOUBLE ?

2006-07-11 Thread drh
RohitPatel <[EMAIL PROTECTED]> wrote: > > I need to know (in SQLite 3.3.4), what will be the internal storage class > and Column Affinity for columns defined in a table with BOOL/BOOLEAN, > NUMBER, FLOAT and DOUBLE ? > > e.g. > CREATE TABLE t1 > ( > bActive BOOL, > bVisible

[sqlite] create table command from listview in vb.net

2006-07-11 Thread John Newby
Hi, I am creating a front-end to the sqlite DBMS using VB.Net 2002. I have managed to get the name of the table, field names and types from user input displayed into a listview but I can only get the Create table command to accept the last input values, so if the table has more than one

Re: [sqlite] SQLite String

2006-07-11 Thread Jens Miltner
Am 10.07.2006 um 10:52 schrieb Ernesto Olmos: I have an SQLite database which I work in memory (:MEMORY) and I have to get the binary text (string) of it. Is there a way to do it without writing it to disk and reading the file? Command ATTACH works good to get and write from disk or to

[sqlite] id INTEGER PRIMARY KEY vs PRIMARY KEY (id) ???

2006-07-11 Thread RohitPatel9999
Hi SQLite users, In SQLite3 (3.3.4), Will both of the following statements create same tables ? 'id' column will be internally same or different ? create table t1 ( id INTEGER PRIMARY KEY, name CHAR(20) ); create table t1 ( id INTEGER, name CHAR(20), PRIMARY KEY (id) ); What I

[sqlite] Storage class and Affinity for BOOL/BOOLEAN, NUMBER, FLOAT, DOUBLE ?

2006-07-11 Thread RohitPatel9999
Hi SQLite Gurus, I have gone through online documentation of SQLite3 data types. I need to know (in SQLite 3.3.4), what will be the internal storage class and Column Affinity for columns defined in a table with BOOL/BOOLEAN, NUMBER, FLOAT and DOUBLE ? e.g. CREATE TABLE t1 ( bActive