This works -
... just after database is opened, compile the SQL statement
if (sqlite3_prepare(db, dbst_cart_wt_in_sel,
-1,
_cart_wt_in_sel,
_cart_wt_in_sel) != SQLITE_OK) {
errormet("908", (char *)sqlite3_errmsg(db));
My hunch is that you need to change the while() line to:
while ( (rc = sqlite3_step(pStmt)) != SQLITE_DONE )
But I could be wrong, and I don't have a computer with a C compiler to test
this right now.
Terence MacDonald <[EMAIL PROTECTED]> wrote:
The following code is part of a class
The following code is part of a class member function that loads data
from an existing database. The database has been opened and there IS
data in the target table. I have had it working with callbacks, but
using the prepare/step/finalise approach below I consistently get the
log message:
Step :
On Mon, 2005-10-17 at 14:49 -0600, Dennis Cote wrote:
> Jay Sprenkle wrote:
>
> >>To use the sqlite3 return value to initialize a standard string in C++
> >>you need to do the following:
> >>
> >>const char* p = reinterpret_cast >>char*>(sqlite3_column_text(pStmt, 0));
> >>std::string
debra f wrote:
I'm trying to determine how (if possible without writing
extension) to split a single column by a character value - for
example
Column AgeRange has values such as 20-30, 40-50
I'd like to do something like...
select substr(agerange,1,instr(agerange,'-')-1) as StartAge,
Jay Sprenkle wrote:
To use the sqlite3 return value to initialize a standard string in C++
you need to do the following:
const char* p = reinterpret_cast(sqlite3_column_text(pStmt, 0));
std::string zName(p);
The cast changes the type of the return value to match the type needed
by the
> To use the sqlite3 return value to initialize a standard string in C++
> you need to do the following:
>
> const char* p = reinterpret_cast char*>(sqlite3_column_text(pStmt, 0));
> std::string zName(p);
>
> The cast changes the type of the return value to match the type needed
> by the
Personally I would start from the database and generate code to match the
schema. Like others pointed out it's fairly difficult to go the other way.
I'm trying to determine how (if possible without writing
extension) to split a single column by a character value - for
example
Column AgeRange has values such as 20-30, 40-50
I'd like to do something like...
select substr(agerange,1,instr(agerange,'-')-1) as StartAge,
Terry MacDonald wrote:
Hi,
New to the list, so apologies if this has already been answered, I
just can't find anything on my searches.
I am writings something in C++ and I am also using the
prepare/step/finalize approach to retrieve values from the sqlite
database: no callbacks - messy in
On 10/17/05, Terry MacDonald <[EMAIL PROTECTED]> wrote:
> Hi,
>
> New to the list, so apologies if this has already been answered, I just
> can't find anything on my searches.
>
> I am writings something in C++ and I am also using the
> prepare/step/finalize approach to retrieve values from the
Hi all,
I just recently got the SQLITE_FULL error while trying to insert a row
into a table. What does it mean when the database is full? Out of
disk space perhaps or did I hit some internal constraint?
Here's a except from my log:
Oct 14 17:49:19 [8048/3899832] ERROR: SQL statement failure
Hello John-
Thanks for your comments. Could you please provide some details on how
you have generated XML from custom data-structure and how you propose to
do this for SQL schema as well.
Any code examples would really help.
Rajan
>-Original Message-
>From: John Stanton
I my experience, the best approach is to create a description of your data
in a form that is good for being parsed and feeding into a code generator.
C structures are not good for this, they are good for being compiled into
executable code.
I would create a data description, and use it to
I am using C and do this:
char *values;
values = (char *)sqlite3_column_text(pStmt, i);
and I don't have any problems..
I'm not sure if that helps you at all.
Terry MacDonald
Hi,
New to the list, so apologies if this has already been answered, I just
can't find anything on my searches.
I am writings something in C++ and I am also using the
prepare/step/finalize approach to retrieve values from the sqlite
database: no callbacks - messy in C++.
There may be a
I addressed this some time back in a C program which dynamically
generates XML. Generating SQL would be an option.
By building a table with a keyname for each data element and a pointer
to a data item the output structure can be assembled. As a wise person
once told me "There is no problem
.Net has a tool (xsd.exe) that can convert C# structure to XML schema.
I don't know whether it can help you.
- Original Message -
From: "Dan Kennedy" <[EMAIL PROTECTED]>
To:
Sent: Monday, October 17, 2005 4:50 PM
Subject: Re: [sqlite] Question about automatic
As far as I know C++ has no introspection capability so the answer
is probably no. Unless you want to parse your header file yourself,
or something like that.
With Java or another high-level programming language that supports
introspection it would be possible I think.
"Rajan, Vivek K"
19 matches
Mail list logo