Re: [sqlite] Need a sqlite c api that wrires data into a table.

2012-01-13 Thread Steve and Amy
If I understand your question, the answer is NO. There is NO function like sqlite3_insert_data_into_table(TableName, Data, FieldName). The SQL engine responsible for reading and writing data from and to tables only responds to SQL queries passed to it via functions like sqlite3_exec(). For

[sqlite] Need a sqlite c api that wrires data into a table.

2012-01-12 Thread bhaskarReddy
, the particular function will enter the record of values into that table. Is there any C API like that in SQlite. Regards, Bhaskar -- View this message in context: http://old.nabble.com/Need-a-sqlite-c-api-that-wrires-data-into-a-table.-tp33132538p33132538.html Sent from the SQLite

[sqlite] C API docs

2011-10-24 Thread Baruch Burstein
How are the C API documents auto-generated? Which tool is used? I see that they are all in the comments in the code, but couldn't find a tool in the source that is used to extract them and make the links. -- Programming today is a race between software engineers striving to build bigger and

Re: [sqlite] C API docs

2011-10-24 Thread Eugene N
hi Perhaps it widely popular doxygen, although its just a guess Eugene 2011/10/24 Baruch Burstein bmburst...@gmail.com How are the C API documents auto-generated? Which tool is used? I see that they are all in the comments in the code, but couldn't find a tool in the source that is used to

Re: [sqlite] C API docs

2011-10-24 Thread Alek Paunov
I do not know the answer, but I am thinking for an attempt to extract them as clang+lpeg exercise. Why you are asking ... ? On 24.10.2011 16:05, Baruch Burstein wrote: How are the C API documents auto-generated? Which tool is used? I see that they are all in the comments in the code, but

Re: [sqlite] C API docs

2011-10-24 Thread Richard Hipp
On Mon, Oct 24, 2011 at 9:05 AM, Baruch Burstein bmburst...@gmail.comwrote: How are the C API documents auto-generated? Which tool is used? I see that they are all in the comments in the code, but couldn't find a tool in the source that is used to extract them and make the links. The SQLite

Re: [sqlite] C API docs

2011-10-24 Thread Simon Slavin
On 25 Oct 2011, at 2:40am, Richard Hipp wrote: On Mon, Oct 24, 2011 at 9:05 AM, Baruch Burstein bmburst...@gmail.comwrote: How are the C API documents auto-generated? Which tool is used? I see that they are all in the comments in the code, but couldn't find a tool in the source that is

Re: [sqlite] c-api document suggestion

2011-09-23 Thread Mirek Suk
Dne 23.9.2011 4:41, Igor Tandetnik napsal(a): Mira Sukmira@centrum.cz wrote: On 9/21/2011 21:22 Igor Tandetnik wrote: You can include the NUL terminator, if you want it to actually be stored in the database. Actually you can't - if you do all SQL string functions will not work. to be

Re: [sqlite] c-api document suggestion

2011-09-23 Thread Simon Slavin
On 23 Sep 2011, at 11:18am, Mirek Suk wrote: I just find entire nul handling in SQLite strange. it's C API why not expect C (that is nul terminated) strings. That's more or less the problem: C expects 0x00 termination. But SQLite3 is written to support UTF-8 and UTF-16 strings of specified

Re: [sqlite] c-api document suggestion

2011-09-23 Thread Igor Tandetnik
Mirek Suk mira@centrum.cz wrote: I just find entire nul handling in SQLite strange. it's C API why not expect C (that is nul terminated) strings. Because some people do want to store strings with embedded NULs, for various reasons. If you don't, just pass -1 for length and be done with it.

Re: [sqlite] c-api document suggestion

2011-09-23 Thread Tim Streater
On 23 Sep 2011 at 11:18, Mirek Suk mira@centrum.cz wrote: Dne 23.9.2011 4:41, Igor Tandetnik napsal(a): Note that I didn't say it was wise to store NUL characters as part of the string - I only said that you could do it if you wanted to. sqlite3_bind_text takes the length parameter at

