On 01.02.2012 11:10, Guy Terreault wrote:
On 12-02-01 04:32 AM, Marcus Grimm wrote:

On 01.02.2012 09:32, Guy Terreault wrote:
On 12-02-01 03:03 AM, Larry Brasfield wrote:

I cannot answer why Simon does not write demo code at every opportunity, but I 
think I speak for more than just myself
by revealing that I have other work, and a life, and consider time a scarce 
resource.

Thanks Larry for taking some of your precious time to not just answer the 
question.
And I have read shell.c and it is giberish to me.

I would write the code myself if I new it. I guess I will have to wait until 
someone has more time to answer properly.

What we don't understand is why one can use sqlite without knowing
the rather basic operation like executing an sql command...
Anyway, if you look again at
http://www.sqlite.org/quickstart.html
you may extract something like:

int main(int argc, char **argv)
{
sqlite3 *db;

if( sqlite3_open("mysqlite.db", &db) )
{
sqlite3_exec(db, "PRAGMA journal_mode = WAL;", NULL, 0, 0);
sqlite3_close(db);
}
return(0);
}

pretty easy, isn't it ?

hth
Marcus


Thanks Marcus
this is what should have been done as an answer to the initial question.

My interventions was to point out that this mailing list is read by everybody 
and yes some are new to sqlite and some
are also new to c code. and it is sometimes difficult to distinguish the two.

OK, then your request was unlucky misleading, since you ask for wal
mode which implies that you already know something about sqlite.
Wal mode is something to worry after the usage of sqlite came to
a certain point.


sqlite3_exec and all the other function you use in your example are from the 
sqlite API
and yes consulting it is a good thing. And now with your example we will all be 
interested to consult it to understand
what all the parameters do.

I think sqlite3_exec is not a good point to start - It is wrapper around some 
basic
sqlite API functions. I'm rather not using it for standard sql queries as it
requires some "surrounding" work to make it usable.
What you might look at to start are these (basic) functions:

 sqlite3_open_v2, sqlite3_prepare_v2, sqlite3_step, sqlite3_finalize, 
sqlite3_close.
 then sqlite3_column_XXX to retrieve values, etc.

These functions are explained quite well, however if you run into trouble
using these or others this list will for sure assist.
Actually, I'm happy to see some more API related questions rather than
"I'm using .NET ADO DLL stuff, DLL not found, VS2005 How to add a DB connection ?, 
..."
sort of question which increase, but that's another story... :-)

Have fun with sqlite, it's a cool piece of software.

Marcus


If I look at this http://www.sqlite.org/c3ref/funclist.html they are so many 
functions. finding the one a new guy needs
is scary. And http://www.sqlite.org/c3ref/exec.html does explain all, but your 
example does it in 3 or 4 lines.

And we all thank your simple example that we can build on it.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to