1

I am trying to write c++ application to create sqlite db or update existing db from sql statements which are present in text file. I am not able to find right way to do. As a workaround i used system() with "cat sqlfile.txt | sqlite3 mydb FYI. I am using sqlite3 3071502

1 Answer 1

1

You need to use STL fstream library to read the content of file. Tutorials are here: http://www.cplusplus.com/doc/tutorial/files/

After that, you need to use sqlite c++ api to execute sql commands. Tutorials are here: https://www.sqlite.org/c3ref/exec.html

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.