-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
SQL Query to save output to a text file? #2868
-
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....
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
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.
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.
Beta Was this translation helpful? Give feedback.