Mac Tutorials - Herong's Tutorial Examples - v3.08, by Herong Yang
Install SQuirreL SQL Scripts Plugins
This section provides a tutorial on how to install SQL Scripts Plugins to capture result generated from a SQuirreL query on macOS.
The SQL Scripts plugin allows you to generate CREATE TABLE and INSERT scripts for existing tables in your database. It also allows you to create data insert script from SQLs or tables. For any SELECT statement it allows you to store the result of the statement in a new table.
The SQL Scripts plugin was developed by Johan Compagner and Gerd Wagner and included in the SQuirreL Installer package. You can follow this tutorial to install it.
1. Stop SQuirreL.
2. Go to SQuirreL installation directory and create "plugins" sub-directory, if not exist.
herong$ cd /Applications/SQuirreLSQL.app/Contents/MacOS herong$ mkdir plugins
3. Install "sqlscript" from the installer package.
herong$ cp -R ../Resources/Java/plugins/sqlscript plugins herong$ cp -R ../Resources/Java/plugins/sqlscript.jar plugins herong$ ls -l plugins/ drwxr-xr-x 3 herong admin 102 Apr 21 17:45 sqlscript -rw-r--r-- 1 herong admin 117580 Apr 21 17:46 sqlscript.jar
4. Stop SQuirreL and click "Plugins > Summary". I see "SQL Script Plugin" listed.
5. Connect to a database and run a query.
6. Click "Session > Scripts > Store Result of SQL in File". Unfortunately, I see an error message: "net.sourceforge.squirrel_sql.fw.gui.action.exportData.ExportDataException: An error was encountered while attempting to build the data set for export."
7. Run the query again and click "Session > Scripts > Create Data Script from SQL". I see a list of INSERT statements displayed in the query window. Each statement represents a record from the query result. Basically, I can run those statements to dump the result into another database.
8. Select a table from the objects window and click "Session > Scripts > Create Table Script". I see a CREATE TABLE statement displayed in the query window. Now I can run this statement to create the same table in another database.
Table of Contents
Macintosh OS (Operating System) History
System and Application Processes
Keychain Access - Password Manager
Keychain Access - Certificate Manager
Install New Version of Python on macOS
pip3 - Package Installer for Python 3
Install MySQL Database Server on macOS
PHP mysqli_connect() Error on "localhost"
Install SQuirreL SQL Client on macOS
Connect SQuirreL to MySQL on macOS
►Install SQuirreL SQL Scripts Plugins