> ""Severin Müller"" <[EMAIL PROTECTED]> wrote
> in message news:[EMAIL PROTECTED]
> > int func(void)
> > {
> >         // database is open and the select statement is executed
> >         // this is the query: char *sql = "SELECT 'protect' FROM
> > 'test_db');";
> 
> This is not valid SQL. FROM clause expects a table name, not a string 
> literal.

The query is executed properly. It'd return if there was an error, i checked 
for it. 
> 
> > struct sqlite3_stmt *oStmt;
> > int rc;
> > int result = 0;
> >
> > if((rc=sqlite3_prepare_v2(db,sql,strlen(sql),&oStmt,NULL))==SQLITE_OK)
> 
> You should get an error here. If you don't, the statement you actually 
> run differs from the one you show.

Neither. No Error, and it's axactly the statement i'm passing

> 
> > {
> > if((rc=sqlite3_bind_int(oStmt,0,result))==SQLITE_OK)
> 
> You don't have any parameter placeholders in your statement. What 
> exactly are you binding here?

That's what i'm asking. I don't understand what todo with this call at all.

> 
> > {
> > if((rc=sqlite3_step(oStmt))==SQLITE_ROW)
> > {
> > printf("result: %i\n",result);
> 
> The variable 'result' is never modified in your code. What do you expect 
> to see in it, other than its initial value of zero?

i thought the variable result was changed to it's value in the sqlite3_bind_in 
function. 

> 
> > But i always get the following error message:
> >
> > "Bind or column index out of range"
> >
> > What did i do wrong?
> 
> You try to bind a parameter that doesn't exist in the statement.
> 
> Igor Tandetnik
> 
> 
> 

-- 
Freundliche Grüsse // Kind regards

IBM Global Technology Services Switzerland
Severin A. Mueller
Assistant eWP Teamleader
Mythenquai 2
CH-8022 Zurich
Office: +41 44 625 30 41
Mobile: +41 76 249 85 38


Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to