Querying the Database

Once you have connected to a data source, you can choose to import fields using SQL queries. From the main dialog box, select SQL Query as the connection mode. This adds a query editor window in the dialog box. Using the query editor, you can create or load one or more SQL queries whose result set will be read into the data stream.

If you specify multiple SQL queries, separate them with semicolons (;) and ensure that there is no multiple SELECT statement.

To cancel and close the query editor window, select Table as the connection mode.

You can include SPSS® Modeler stream parameters (a type of user-defined variable) in the SQL query. See the topic Using Stream Parameters in an SQL Query for more information.

Load Query. Click to open the file browser, which you can use to load a previously saved query.

Save Query. Click to open the Save Query dialog box, which you can use to save the current query.

Import Default. Click to import an example SQL SELECT statement constructed automatically using the table and columns selected in the dialog box.

Clear. Clear the contents of the work area. Use this option when you want to start over.

Split text. The default option Never means that the query will be sent to the database as a whole. Alternatively, you can choose As needed which means that SPSS Modeler attempts to parse the query and identify if there are SQL statements that should be send to the database one after another.