Output Formats

There are several output modes for the display of SQL "select" results: text, SQL, HTML, XML, and Table. Output from the escape commands are always displayed as plain text. Text mode is the default, and is primarily a raw display format. SQL output is most useful with the output of a SELECT statement; it will generate SQL that will attempt to re-create the data in another database. HTML mode generates an HTML table to display the results of a Select. XML format is similar but may be used for exporting data into other applications. Finally, table mode provides a friendlier interface which ensures all of the columns are lined up properly. In this mode, it is even possible to rearrange the columns by dragging them.

For example, with SQL mode selected, a "select * from anecdotes" (a table in a sample bookstore web site's database, used to display a casual quotation about books) looked like this:

This could, as you can see, be used to create a SQL script to re-create the contents of the database. In fact, some developers use SQLRunner primarily for this purpose: to create stable test databases from "live" data that was created by their application.

You can view this same data in HTML just by changing the Format selection to HTML and clicking the Run button again:

When copied and pasted into an HTML file and viewed in a browser, the output looked like this:

With a bit of formatting, or even a CSS style sheet, this HTML page could be made quite usable.

SQLRunner is not perfect, but it is adequate for many purposes involving direct use of SQL.