Put data into a database
 
Using the clipboard
Use Edit | Paste data from clipboard... as a quick way to move data from spreadsheets into a MySQL database.  This works especially well if you use keyboard shortcuts in both the spreadsheet and Entrance.  (On the Entrance side, you'll find the shortcut for your system listed in the Edit menu)
 
Simply copy cell values to the clipboard from the spreadsheet, then open the Edit | Paste data... dialog in Entrance:
 
 
It is filled in when it opens, so simply press enter or click OK, and you are done.  A table containing your data will be created in the current database and opened in an Entrance tab.  You can change its column names and types, if you choose, as described in: "Creating database tables".
 
You can also copy data from a web browser, text documents, even a script program's output in a Terminal window, using the same technique.  
 
Importing data from a file
If your data is in a file, use Tools | Import data...:
 
 
Enter the file name, or use the three dot file button to select one, and click OK.  A new table containing your data will be created and opened in a tab.
 
Obtaining data from another MySQL server
Using Entrance, you can drag and drop tables from one server to another.  Here is how...
 
To copy data from another MySQL server, first add it as a host using the Database | Add MySQL host... menu selection:
 
Click OK, then connect to the new host (click on its icon, then click "Connect" on the toolbar) and your explorer tree will look something like this:
 
x
 
Now you can drag and drop tables from the new host to other hosts or databases.  When you drop a table on a host node, it will be pasted into the default database for that host.
 
Obtaining data from FileMaker
The simplest way to move data from FileMaker to Entrance and MySQL is to export it in tab-delimited form.  In FileMaker 8.5, you can use File | Export Records... and then select "Tab Separated Text" for the file type, and then import it into Entrance using Tools | Import....
 
Create an empty table with SQL, then load a file
You can also use a SQL script to create a database table with given structure, and then fill it with data.  
 
To run the script, use File | Open... or the Open tool to open it, then click the Run tool.
 
With the empty table created, fill it with data using Edit | Paste Data... or Tools | Import... Specify a table name and select "Append" in the dialog that appears.  
 
This technique is commonly used to exchange data between database systems built by different vendors.  It is also a way to provide data to people who don't have accounts on your server.  (Entrance provides tools make it easy to publish data this way.  More about this in the next section)  
 
Create a table and fill it from a SQL script
Finally, you can use a SQL script to both create a table and fill it with data.  In this case you just open the script and run it as you would any SQL script.
 
You can publish tables from you server in this form using tools from the Entrance table popup menu:
 
The "SQL" menu items all create SQL scripts and open them in Entrance tabs.  "SQL to create table" gives you a SQL script to create an empty table with the same structure.  "SQL to create table and load data" gives you a SQL script that will make a copy of the table.
 
These SQL scripts use the CREATE and INSERT commands.  You can use the Help menu to find out more about their syntax.
 
 
 
Please note:  This web page and other Entrance documentation web pages are copyrighted material and have not been released under the terms of the GPL.
 
Copyright (c) Tod Landis 2007 All Rights Reserved                                 Modified:  March 10, 2007
 
 
MySQL is a registered trademark of MySQL AB in the United States, the European Union and other countries.  FileMaker is a trademakr of FileMaker, Inc. registered in the US and other countries.