Working with SQLiteStudio
|
Data Export
SQLiteStudio exports data to CSV, PDF, HTML, JSON, and XML, or it can export SQL statements. To do this, either click directly on the Export icon (the arrows moving apart) or select Tools | Export in the menu.
In the first dialog of the wizard, you'll need to choose what you want to export: a whole database, a single table, or a query result. Then, confirm your choice by clicking on Next > . Usually, you will want to export a single table, such as staff . In this case, you specify the appropriate table in the next window; SQLiteStudio suggests the database and table currently in use. Below Options , you set the scope of the data export (table data, indexes, triggers) and then press Next > .
The following window is used to determine the output format and the target file. The points here depend on the output format that you selected; for CSV, they are similar to the Import function (Figure 12). The HTML export options are shown in Figure 13.
The export to various formats such as CSV, JSON, or SQL works as expected. If you don't mess around with the parameters, you can also import into other programs such as LibreOffice or PostgreSQL. The stumbling block is always in the header, which needs to be considered when importing into the target application.
The HTML output is visually perfect (Figure 14) as is the PDF output.
SQLiteStudio does not offer to output views in the menus; you need to manually request this with Export and select Query results . Again, you will need some basic SQL knowledge for this. The query that grabs data from our sample telephone directory looks something like this:
select * from "Telephone Directory";
The other query dialogs are identical to those for exporting databases or tables; the supported formats are also the same.
Manual SQL Queries
For more complex queries, there is an SQL editor, which you can access via Tools | Open SQL editor (Figure 15). After entering your instructions, you need to click the small blue arrow above Query or press F9 to run them.
In the upper input field, type in your query, and the result will be shown in the middle. You will find errors and other messages at the bottom in the status section. You can also save the queries by clicking on the floppy disk icon. To load a statement file created in this way click on the folder icon to the right of the floppy disk. SQLiteStudio does not automatically execute the loaded file with the instructions; again, you need to click on the blue arrow.
Optionally, you can create a view directly from a query. To do so, click on the appropriate button with the stylized lightning flash to the left of the floppy disc icon (Create view from query ).
Buy this article as PDF
Pages: 7
(incl. VAT)