Well, I'm not sure what you are trying to do that you can't do with SQL.
I'll assume that you really want to iterate over all rows of ( a single
table? ) and conditionally update a field? If so, wouldn't a
"update tablename set [Classification]='Retired' where [Age]>65" do what
you need?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of danjenkins
Sent: Sunday, March 16, 2008 12:19 AM
To: [email protected]
Subject: [sqlite] Is there direct (non SQL) table access?


Is it possible to access a table without a SQL query?  I've been
searching and haven't found a way.
I'd like to do something like this:

sqlite3 *pDB = NULL; // database pointer
FILE* fp = fopen("people.db","a+");
sqlite3_open("people.db",&pDB);

// Pseudo code that I need help with follows...
while(!pDB->Eof){
    if(pDB->FieldValues["Age"] > 65;
        pDB->Edit();
        pDB->FieldValues["Classification"] = "Retired";
        pDB->Post();
    }
    pDB->Next();
}

fclose(fp);
sqlite3_close(pDB);

I'd really appreciate a couple of tips so I can get back on track with
my project.

Thanks a million.
Dan
--
View this message in context:
http://www.nabble.com/Is-there-direct-%28non-SQL%29-table-access--tp1607
5825p16075825.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to