Re: [sqlite] reg:BOLB data

2006-09-15 Thread sandhya
Thank you very much Snyder. - Original Message - From: Gerry Snyder [EMAIL PROTECTED] To: sqlite-users@sqlite.org Sent: Wednesday, September 13, 2006 6:56 PM Subject: Re: [sqlite] reg:BOLB data sandhya wrote: Hi, I created a table with fileds filename and the value of type text

RE: [sqlite] Very wide tables and performance

2006-09-15 Thread Denis Povshedny
Hi Jose, thanks for your explanations. :) AFAIR it is a good practice to separate OLTP and OLAP databases. In this case you do not impact interactivity and feel free to rotate/transform/reformat data as you wish. WBR, Denis -Original Message- From: jose simas [mailto:[EMAIL PROTECTED]

Re: [sqlite] legacy_file_format

2006-09-15 Thread drh
Mark Richards [EMAIL PROTECTED] wrote: With sqlite version 3.3.7 if I create a new database using: if (sqlite3_open(/var/tmp/solarwave/aem.db, db)!=0) { printf(Cannot open db\n); return(false); } and then issue the following: snprintf(query,

Re: [sqlite] null pointer problem

2006-09-15 Thread drh
Dixon Hutchinson [EMAIL PROTECTED] wrote: I am running version 3.3.6 compiled with Visual Studio .net 2003 in a single threaded app. While using sqlite3_exec to execute a COMMIT;, in run into a null pointer problem in sqlite3_step. I added tests for the null pointer to vdbeapi.c:

[sqlite] reg:Sqlite API's

2006-09-15 Thread sandhya
Hi all, Can you please tell me the usage of sqlite_prepare() /sqlite_exec() inorder to execute a query say for example, I have given a query like , strcpy(szQuery, SELECT OID from table sample where name =XXX); I have used sqlite_exec(db,szQuery,0,0,0); Where my resultant data will get

Re: [sqlite] reg:Sqlite API's

2006-09-15 Thread Gerry Snyder
sandhya wrote: Hi all, Can you please tell me the usage of sqlite_prepare() /sqlite_exec() Have you looked at the SQLite source code? The stand-alone executable should be of help. I believe it is shell.c HTH, Gerry

Re: [sqlite] reg:Sqlite API's

2006-09-15 Thread sandhya
Thanks a lot for your response Actually there is one function call in some sample found like, static int callback(void *NotUsed, int argc, char **argv, char **azColName) { int i; for(i=0; iargc; i++){ printf(%s = %s\n, azColName[i], argv[i] ? argv[i] : NULL); } printf(\n); return

[sqlite] how to create timestamp trigger?

2006-09-15 Thread emilia12
hi list in other DBs one can create time stamp column with CREATE TABLE todo ( id serial primary key, title text, created timestamp default now(), done boolean default 'f' ); in SQLITE probably I have to add a trigger on the INSERT event (right?) to do the same: CREATE TABLE todo (

[sqlite] Which API to use to get resultant of query

2006-09-15 Thread sandhya
sprintf(szQuery,select oid from %s where filename = '%s',sampletbl,test.htm); sqlite3_prepare(db,szQuery, 512 , pStmt, 0); errcode = sqlite3_step(pStmt); But the error code i am getting is 21..Somethig when i read in docs it gave misuseCan you please tell me where i did mistake. Is

Re: [sqlite] how to create timestamp trigger?

2006-09-15 Thread Jay Sprenkle
hi list in other DBs one can create time stamp column with CREATE TABLE todo ( id serial primary key, title text, created timestamp default now(), done boolean default 'f' ); I thought this was fixed. Which version do you have? The DEFAULT constraint specifies a default value to use

Re: [sqlite] Which API to use to get resultant of query

2006-09-15 Thread Jay Sprenkle
On 9/15/06, sandhya [EMAIL PROTECTED] wrote: sprintf(szQuery,select oid from %s where filename = '%s',sampletbl,test.htm); there's an example program here: http://sqlite.org/quickstart.html and a more involved one here http://www.reddawn.net/~jsprenkl/Sqlite -- -- SqliteImporter and

Re: [sqlite] Error: database is locked on _all_ sqlite tables

2006-09-15 Thread Jay Sprenkle
On 9/14/06, Jay Johnston [EMAIL PROTECTED] wrote: I'm having a strange problem since earlier today where all sqlite tables on my shared webserver seem to be locked. I have a trac installation using sqlite that started giving me database is locked errors earlier today and continues to do so.

Re: [sqlite] Which API to use to get resultant of query

2006-09-15 Thread sandhya
Thanks a lot for your response Actually there is one function call in some sample found like, static int callback(void *NotUsed, int argc, char **argv, char **azColName) { int i; for(i=0; iargc; i++){ printf(%s = %s\n, azColName[i], argv[i] ? argv[i] : NULL); } printf(\n); return

[sqlite] Re: Which API to use to get resultant of query

2006-09-15 Thread Igor Tandetnik
sandhya [EMAIL PROTECTED] wrote: sprintf(szQuery,select oid from %s where filename = '%s',sampletbl,test.htm); sqlite3_prepare(db,szQuery, 512 , pStmt, 0); It is unlikely that szQuery string is 512 characters long. So you instruct SQLite to compile a long string of garbage. sqlite3_prepare

Re: [sqlite] Which API to use to get resultant of query

2006-09-15 Thread Noel Frankinet
sandhya a écrit : Thanks a lot for your response Actually there is one function call in some sample found like, static int callback(void *NotUsed, int argc, char **argv, char **azColName) { int i; for(i=0; iargc; i++){ printf(%s = %s\n, azColName[i], argv[i] ? argv[i] : NULL); }

Re: [sqlite] Error: database is locked on _all_ sqlite tables

2006-09-15 Thread Jay Johnston
No trac.db in the results of lsof. Also, no processes owned by me in /proc/locks. On 9/15/06, Jay Sprenkle [EMAIL PROTECTED] wrote: On 9/14/06, Jay Johnston [EMAIL PROTECTED] wrote: I'm having a strange problem since earlier today where all sqlite tables on my shared webserver seem to be

Re: [sqlite] Re: Which API to use to get resultant of query

2006-09-15 Thread sandhya
Ya now i am getting error code which says SQLITE_DONE...so how can get my resultant now? Which API i should use?Please tell me - Original Message - From: Igor Tandetnik [EMAIL PROTECTED] To: SQLite sqlite-users@sqlite.org Sent: Friday, September 15, 2006 7:57 PM Subject: [sqlite] Re:

Re: [sqlite] Which API to use to get resultant of query

2006-09-15 Thread Jay Sprenkle
On 9/15/06, sandhya [EMAIL PROTECTED] wrote: Actually my query is returing only one data ie OID of the fileIn this case what i can do to get that data.Where it will get stored? look at the documentation for sqlite_bind(): http://sqlite.org/capi3ref.html#sqlite3_bind_text It explains how to

Re: [sqlite] Error: database is locked on _all_ sqlite tables

2006-09-15 Thread Jay Sprenkle
On 9/15/06, Jay Johnston [EMAIL PROTECTED] wrote: No trac.db in the results of lsof. Also, no processes owned by me in /proc/locks. can you open the file created on the server on your laptop? if you're dynamically linking it may be loading the wrong shared libs. Have you installed anything on

Re: [sqlite] Which API to use to get resultant of query

2006-09-15 Thread sandhya
You mean there is no need for me to take care of this function calls ..Its just enough having definition there. But by doing that i am not getting any kind of output ie my OID. - Original Message - From: Noel Frankinet [EMAIL PROTECTED] To: sqlite-users@sqlite.org Sent: Friday,

RE: [sqlite] Re: Which API to use to get resultant of query

2006-09-15 Thread Richard Stern
Ya now i am getting error code which says SQLITE_DONE...so how can get my resultant now? Which API i should use?Please tell me After running prepare, you can get the data like this: //This while loop will step through every row one by one while (sqlite3_step(pStmt) == SQLITE_ROW) {

[sqlite] Re: Re: Which API to use to get resultant of query

2006-09-15 Thread Igor Tandetnik
sandhya [EMAIL PROTECTED] wrote: Ya now i am getting error code which says SQLITE_DONE It's not an error. It's a success code meaning that you've reached the end of resultset. If you get that on the very first call to sqlite3_step, it means your resultset is empty - there are no rows

Re: [sqlite] Error: database is locked on _all_ sqlite tables

2006-09-15 Thread Jay Johnston
Yes, I can open the file created on the server on my laptop. No, I haven't changed anything on the server that would have caused this. Even when I run the static binary from sqlite.org I receive the same error, so it doesn't seem to be a library issue. On 9/15/06, Jay Sprenkle [EMAIL

Re: [sqlite] Which API to use to get resultant of query

2006-09-15 Thread sandhya
I got but the return type of all API's is int..So where the result will get stored and how can i get..Please don't get fed up with the same question again and again i am not getting how to ask this? i used sqlite_exec() i don't know where the result stored and how to get it. I also used the

Re: Re: [sqlite] met ARM7TDMI raised an exception,data abort when executing

2006-09-15 Thread xin.ye
Hi, Dennis,thank you very much for your advice. You are right. I do make some stupid mistake when I wrap the realloc() function for my os-less platform. But now a new problem has emerged. sqlite3_exec(db, create table myt(age smallint), NULL, NULL, NULL); during the parser parsing the above

Re: [sqlite] Re: Re: Which API to use to get resultant of query

2006-09-15 Thread sandhya
yaI got now... But where as when i am executing the same from command prompt it is showing the OID alone. Why it is showing DONE when i am doing it through program?Anything wrong? Whether i should do in some other way? please help me -Sandhya - Original Message - From: Igor

[sqlite] Re: Re: Re: Which API to use to get resultant of query

2006-09-15 Thread Igor Tandetnik
sandhya [EMAIL PROTECTED] wrote: But where as when i am executing the same from command prompt it is showing the OID alone. Why it is showing DONE when i am doing it through program?Anything wrong? Check your condition. Make sure it's the same as the one you use in console. Most likely,

RE: [sqlite] Re: Re: Re: Which API to use to get resultant of query

2006-09-15 Thread Fred Williams
-Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 10:27 AM To: SQLite Subject: [sqlite] Re: Re: Re: Which API to use to get resultant of query sandhya [EMAIL PROTECTED] wrote: But where as when i am executing the same from

Re: [sqlite] Error: database is locked on _all_ sqlite tables

2006-09-15 Thread Jay Johnston
Yes, the directory is writable. No, there is no journal file -- this happens even when creating a new database. [barranca]$ whoami jpj [barranca]$ ls -dl ./ drwxr-x--x 38 jpj pg547368 4096 2006-09-15 09:25 ./ [barranca]$ echo create table foo(x varchar(12)); | ~/src/sqlite3-

Re: [sqlite] Which API to use to get resultant of query

2006-09-15 Thread Noel Frankinet
sandhya a écrit : You mean there is no need for me to take care of this function calls ..Its just enough having definition there. But by doing that i am not getting any kind of output ie my OID. No you should write the callback and do whatever you want with the passed data. You the pass

Re: [sqlite] Error: database is locked on _all_ sqlite tables

2006-09-15 Thread Jay Johnston
NFS. The same test works fine in /tmp, which is apparently local. I'll report the problem to the host. Thanks for the help. On 9/15/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Jay Johnston [EMAIL PROTECTED] wrote: Yes, the directory is writable. No, there is no journal file -- this

Re: [sqlite] to retreive OID

2006-09-15 Thread Dennis Cote
Roger Binns wrote: Alternately, you may want to consider the simpler sqlite3_exec api Roger, The sqlite3_exec interface may seem simpler than the sqlite_prepare et al API at first glance, but it really isn't for queries. Yes you make fewer calls to sqlite functions, but you have to define

Re: [sqlite] Re: Re: Re: Which API to use to get resultant of query

2006-09-15 Thread Dennis Cote
Fred Williams wrote: Just a suggestion. When I am learning a new language, database, etc. I sometimes find working with and even stepping through supplied samples prove to be the quickest way to gain insight into how the new entity works. Saves both me and a lot of other people a lot of time

[sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread jima
Hi all, I hope this is now the right place to tell this story after being redirected to this list by drh. I first submitted this as a ticket (sorry about that). I am building sqlite from sources in a debian sarge box. I am interested in Loadable Extensions. I had to introduce into the

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread Christian Werner
jima wrote: ... And then I go, no problems building. I have sqlite built with this feature I guess. But the thing is that I cannot make it to work. I prepared a c file following the template given in the wiki. I generated a .so using: gcc -I/path_to_sqlite-3.3.7/src -c -o Extension.o

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread jima
Thanks for the advice but it would not work either. I just tried with the flags you mentioned at compile time and full path when loading. Do you know if I have to enclose that full path in quotes or something at load time? like... .load '/path/Extension.so' ? I tried several combinations of

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread drh
jima [EMAIL PROTECTED] wrote: unable to open shared library [Extension.so] Any clues of what is going on? Did you base your implementation of Extension.c off of the example C code contained in the wiki? http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions The magic macros

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread jima
I have them both...I read the wiki page before trying this myself. I will try with the exact code that it is contained at the page. Thanks for the hint. jima 2006/9/15, [EMAIL PROTECTED] [EMAIL PROTECTED]: jima [EMAIL PROTECTED] wrote: unable to open shared library [Extension.so] Any

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread jima
Better still, I have tried with full text search extension and I was able to load it. I will re-check my code. It is the most clear suspect now. jima 2006/9/15, jima [EMAIL PROTECTED]: I have them both...I read the wiki page before trying this myself. I will try with the exact code that it

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread Christian Werner
jima wrote: Thanks for the advice but it would not work either. I just tried with the flags you mentioned at compile time and full path when loading. Do you know if I have to enclose that full path in quotes or something at load time? like... ..load '/path/Extension.so' ? I tried

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread jima
Hi, I build **without** -DSQLITE_OMIT_LOAD_EXTENSION I do ldd on sqlite3 and I get libdl.so.2 = /lib/libdl.so.2 (0x00402000) but I cannot load my Extension.so Do Extension.c has to include sqlite3.h ? Presently I am only including sqlite3ext.h. If I have used --enable-thread at sqlite

[sqlite] how sqlite works?

2006-09-15 Thread Cesar David Rodas Maldonado
If there a document of how SQLite Virtual Machine Works ( papers )? I would like do something similar with B-Tree, B+ Tree but i dont know how to merge a select with tow Index? Understand my question?? Please answer me

Re: [sqlite] how sqlite works?

2006-09-15 Thread Dennis Cote
Cesar David Rodas Maldonado wrote: If there a document of how SQLite Virtual Machine Works ( papers )? I would like do something similar with B-Tree, B+ Tree but i dont know how to merge a select with tow Index? Understand my question?? Please answer me see the links VDBE Tutorial and VDBE

Re: [sqlite] how sqlite works?

2006-09-15 Thread Cesar David Rodas Maldonado
I meen, If SQLite has two index and very large Index (about 10.000.000 each one) how do i merge it, I mean (index1 = index2 for every one and limit it in thousand). Understand? On 9/15/06, Dennis Cote [EMAIL PROTECTED] wrote: Cesar David Rodas Maldonado wrote: If there a document of how

[sqlite] Is it possible to call sqlite_exec() from within the callback made inside sqlite_exec()

2006-09-15 Thread Kevin Stewart
I need to move some records from one database (and table) to another. The tables are identical. My idea was to 'select' all records that match my search criteria and in the callback that is called from sqlite_exec() I can add them to the other table in the other database. This way I don't need

[sqlite] Compiling PHP5 in order to use SQLite3

2006-09-15 Thread Michael Young
I'm not a Unix programmer, but I would like to compile PHP5 so that it will be able to read/write SQLite3 files on my Mac. In particular, I have tried to follow the installation script suggested at www.phpmac.com for Apache 2.2.2 and PHP 5.1.4. However, this only results in a compilation

Re: [sqlite] Is it possible to call sqlite_exec() from within the callback made inside sqlite_exec()

2006-09-15 Thread Jay Sprenkle
that's the hard way: open db1 attach db2 insert into db2.destinationTable select * from db1.sourceTable done On 9/15/06, Kevin Stewart [EMAIL PROTECTED] wrote: I need to move some records from one database (and table) to another. The tables are identical. My idea was to 'select' all records

Re: [sqlite] Is it possible to call sqlite_exec() from within the callback made inside sqlite_exec()

2006-09-15 Thread Kevin Stewart
Well, its a little more complicated than that. I don't want the whole table, just the set of records that matched the initial search criteria in the select. But thanks for your response. I did a little redesigning of the database schema and the way my code handles things and I came up with a

Re: [sqlite] Concurrency with writer and read-only processes

2006-09-15 Thread Cory Nelson
SQLite databases are protected like a big reader-writer lock: there is no way read while you are writing. BEGIN IMMEDIATE simply changes when it takes the write lock, and won't affect this. On 9/15/06, Liam Healy [EMAIL PROTECTED] wrote: I have a database that has one writer which runs once a

Re: [sqlite] Concurrency with writer and read-only processes

2006-09-15 Thread Gerry Snyder
Liam Healy wrote: I have a database that has one writer which runs once a day, and potentially many readers running whenever someone wants some information. I am trying to understand concurrency in sqlite3 so that I can have the writer run each day, regardless of whether a reader is already

Re: [sqlite] Compiling PHP5 in order to use SQLite3

2006-09-15 Thread Lloyd Thomas
I far as i know you compile with php5-pdo-sqlite, but this was only tested on debian. Last time i looked this supports sqlite 3.2.8 and you have to use php's pdo functions and not the sqlite functions which only work with v2. - Original Message - From: Michael Young [EMAIL PROTECTED]

Re: [sqlite] Problem using loadable extension mechanism.

2006-09-15 Thread Christian Werner
jima wrote: Hi, I build **without** -DSQLITE_OMIT_LOAD_EXTENSION I do ldd on sqlite3 and I get libdl.so.2 = /lib/libdl.so.2 (0x00402000) but I cannot load my Extension.so Do Extension.c has to include sqlite3.h ? Presently I am only including sqlite3ext.h. Including