Re: [sqlite] c-api document suggestion

2011-09-22 Thread Mira Suk
On 9/21/2011 21:22 Igor Tandetnik wrote: You can include the NUL terminator, if you want it to actually be stored in the database. Igor Tandetnik Actually you can't - if you do all SQL string functions will not work. to be clear - SELECT TRIM(what ever text column you stored with including

Re: [sqlite] c-api document suggestion

2011-09-22 Thread Igor Tandetnik
Mira Suk mira@centrum.cz wrote: On 9/21/2011 21:22 Igor Tandetnik wrote: You can include the NUL terminator, if you want it to actually be stored in the database. Actually you can't - if you do all SQL string functions will not work. to be clear - SELECT TRIM(what ever text column

[sqlite] c-api document suggestion

2011-09-21 Thread Sean Pieper
There's an apparent inconsistency in the behavior of sqlite3_bind_text and sqlite3_prepare_v2. If the user supplies the length of the argument rather than using -1, bind_text expects that this length exclude the null termination, whereas prepare apparently expects it to include the null

Re: [sqlite] c-api document suggestion

2011-09-21 Thread Igor Tandetnik
On 9/21/2011 3:05 PM, Sean Pieper wrote: There's an apparent inconsistency in the behavior of sqlite3_bind_text and sqlite3_prepare_v2. If the user supplies the length of the argument rather than using -1, bind_text expects that this length exclude the null termination, You can include the

Re: [sqlite] c-api document suggestion

2011-09-21 Thread Pavel Ivanov
If the user supplies the length of the argument rather than using -1, bind_text expects that this length exclude the null termination, whereas prepare apparently expects it to include the null termination. Can I challenge you in that this conclusion is wrong? Everywhere in the development

Re: [sqlite] c-api document suggestion

2011-09-21 Thread Richard Hipp
On Wed, Sep 21, 2011 at 3:05 PM, Sean Pieper spie...@nvidia.com wrote: There's an apparent inconsistency in the behavior of sqlite3_bind_text and sqlite3_prepare_v2. If the user supplies the length of the argument rather than using -1, bind_text expects that this length exclude the null

Re: [sqlite] c-api document suggestion

2011-09-21 Thread Sean Pieper
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp Sent: Wednesday, September 21, 2011 12:23 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] c-api document suggestion On Wed, Sep 21, 2011 at 3:05 PM, Sean

[sqlite] c-api

2011-07-27 Thread Baruch Burstein
Is there an easier way to get a single value (for instance select last_insert_rowid(); ) then prepare - step - column - finalize? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] c-api

2011-07-27 Thread Igor Tandetnik
Baruch Burstein bmburst...@gmail.com wrote: Is there an easier way to get a single value (for instance select last_insert_rowid(); ) then prepare - step - column - finalize? For this specific example, there's sqlite3_last_insert_rowid API function. In general, no, there's no special way to

Re: [sqlite] c-api

2011-07-27 Thread Doug Currie
On Jul 27, 2011, at 9:22 AM, Baruch Burstein wrote: Is there an easier way to get a single value (for instance select last_insert_rowid(); ) then prepare - step - column - finalize? http://www.sqlite.org/capi3ref.html#sqlite3_last_insert_rowid e

Re: [sqlite] c-api

