Sqlite3 in C executing multiple queries

I am writing a C program and running some queries using sqlite. I do not use sqlite3_exec() , since you cannot get results without writing a callback function for it.

So, I have a source that looks something like this:

 char * query = "CREATE TABLE 'items' (id int, icon int, name text); CREATE TABLE 'icons' (id int, image blob); CREATE TABLE 'playfields' (id int, name text);"; sqlite3_prepare_v2(dump_db_into,query,-1,&sqlstmt,0); sqlite3_step(sqlstmt); 

And, of course, only the first request is executed. Do I need to run sqlite3_step() several times?

I would prefer not to run these commands again and again if I have a large number of requests

+4
source share
1 answer

Found in the links, my bad:

These procedures only compile the first statement in zSql, so * pzTail remains to indicate that it remains uncompiled.

+3
source

Source: https://habr.com/ru/post/1394806/


All Articles