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
, 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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
-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
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
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
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
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
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
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,
-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
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
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
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
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
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
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
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
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);
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
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,
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
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.
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
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
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
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);
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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),
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
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
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
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
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
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
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
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
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
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
, 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
83 matches
Mail list logo