2011-07-27 Thread John Deal
Hello Baruch, You may want to look at sqlite3_exec() (http://www.sqlite.org/c3ref/exec.html). John --- On Wed, 7/27/11, Baruch Burstein bmburst...@gmail.com wrote: From: Baruch Burstein bmburst...@gmail.com Subject: [sqlite] c-api To: General Discussion of SQLite Database sqlite-users

[sqlite] [C-API] Query returns only 0

2010-09-30 Thread Legen Där
Hello Gyus, ive got problems with my qeuries. After loading a table, i create a statement for every column to prepare the querys. A sample for such a prepared query is.. SELECT F_SIZE_M0200_m0_VALUE FROM fileInfos WHERE FILEINFO_FULLNAME = ?1 ...for that query i bind TEXT values

Re: [sqlite] [C-API] Query returns only 0

2010-09-30 Thread Martin.Engelschalk
Hello Gerald, i think you should tell us more about what you are trying to do and add some C code. what do you mead by return value? What functions do you call? Do you know that you have to get the selected value by calling a function like sqlite3_column_text ? Martin Am 30.09.2010 11:41,

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin Sigwald wrote: Here is the actual code: int main(void) { sqlite3* db_handle; sqlite3_open(DB_NAME,db_handle); sqlite3_close(db_handle); my_ping(10.0.0.4); return 0; } If I call close after ping, it

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Martin Sigwald
I tried using STRACE, unfortunately, I am quite new to Linux programming, so I can't make much sense out of the output. I attached it to this email, in case some kind soul would like to take a look at it. The program ran is exactly this: #include stdio.h #include stdlib.h #include sqlite3.h

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Martin Sigwald
While I could gather, both the open system called generated by the DB and the socket() syscall are returning a FD=3. That is, they are both trying to use the same filedescriptor. My guess is packets get sent to that file descriptor, instead of the port. How can I changed this? I just followed

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Jay A. Kreibich
On Wed, Mar 24, 2010 at 12:05:58PM -0300, Martin Sigwald scratched on the wall: While I could gather, both the open system called generated by the DB and the socket() syscall are returning a FD=3. That is, they are both trying to use the same filedescriptor. My guess is packets get sent to

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread David Baird
On Wed, Mar 24, 2010 at 9:05 AM, Martin Sigwald msigw...@gmail.com wrote: While I could gather, both the open system called generated by the DB and the socket() syscall are returning a FD=3. That is, they are both trying to use the same filedescriptor. My guess is packets get sent to that file

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Martin Sigwald
I meant socket. I know sockets are FDs. My mistake, sorry. Yes, I tried putting the call before Sqlite calls and it works perfectly. If I put it between open and close it works, provided I dont do anything else. For example, if I open the DB, ping, then run a query then ping again, the second ping

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread David Baird
On Wed, Mar 24, 2010 at 9:24 AM, David Baird dhba...@gmail.com wrote: On Wed, Mar 24, 2010 at 9:05 AM, Martin Sigwald msigw...@gmail.com wrote: While I could gather, both the open system called generated by the DB and the socket() syscall are returning a FD=3. That is, they are both trying to

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread paivanof
I don't notice any cases of where a stale file descriptor is being accessed.  I'm stumped :-/ Can it be a problem with clone() calls? AFAIK, it's how SQLite checks if it can work safely from multiple threads. Martin, can you recompile SQLite with SQLITE_THREADSAFE set to 0 and look if your

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Martin Sigwald
I'm attaching the strace output for the following code you asked: int main(void){ sqlite3* db_handle=NULL; if(sqlite3_open(guido.db,db_handle)) { //abro DB fprintf(stderr,Error while open DB:%s\n,sqlite3_errmsg(db_handle)); printf(No pude abrir la DB\n);

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread David Baird
On Wed, Mar 24, 2010 at 9:42 AM, Martin Sigwald msigw...@gmail.com wrote: I meant socket. I know sockets are FDs. My mistake, sorry. Yes, I tried putting the call before Sqlite calls and it works perfectly. If I put it between open and close it works, provided I dont do anything else. For

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Martin Sigwald
Doing N pings after a _close or a query has the same result as doind one: not one of them works. On Wed, Mar 24, 2010 at 2:07 PM, David Baird dhba...@gmail.com wrote: On Wed, Mar 24, 2010 at 9:42 AM, Martin Sigwald msigw...@gmail.com wrote: I meant socket. I know sockets are FDs. My mistake,

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread David Baird
On Wed, Mar 24, 2010 at 11:09 AM, Martin Sigwald msigw...@gmail.com wrote: Doing N pings after a _close or a query has the same result as doind one: not one of them works. Do 2 pings work ever? For example, how about each of these scenarios? open_db ping ping close_db or ping ping or

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Martin Sigwald
Problem Solved: As some one point out, it was MY fault. When allocating memory for my ICMP packets I wasnt doind a bzero to fill all fields with 0, so some garbage generated by Sqlite use of memory was corrupting my packets. Thank you all for the help. One of the best user groups I ever met.

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Pavel Ivanov
When allocating memory for my ICMP packets I wasnt doind a bzero to fill all fields with 0, so some garbage generated by Sqlite use of memory was corrupting my packets. And still try please my very first suggestion - run you program with valgrind (just to get used to it and to use it right

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread David Baird
On Wed, Mar 24, 2010 at 11:19 AM, Martin Sigwald msigw...@gmail.com wrote: Problem Solved: As some one point out, it was MY fault. When allocating memory for my ICMP packets I wasnt doind a bzero to fill all fields with 0, so some garbage generated by Sqlite use of memory was corrupting my

Re: [sqlite] SQlite C API screwing port access?

2010-03-24 Thread Martin Sigwald
Will do. Thanks again to everyone. At least I learned how to use strace, which I didnt no. On Wed, Mar 24, 2010 at 2:25 PM, Pavel Ivanov paiva...@gmail.com wrote: When allocating memory for my ICMP packets I wasnt doind a bzero to fill all fields with 0, so some garbage generated by Sqlite

[sqlite] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
I have a program which builds an ICMP package over IP and sends it. Before that, I get IP number and other information from a SQlite DB. I was having problems, so I began to comment different parts of the code, until I got to this code (pseudocode): sqlite3_open(DB_NAME); sqlite3_close(DB_NAME);

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Pavel Ivanov
Does your pinging code involves some pointers to memory (strings or any other stuff) that could be already released before SQLite code is called? Try to run your program under valgrind and see whether it gives any errors. Pavel On Tue, Mar 23, 2010 at 12:55 PM, Martin Sigwald msigw...@gmail.com

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Simon Slavin
On 23 Mar 2010, at 4:55pm, Martin Sigwald wrote: sqlite3_open(DB_NAME); sqlite3_close(DB_NAME); ping_server(10.0.0.4); //my ping function, which pings a hardcoded IP, doesnt interact with DB If I run that code, the package nevers gets send (can't detect it with Wireshark). If a

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Teg
Hello Martin, Do the ping both before and after you open the DB. ping_server(10.0.0.4); //my ping function, which pings a hardcoded IP, sqlite3_open(DB_NAME); sqlite3_close(DB_NAME); ping_server(10.0.0.4); //my ping function, which pings a hardcoded IP, See if the first one works. That'll

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
I already tried that, and the first ping works while the second one doesn't, which validates my screwing ports theory. Simon: Tried changing the DB_NAME and it didnt work either. Pavlov: Yes, I allocate memory inside the ping function, but that is done after calling de sqlite functions. There

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Pavel Ivanov
Pavel: Yes, I allocate memory inside the ping function, but that is done after calling de sqlite functions. There are no pointers shared between the sqlite functions and the ping part. Actually I meant pointers shared between ping part and the part before calls to sqlite functions. Did you try

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Matthew L. Creech
On Tue, Mar 23, 2010 at 12:55 PM, Martin Sigwald msigw...@gmail.com wrote: I have a program which builds an ICMP package over IP and sends it. Before that, I get IP number and other information from a SQlite DB. I was having problems, so I began to comment different parts of the code, until I

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
Here is the actual code: int main(void) { sqlite3* db_handle; sqlite3_open(DB_NAME,db_handle); sqlite3_close(db_handle); my_ping(10.0.0.4); return 0; } If I call close after ping, it works. However, if besides of opening the DB I perform any query, ping doesnt work

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Simon Slavin
On 23 Mar 2010, at 7:06pm, Martin Sigwald wrote: Here is the actual code: int main(void) { sqlite3* db_handle; sqlite3_open(DB_NAME,db_handle); sqlite3_close(db_handle); my_ping(10.0.0.4); return 0; } If I call close after ping, it works. However, if besides

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Martin Sigwald
DB_NAME equals servers.db. Both close and open return 0, my code catches a possible error, I didnt included for legibility. I tired using :memory:, same result: cant ping. These is quite frustrating. On Tue, Mar 23, 2010 at 4:23 PM, Simon Slavin slav...@bigfraud.org wrote: On 23 Mar 2010, at

Re: [sqlite] SQlite C API screwing port access?

2010-03-23 Thread Simon Slavin
On 23 Mar 2010, at 7:29pm, Martin Sigwald wrote: DB_NAME equals servers.db. Both close and open return 0, my code catches a possible error, I didnt included for legibility. I tired using :memory:, same result: cant ping. These is quite frustrating. Hmm. Thanks for trying. If both of

[sqlite] C++ API

2010-02-27 Thread eternelmangekyosharingan
Hi, Let's assume you need to insert a small number of rows in a given table using the C++ API. Is it recommended to use the one-step query execution interface function sqlite3_exec over the pre-compiled statement interface functions sqlite3_prepare_v2, sqlite3_bind_int, ..., sqlite3_step ? Is

Re: [sqlite] C++ API

2010-02-27 Thread Jay A. Kreibich
On Sat, Feb 27, 2010 at 09:55:07AM +0100, eternelmangekyosharingan scratched on the wall: Let's assume you need to insert a small number of rows in a given table using the C++ API. Is it recommended to use the one-step query execution interface function sqlite3_exec over the pre-compiled

[sqlite] [C] API: INSERT OR REPLACE

2009-03-27 Thread Severin Müller
Hello I wam writing a program where i need some data. I try to dynamically create a database for this. All my data are stored in a struct, resp. several structs. What I need now, is to know, whether it's possible to check every row I'm submitting for existance, like: row1: data1 data2 data3

Re: [sqlite] [C] API: INSERT OR REPLACE

2009-03-27 Thread mrobi002
Hi Severin, I found very useful the actual code samples at this location: http://www.apress.com/book/downloadfile/2847 The samples for C are under the subdirectory CAPI, there is no subdirectory called C Also you will find additional information at http://www.sqlite.org/c_interface.html

Re: [sqlite] [C] API: INSERT OR REPLACE

2009-03-27 Thread Igor Tandetnik
Severin Müller severin.muel...@gmx.net wrote in message news:20090327084050.24...@gmx.net I wam writing a program where i need some data. I try to dynamically create a database for this. All my data are stored in a struct, resp. several structs. What I need now, is to know, whether it's

[sqlite] Performance - SQLite ODBC against SQLite C API on SLES10

2008-10-09 Thread Darko Filipovic
Hello, I'm doing some performance tests comparing SQLite ODBC and SQLite C API (both 3.5.2 version) on SLES10 (64bit). I'm inserting 1000 rows into 4 columns table (int, int64, double, int64) out of transaction and I'm getting much lower performance using SQLite API (about 10 seconds slower

Re: [sqlite] C++ api - callbacks problem

2008-03-03 Thread Dennis Cote
Toby Roworth wrote: Looking at the API reference. it would apear you can send an extra custom argument to the callback fro sqlite3_exec, using the 4th parameter - how does this work, It works well. :-) and inperticular, could I pass an object through to the call back, Yes. and if

[sqlite] C++ api - callbacks problem

2008-03-01 Thread Toby Roworth
Hello all Looking at the API reference. it would apear you can send an extra custom argument to the callback fro sqlite3_exec, using the 4th parameter - how does this work, and inperticular, could I pass an object through to the call back, and if so, how? Thanks Toby

[sqlite] C++ api - callbacks problem

2008-03-01 Thread Toby Roworth
Hello all Looking at the API reference. it would apear you can send an extra custom argument to the callback fro sqlite3_exec, using the 4th parameter - how does this work, and inperticular, could I pass an object through to the call back, and if so, how? Thanks Toby

[sqlite] C++ api - callbacks problem

2008-03-01 Thread Toby Roworth
Hello all Looking at the API reference. it would apear you can send an extra custom argument to the callback fro sqlite3_exec, using the 4th parameter - how does this work, and inperticular, could I pass an object through to the call back, and if so, how? Thanks Toby

[sqlite] C++ API callback problem

2008-03-01 Thread Toby Roworth
Hello all Looking at the API reference. it would apear you can send an extra custom argument to the callback fro sqlite3_exec, using the 4th parameter - how does this work, and inperticular, could I pass an object through to the call back, and if so, how? Thanks Toby

Re: [sqlite] C++ API callback problem

2008-03-01 Thread Teg
Hello Toby, You can pass in anything you want, a pointer, a number. As long as it fits in the native size of the parameter. You can pass the ADDRESS of an object as long as it doesn't go out of scope between the call and when the processing finishes. I tend to pass the this pointer to the class

Re: [sqlite] C++ API callback problem

2008-03-01 Thread Igor Tandetnik
Toby Roworth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Looking at the API reference. it would apear you can send an extra custom argument to the callback fro sqlite3_exec, using the 4th parameter - how does this work, and inperticular, could I pass an object through to the call

Re: [sqlite] C++ API callback problem

2008-03-01 Thread Toby Roworth
Thanks Igor and Teg, I think I know were I was going wrong now. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Jerry Krinock
I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the type using sqlite3_column_type(), then 'switches' to get the value using

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread John Stanton
An integer is always 64 bits. Jerry Krinock wrote: I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the type using

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Kees Nuyt
On Thu, 3 Jan 2008 16:57:12 -0800, Jerry Krinock [EMAIL PROTECTED] wrote: I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Jerry Krinock
On 2008 Jan, 03, at 17:21, Kees Nuyt wrote: If I understand the info at http://www.sqlite.org/c3ref/c_blob.html well, the INTEGER is always a 64-bit signed integer. Internally, integers are compressed, so they don't occupy eight bytes all the time. sqlite3_column_int64(); will always

Re: [sqlite] C API: Manifest type SQLITE_INTEGER: Is it 32- or 64-bit?

2008-01-03 Thread Dan
On Jan 4, 2008, at 7:57 AM, Jerry Krinock wrote: I need to read an sqlite database generated by others. So I wrote an outer loop which steps through the rows of a table using sqlite3_step, and an inner loop which steps through the columns. The inner loop finds the type using

[sqlite] C API trouble

2007-09-30 Thread Andrew Sledge
Hi, first off thank you to all of the regulars who have made my life easier :). I have a C program that pulls data from a SQLite3 database into a variable and then uses that data to do other things. However, when I iterate through the returns (no matter how many) the data never gets outside of

