Re: [sqlite] Extracting values from callback

2004-11-05 Thread Guy Hachlili
Well...
At 22:23 11/5/2004 +0100, you wrote:
I've been trying at this for a good few hours now, I'm using sqlite3 and 
the quick start code at the website.

By using a global "char *buffer[5][220];"
and then doing buffer[i][counter]=argv[i]; I thought I would be able to 
extract the rows in my table but it does not work. When the program has 
exited the callback buffer[i][0] equals buffer[i][1] and so on. For some 
reason all of them will have the values of the last callback execution.
What you do not seem to understand is that the strings passed to the 
callback function are created (and freed) by SQLite code. You can't keep 
pointers to them outside of the callback.
For example, you could print out the values using a code like this:

[snip]
int counter=0;
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
   int k;
   for(k=0;k

Re: [sqlite] Extracting values from callback

2004-11-05 Thread Daniel K

> static int callback(void *NotUsed, int argc, char
> **argv, char **azColName){
> int k;
> rows=argc;
> for(k=0;k {
> buffer[k][counter]= argv[k];
> }
> counter++;
> return 0;
> }

The data pointed to by argv[k] only exists for the
duration of the callback. You have to copy the string,
not the pointer. i.e:

buffer[k][counter] = strdup(argv[k]);

(won't work with blobs). Don't forget to free() it
later.



__ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 



Re: [sqlite] Large memory usage not freed?

2004-11-05 Thread Brett Granger
[EMAIL PROTECTED] wrote:
On Nov 4, 2004, at 3:42 PM, D. Richard Hipp wrote:
If we exit the process and then reopen the database in a new process, 
all that memory is not reallocated.
Are you sure you have that right?  What OS are you running?

Oops, tracked it down on our side... multi-threaded programming will 
bite you every time! :-)

Thanks for the input, though,
--Brett


Re: [sqlite] Pocket PC - SQLite - eMbedded Visual C++ YES IT IS POSSIBLE

2004-11-05 Thread Steve Frierdich
   Yes Aaron it is possible. We use SQLITE 3.0.7 on Pocket PC OS 
Version 3.0
Steve

Aaron Planell López wrote:
Hi:
 

I'm trying to create an eMbedded Visual C++ application for Pocket PC 
using SQLite.

Is it possible?
 

Thanks!
 

Atentamente,
Aaron Planell López
 

Principal:[EMAIL PROTECTED] 
Trabajo:[EMAIL PROTECTED] 


Facultad:   [EMAIL PROTECTED] 


Proyecto:  [EMAIL PROTECTED] 
Messenger:[EMAIL PROTECTED] 
GMail:[EMAIL PROTECTED] 
 

  

 



[sqlite] Extracting values from callback

2004-11-05 Thread aleks ponjavic
I've been trying at this for a good few hours now, I'm using sqlite3 and the 
quick start code at the website.

By using a global "char *buffer[5][220];"
and then doing buffer[i][counter]=argv[i]; I thought I would be able to 
extract the rows in my table but it does not work. When the program has 
exited the callback buffer[i][0] equals buffer[i][1] and so on. For some 
reason all of them will have the values of the last callback execution.

int counter=0;
char *buffer[5][220];
int rows;
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
   int k;
   rows=argc;
   for(k=0;k

Re: [sqlite] SQLite For Personal Use

2004-11-05 Thread Dmytro Bogovych
On Fri, 05 Nov 2004 12:48:56 -0500, Jeff Flowers <[EMAIL PROTECTED]>  
wrote:

Is anyone using SQLite to manange personal data; not as part of another
program but by itself, as distributed with the sqlite frontend? I
searched Google but no one seems to be talking about SQLite as a program
by itself.
http://www.quickoutliner.com

--
With best regards,
Dmytro Bogovych
http://www.quickoutliner.com


RE: [sqlite] Version differences between sqlite 2.7.6 , 2.8.0 . 2.8.5

2004-11-05 Thread Srinivas Koppisetti
Great.. do you think copying over datafiles to a different OS will be an
issue. 

-Original Message-
From: D. Richard Hipp [mailto:[EMAIL PROTECTED]
Sent: Friday, November 05, 2004 1:41 PM
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Version differences between sqlite 2.7.6 , 2.8.0 .
2.8.5


Srinivas Koppisetti wrote:
> Hi,
> Has any one tried to use V2.76 database files with 2.85 binary on solaris.
> Are there any known issue in doing so? 
> 

2.7.6 and 2.8.0 should be fully compatible.  The only difference
is in the format of the rollback journals.  There are no file
format changes from 2.8.0 to 2.8.15


-- 
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565

=== 
This electronic transmission contains confidential information intended only 
for the person(s) named.  Any use, distribution, copying, or disclosure by 
any other person is strictly prohibited.  If you received this transmission 
in error, please notify the sender by return e-mail and delete all copies of 
this message. 
=== 


Re: [sqlite] SQLite For Personal Use

2004-11-05 Thread Ara.T.Howard
On Fri, 5 Nov 2004, Jeff Flowers wrote:
Is anyone using SQLite to manange personal data; not as part of another
program but by itself, as distributed with the sqlite frontend? I searched
Google but no one seems to be talking about SQLite as a program by itself.
i do.  anytime i have to manage data i am using sqlite.  often i will build
the databases using the api within ruby, but then i may have shell scripts and
other programs that use the database but do not have a programming lang
specific api and i simply use system calls to sqlite to interact with the
database.  also i use sqlite itself to tweak things in databases created using
programming apis after the fact.
-a
--
===
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| When you do something, you should burn yourself completely, like a good
| bonfire, leaving no trace of yourself.  --Shunryu Suzuki
===


[sqlite] sqlite.so for php 4

2004-11-05 Thread Anton Wolkov
can anyone send me sqlite.so for php 4, i can't compile it on the
target machine cause i don't have permissions, i can't compile it on
my home machine cause i got php 5.
u can upload it via www.yousendit.com if you don't wanna send files to
the group.
thanks


Re: [sqlite] Version differences between sqlite 2.7.6 , 2.8.0 . 2.8.5

2004-11-05 Thread D. Richard Hipp
Srinivas Koppisetti wrote:
Hi,
Has any one tried to use V2.76 database files with 2.85 binary on solaris.
Are there any known issue in doing so? 

2.7.6 and 2.8.0 should be fully compatible.  The only difference
is in the format of the rollback journals.  There are no file
format changes from 2.8.0 to 2.8.15
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


Re: [sqlite] Version differences between sqlite 2.7.6 , 2.8.0 . 2.8.5

2004-11-05 Thread Clay Dowling

Srinivas Koppisetti said:
> Hi,
> Has any one tried to use V2.76 database files with 2.85 binary on solaris.
> Are there any known issue in doing so?
>
> I am trying to upgrade my binary to 2.85 or latter. Any info about this is
> great..

I don't know about file level compatibility, but the upgrade process is
simple enough.  Dump the existing database with the old client, reimport
into a new file with the new client.  Make use of transactions if your
data set is large. It's very easy to automate this with a script or a
batch file.  It shouldn't be much harder to do from a program.

Clay

-- 
Lazarus Notes from Lazarus Internet Development
http://www.lazarusid.com/notes/
Articles, Reviews and Commentary on web development


[sqlite] Version differences between sqlite 2.7.6 , 2.8.0 . 2.8.5

2004-11-05 Thread Srinivas Koppisetti
Hi,
Has any one tried to use V2.76 database files with 2.85 binary on solaris.
Are there any known issue in doing so? 

I am trying to upgrade my binary to 2.85 or latter. Any info about this is
great..

Thanks,
Srinivas'

=== 
This electronic transmission contains confidential information intended only 
for the person(s) named.  Any use, distribution, copying, or disclosure by 
any other person is strictly prohibited.  If you received this transmission 
in error, please notify the sender by return e-mail and delete all copies of 
this message. 
=== 


Re: [sqlite] Pocket PC - SQLite - eMbedded Visual C++

2004-11-05 Thread Mateusz Łoskot
Yes, it is.
I use sqlite-wince port (you'll find on http://sourceforge.net).
It compiles with eVC++ 3.0 and 4.0 successfuly.
I also compiled it using Intel compiler for Windows CE
(formely, for embedded VC++).
Greets
--
Mateusz Łoskot, mateusz (at) loskot (dot) net
Registered Linux User #220771, Debian (Sarge)


Re: [sqlite] compiler warnings

2004-11-05 Thread Cory Nelson
send in a patch ;)


On Fri, 5 Nov 2004 08:33:51 -0600, Stober, Mel <[EMAIL PROTECTED]> wrote:
> When I compile the 3.0.8 source with VC++ 6.0 (SP5 installed) compiler as a
> DLL, the compiler spews out 131 warnings about type mismatch, integral size
> mismatch, conversion from '__int64 ' to 'int, and a host of other
> miscellaneous warnings.
> 
> Any thoughts about the SQLite project programmers cleaning up this stuff?  I
> hate warnings and in my 20 years programming experience found that most
> warnings are really errors.  I can go through and clean up this mess myself,
> but would just have to do it again when I upgrade to a newer version.
> 
> Thanks
> 
> Mel Stober
> Tri-Cor Industries Inc./GATES AIT
> 618-632-9252 Ext 253
> 
> 


-- 
Cory Nelson
http://www.int64.org


[sqlite] compiler warnings

2004-11-05 Thread Stober, Mel
When I compile the 3.0.8 source with VC++ 6.0 (SP5 installed) compiler as a
DLL, the compiler spews out 131 warnings about type mismatch, integral size
mismatch, conversion from '__int64 ' to 'int, and a host of other
miscellaneous warnings.

Any thoughts about the SQLite project programmers cleaning up this stuff?  I
hate warnings and in my 20 years programming experience found that most
warnings are really errors.  I can go through and clean up this mess myself,
but would just have to do it again when I upgrade to a newer version.

Thanks

Mel Stober
Tri-Cor Industries Inc./GATES AIT
618-632-9252 Ext 253




Re: [sqlite] sqlite3_changes() != 0 after SELECT

2004-11-05 Thread Ben Summers
D. Richard Hipp wrote:
Ben Summers wrote:
> Hi,
>
> I'm finding that in version 3, sqlite3_changes() != 0 after a SELECT 
query has been executed.

What's the query?
I found this in a simple program which tests my database interface code.
The table is
CREATE TABLE tTest1 (
fID INTEGER PRIMARY KEY,
fInteger INTEGER,
fString VARCHAR(32)
);
then I do four inserts like
  INSERT INTO tTest1(fInteger,fString) VALUES(245,'string')
(after which sqlite3_changes() returns 1), and then the query
  SELECT fInteger,fString FROM tTest1 ORDER BY fInteger;
after which it still returns 1.
Sqlite v2.x returns 0 as expected.
Thanks,
Ben




Re: [sqlite] sqlite3 error in kexi-0.1beta5

2004-11-05 Thread Daniel Franke

> kexi: btree.c:1043: sqlite3BtreeOpen: Assertion
> `sizeof(ptr)==sizeof(char*)' failed. KCrash: Application 'kexi' crashing...

See also: 
http://www.mail-archive.com/sqlite-users%40sqlite.org/msg04718.html
http://bugs.kde.org/show_bug.cgi?id=92563

Daniel

-- 
Dipl.-Math. (FH) Daniel Franke
Institut fuer Medizinische Biometrie und Statistik
Medizinische UniversitÃt zu Luebeck
Ratzeburger Allee 160, Haus 4
23538 Luebeck
Telefon: 0451-500-2786
Telefax: 0451-500-2999
[EMAIL PROTECTED]

  /"\
  \ /  ÂASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
  ÂX              - AGAINST MS ATTACHMENTS
  / \