No, you don't need sqlite3_reset() inside the loop. The pseudocode
should be:
open
prepare
loop while not at end of file
step
read
repeat
finalize
close
For the "read" portion, use the sqlite_column_xxx() methods.
And wrap every single string in your co
Mark Wyszomierski wrote:
> Why do we want to use sqlite3_reset() in the for loop? If I leave it
> in, the loop keeps running forever since I guess it really does keep
> resetting the sql statement. Do we need it though inside the while
> loop when SQLITE_BUSY is returned though? Is that the prop
If you have no variables in your SQL (like SELECT * FROM ...) then you
don't bind.
If you have "SELECT * FROM junk WHERE name=?" then you need to bind like
this. The bind is good until you do a reset.
char that_name = "Harry";
...
rc = sqlite3_bind_text(xek, 1, that_name, -1, SQLITE_STATIC);
Mark Wyszomierski wrote:
John, Cory, thank you very much. I got execute plain statements ok by
modifying my earlier posting a bit. I was able to create a table using
the prepare statement.
Previously I was using sqlite3_exec() to execute my statements and I
could pass it a callback function whic
Hi Nikki,
Why do we want to use sqlite3_reset() in the for loop? If I leave it
in, the loop keeps running forever since I guess it really does keep
resetting the sql statement. Do we need it though inside the while
loop when SQLITE_BUSY is returned though? Is that the proper way to
try again afte
Mark Wyszomierski wrote:
>strSql.Format(_T("SELECT * FROM test"));
>
>sqlite3_stmt *pStmt;
>const char *pszTailPointer;
>int nRetVal = sqlite3_prepare(db, strSql, strSql.GetLength(),
> &pStmt, &pszTailPointer);
>if (nRetVal != SQLITE_OK) {
>TRACE("prepare fails!!
I suppose this is correct:
strSql.Format(_T("SELECT * FROM test"));
char szSomething[500];
int nTest = sqlite3_bind_text(pStmt, 1, szSomething, 500, SQLITE_STATIC);
if (nTest != SQLITE_OK) {
TRACE("sqlite3_bind_text fails!! [%i] [%s]\n", nTest, sqlite3_errmsg(db));
}
but can I use the string
John, Cory, thank you very much. I got execute plain statements ok by
modifying my earlier posting a bit. I was able to create a table using
the prepare statement.
Previously I was using sqlite3_exec() to execute my statements and I
could pass it a callback function which I could use to fetch dat
Mark Wyszomierski wrote:
Hi Cory,
Alright I gave it a shot from the docs but I'm not handling the
prepare statement correctly. I'm trying the ASCI version first. The
prepare statement returns an error. Here is the code snippet I'm
trying:
strSql.Format("CREATE TABLE test (something TEXT, somet
Hi Cory,
Alright I gave it a shot from the docs but I'm not handling the
prepare statement correctly. I'm trying the ASCI version first. The
prepare statement returns an error. Here is the code snippet I'm
trying:
strSql.Format("CREATE TABLE test (something TEXT, something_else TEXT,
primary ke
On 8/13/06, Mark Wyszomierski <[EMAIL PROTECTED]> wrote:
Hi,
I have been using sqlite on windows for a few months, it is great. I
need to switch over to unicode support now though, and I am confused
how to do this with sqlite.
1) First, when I compiled the original sqlite project, I have the
ch
Hi,
I have been using sqlite on windows for a few months, it is great. I
need to switch over to unicode support now though, and I am confused
how to do this with sqlite.
1) First, when I compiled the original sqlite project, I have the
character set to MBCS. Should I switch this to Unicode and r
12 matches
Mail list logo