Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SQL Query to save output to a text file? #2868

Unanswered
melodical-me asked this question in Q&A
Discussion options

Been looking around for an SQL Query that will save the save the results to a text file when it is done running.

Research seems to indicate this is possible, but it is dependent upon where the SQL command is executed; for example, if it is executed on the Windows command line, then it is different than if the SQL was executed inside the DB itself.

Since DB Browser has the Execute SQL tab, but I dont know if that is part of the Windows command or some part of SQLite?

In any case, I was just wondering if there is a way to save the output of a query to a text file?

The query doesnt have to be hard. It could be simple, like:

--Run A Query:
SELECT * FROM a_table;
--Then Save the output to some text file....

You must be logged in to vote

Replies: 1 comment

Comment options

I know SQL server allows saving results to a file, but that's part of the program, not part of SQL.
DB4S has primarily been a GUI, so offering ways to save data has been a side issue.
Results can be exported a to CSV or JSON, but that's a manual process.

image

As mentioned before, SQLite is a very 'open' system - databases can be opened by most programming languages, so if you need something automatic (there is an open issue about wanting to refresh a query every x seconds) then it's easier to just code something in VB or python.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /