Thanks Mihai for u r response.

with the help of sqlite3_prepare,sqlite3_step,sqlite3_column_int() functions
i am getting the values in my c++ program.
i will try u r way also(for the time being not executed it now)after trying
that i will send my response

thanks
krishcbe


Mihai Limbasan wrote:
> 
> kriscbe wrote:
>> more clearly
>>
>> in my c++ program:
>>
>> int value = sql.exe("select counter form tbl1 where name = 'accept'");
>> in this sql.exe is my function which invokes the "sqlite3_exec" function
>>
>> i want that counter value into the "value" variable .
>>
>>   
> If you use sqlite3_exec, you must specify a pointer to a callback 
> function (which must use the same calling convention as sqlite3_exec, 
> typically cdecl on Unix-ish operating systems) as the 3rd argument in 
> the call to sqlite3_exec. That function is called once for each row of 
> the result set and receives pointers to where the retrieved data is 
> stored. The function must have this signature:
> 
> int my_exec_callback(void* pUserData, int numCols, char** pzValues, 
> char** pzColNames)
> 
> pUserData gets passed through unmodified from the 4th argument of the 
> sqlite3_exec invocation.
> numCols holds the number of columns in the result set (i.e., the length 
> of the pzValues and pzColNames arrays.)
> pzValues points to an array of NUL-terminated UTF-8 strings holding the 
> results, in order.
> pzColNames points to an array of NUL-terminated UTF-8 strings holding 
> the names of each column from the result set, in order.
> 
> For more details, see http://sqlite.org/c3ref/exec.html
> 
> In your case, you will need to place "value" outside of the function 
> scope, to where your callback can safely access it.
> 
> HTH
> Mihai Limbasan
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-can-i-get-values-from-sqlite-db--tp18522381p18523751.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to