Re: [sqlite] C API trouble

2007-09-30 Thread Mike Polyakov
Besides the unneded function calls, and a lot of checks for valid data, the problem here is that you have to copy data using memcpy or somthing similar: instead of chCommand = (const char*)sqlite3_column_text(ptrSel,2); do memcpy(chCommand, sqlite3_column_text(ptrSel,2),

Re: [sqlite] C API trouble

2007-09-30 Thread Andrew Sledge
Hi Mike, That did the trick. I am new to C, but I have used SQLite in Perl and Python. Thanks!* List: sqlite-users http://marc.info/?l=sqlite-usersr=1w=2 Subject:Re: [sqlite] C API trouble From: Mike Polyakov mike.polyakov () gmail ! com http://marc.info/?a=114953723100011r=1w

[sqlite] C API Question

2006-05-05 Thread Anders Persson
I have written a wrapper around iRes = sqlite3_get_table(db,sql,resultp,nrow,ncolumn,errmsg); But only SELECT works not INSERT or UPDATE any ide.. missing somting // Anders

Re: [sqlite] C API Question

2006-05-05 Thread Derrell . Lipman
Anders Persson [EMAIL PROTECTED] writes: I have written a wrapper around iRes = sqlite3_get_table(db,sql,resultp,nrow,ncolumn,errmsg); But only SELECT works not INSERT or UPDATE any ide.. missing somting The database file or the directory in which it is contained is read-only? Obviously

Re: [sqlite] C API Question

2006-05-05 Thread Jay Sprenkle
On 5/5/06, Anders Persson [EMAIL PROTECTED] wrote: I have written a wrapper around iRes = sqlite3_get_table(db,sql,resultp,nrow,ncolumn,errmsg); But only SELECT works not INSERT or UPDATE any ide.. missing somting get table only works with select. Insert and update don't return a result

[sqlite] C++ wrapper for SQLite C API

2005-10-25 Thread Alfredo Cole
Hi: I am looking for a C++ wrapper that will support all features of SQLite. I am using sqlitewrapped-1.0 but does not work correctly when trying to read from a table and insert to another one within the same method. Also, it seems the author is not working on it any longer. I would

Re: [sqlite] C++ wrapper for SQLite C API

2005-10-25 Thread Martin Engelschalk
Hello Alfredo, i used a Wrapper from CodeProject by Rob Groves: http://www.codeproject.com/database/CppSQLite.asp I changed the code a bit (mostly deleted stuff i do not need), and i am not sure if all features of SQLite are wrapped, but the code is easy to understand and can easily be

Re: [sqlite] C++ wrapper for SQLite C API

2005-10-25 Thread Alfredo Cole
El Martes, 25 de Octubre de 2005 08:55, Martin Engelschalk escribió: Hello Alfredo, i used a Wrapper from CodeProject by Rob Groves: http://www.codeproject.com/database/CppSQLite.asp I changed the code a bit (mostly deleted stuff i do not need), and i am not sure if all features of

Re: [sqlite] How to load a SQLite schema from file using SQLite C-API

2005-09-16 Thread Kurt Welgehausen
I have SQLite schema in an ascii file. I would like to be able to load this schema via SQLite C-API. How do I do this? You can look at the source code for the SQLite shell and see how it implements the .read command, but it may be simpler just to invoke the SQLite shell using system() or exec

[sqlite] C++ API: Retrieve multiple rows into struct, using callback

2005-08-26 Thread Cam Crews
Hi. I'm new to sqlite and would like to use the sqlite C++ API to return multiple rows from a SELECT statement. I'm able to load a single row's result into a struct pass it back by reference through the callback, but haven't been able to find any resources recommending a method for returning

Re: [sqlite] C++ API: Retrieve multiple rows into struct, using callback

2005-08-26 Thread Jay Sprenkle
On 8/26/05, Cam Crews [EMAIL PROTECTED] wrote: Hi. I'm new to sqlite and would like to use the sqlite C++ API to return multiple rows from a SELECT statement. I'm able to load a single row's result into a struct pass it back by reference through the callback, but haven't been able to find

Re: [sqlite] C++ API: Retrieve multiple rows into struct, using callback

2005-08-26 Thread Keith Herold
, Jay Sprenkle [EMAIL PROTECTED] wrote: On 8/26/05, Cam Crews [EMAIL PROTECTED] wrote: Hi. I'm new to sqlite and would like to use the sqlite C++ API to return multiple rows from a SELECT statement. I'm able to load a single row's result into a struct pass it back by reference through