WMS:Import from Database: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
The '''Database Import Wizard''' allows users to access data stored in a database and import it. The wizard is invoked by selecting the '''Import from Database''' command from the ''File'' menu. The data types that can be imported by the '''Database Import Wizard''' are the same data types that are supported by the [[WMS:Text Import Wizard|Text Import Wizard]]. Like the '''Text Import Wizard''', database data must be formatted in columns to be imported.
The ''Database Import Wizard'' allows users to access data stored in a database and import it. The wizard is invoked by selecting the '''Import from Database''' command from the ''File'' menu. The data types that can be imported by the ''Database Import Wizard'' are the same data types that are supported by the [[WMS:Text Import Wizard|Text Import Wizard]]. Like the ''Text Import Wizard'', database data must be formatted in columns to be imported.


The '''Database Import Wizard''' has five steps:
The '''Database Import Wizard''' has five steps:


* [[WMS:Import from Database#Step 1 - Connecting to a Database|Step 1 - Connecting to a Database]]
* [[WMS:Import from Database#Step 1 – Connecting to a Database|Step 1 – Connecting to a Database]]
* [[WMS:Import from Database#Step 2 - Querying Information from a Database Table|Step 2 - Querying Information from a Database Table]]
* [[WMS:Import from Database#Step 2 – Querying Information from a Database Table|Step 2 – Querying Information from a Database Table]]
* [[WMS:Import from Database#Step 3 - Viewing the Queried Data from a Database Table|Step 3 - Viewing the Queried Data from a Database Table]]
* [[WMS:Import from Database#Step 3 – Viewing the Queried Data from a Database Table|Step 3 – Viewing the Queried Data from a Database Table]]
* [[WMS:Import from Database#Step 4 - Assigning Column Types|Step 4 - Assigning Column Types]]
* [[WMS:Import from Database#Step 4 – Assigning Column Types|Step 4 – Assigning Column Types]]


Step 4 is identical to the last step in the [[WMS:Text Import Wizard|Text Import Wizard]].
Step 4 is identical to the last step in the [[WMS:Text Import Wizard|Text Import Wizard]].


==Step 1 - Connecting to a Database==
==Step 1 – Connecting to a Database==
Step 1 of the wizard lets you set up a connection to a database. To connect to a database either on the same computer or on a network press the Connect to Database button. Once a database connection is created, a path to the database and the different tables in the database are displayed. When a table is selected its columns are displayed along with the number of rows in that table.
Step 1 of the wizard lets you set up a connection to a database. To connect to a database either on the same computer or on a network press the '''Connect to Database''' button. Once a database connection is created, a path to the database and the different tables in the database are displayed. When a table is selected its columns are displayed along with the number of rows in that table.


==Step 2 - Querying Information from a Database Table==
==Step 2 – Querying Information from a Database Table==
Step 2 allows you to create, copy, delete, and import queries that retrieve data from a database. To help in writing the queries, the tables in the database are displayed, as well as the columns in the selected table.
Step 2 allows you to create, copy, delete, and import queries that retrieve data from a database. To help in writing the queries, the tables in the database are displayed, as well as the columns in the selected table.


Line 20: Line 20:
The query is an SQL (Structured Query Language) statement. The SQL statement is entered in the '''Query SQL statement''' edit field. An example of an SQL statement would be: “SELECT x, y, z, toluene FROM multipledatasets”. This statement means that columns x, y, z, and toluene from the table multipledatasets will be retrieved from a database. SQL statements are case sensitive. SQL statements also require brackets around table or column names that have spaces. For example, to query data from a table titled “x coordinate” in the SQL statement it would be written as [x coordinate]. A full explanation of SQL is beyond the scope of this document.
The query is an SQL (Structured Query Language) statement. The SQL statement is entered in the '''Query SQL statement''' edit field. An example of an SQL statement would be: “SELECT x, y, z, toluene FROM multipledatasets”. This statement means that columns x, y, z, and toluene from the table multipledatasets will be retrieved from a database. SQL statements are case sensitive. SQL statements also require brackets around table or column names that have spaces. For example, to query data from a table titled “x coordinate” in the SQL statement it would be written as [x coordinate]. A full explanation of SQL is beyond the scope of this document.


You can write a short description for each query in the '''Query description''' edit field. The '''New''' button creates a new query that has a default name, description, and SQL statement. The '''Copy''' button creates a copy of the currently selected query. The '''Delete''' button deletes the currently selected query.
You can write a short description for each query in the ''Query description'' edit field. The '''New''' button creates a new query that has a default name, description, and SQL statement. The '''Copy''' button creates a copy of the currently selected query. The '''Delete''' button deletes the currently selected query.


The queries you define are saved automatically by WMS in a file called wmsquery.ini, located in the folder where WMS is installed. The '''Import''' button allows you to import a list of queries from any file that follows the same format as the wmsquery.ini file.
The queries you define are saved automatically by WMS in a file called wmsquery.ini, located in the folder where WMS is installed. The '''Import''' button allows you to import a list of queries from any file that follows the same format as the wmsquery.ini file.


==Step 3 - Viewing the Results of the Query==
==Step 3 – Viewing the Results of the Query==
Step 3 displays the results of the database query. Only the first 20 rows are displayed in a spreadsheet. If the results are not what you wanted, you can go back to Step 2 and modify the query.
Step 3 displays the results of the database query. Only the first 20 rows are displayed in a spreadsheet. If the results are not what you wanted, you can go back to Step 2 and modify the query.


==Step 4 - Assigning Column Types==
==Step 4 – Assigning Column Types==
Step 4 is identical to Step 2 of the [[WMS:Text Import Wizard|Text Import Wizard]].
Step 4 is identical to Step 2 of the [[WMS:Text Import Wizard|Text Import Wizard]].



Revision as of 18:53, 6 March 2013

The Database Import Wizard allows users to access data stored in a database and import it. The wizard is invoked by selecting the Import from Database command from the File menu. The data types that can be imported by the Database Import Wizard are the same data types that are supported by the Text Import Wizard. Like the Text Import Wizard, database data must be formatted in columns to be imported.

The Database Import Wizard has five steps:

Step 4 is identical to the last step in the Text Import Wizard.

Step 1 – Connecting to a Database

Step 1 of the wizard lets you set up a connection to a database. To connect to a database either on the same computer or on a network press the Connect to Database button. Once a database connection is created, a path to the database and the different tables in the database are displayed. When a table is selected its columns are displayed along with the number of rows in that table.

Step 2 – Querying Information from a Database Table

Step 2 allows you to create, copy, delete, and import queries that retrieve data from a database. To help in writing the queries, the tables in the database are displayed, as well as the columns in the selected table.

Some SQL Basics

The query is an SQL (Structured Query Language) statement. The SQL statement is entered in the Query SQL statement edit field. An example of an SQL statement would be: “SELECT x, y, z, toluene FROM multipledatasets”. This statement means that columns x, y, z, and toluene from the table multipledatasets will be retrieved from a database. SQL statements are case sensitive. SQL statements also require brackets around table or column names that have spaces. For example, to query data from a table titled “x coordinate” in the SQL statement it would be written as [x coordinate]. A full explanation of SQL is beyond the scope of this document.

You can write a short description for each query in the Query description edit field. The New button creates a new query that has a default name, description, and SQL statement. The Copy button creates a copy of the currently selected query. The Delete button deletes the currently selected query.

The queries you define are saved automatically by WMS in a file called wmsquery.ini, located in the folder where WMS is installed. The Import button allows you to import a list of queries from any file that follows the same format as the wmsquery.ini file.

Step 3 – Viewing the Results of the Query

Step 3 displays the results of the database query. Only the first 20 rows are displayed in a spreadsheet. If the results are not what you wanted, you can go back to Step 2 and modify the query.

Step 4 – Assigning Column Types

Step 4 is identical to Step 2 of the Text Import Wizard.


Related Links