Dulini Atapattu
Dulini Atapattu

Reputation: 2735

Running sqlite script in Sqlite db using C++

I have some sqlite scripts with some sqlite commands like:

Is there anyway of running this script in SqliteDB using Sqlite interface for C++, instead of redirecting the file to sqlite using sqlite command line shell?

Thanks

Upvotes: 0

Views: 640

Answers (1)

Jan Hudec
Jan Hudec

Reputation: 76256

If you actually need the output, than it's by far easiest to just run the script through the command-line shell (it has -batch argument to suppress all output except the actual results).

The .-commands are implemented in the shell, not the API. Because the API does not do output and the commands you mention are for controlling the output. If you really wanted to run the scripts with the API, you'd need to do the output yourself and either hardcode the format you want or interpret the .-commands yourself.

Upvotes: 1

Related Questions