4

I'm writing a C program and running multiple queries with sqlite. I'm not using sqlite3_exec() as you can't retrieve results without writing a callback function for it.

So I have 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 query is executed. Do I need to run sqlite3_step() multiple times?

I'd rather avoid having to run these commands over and over if I have a large amount of queries

1 Answer 1

4

Found in the references, my bad:

These routines only compile the first statement in zSql, so *pzTail is left pointing to what remains uncompiled.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.