Multiple queries - using the Database Integration Wizard

To set up a template to read this data from the SQL Server tables into GainSeeker, you can begin by using the Database Integration Wizard to connect to both tables and create the basic mapping and template structure.

Step 1

On Step 1 of the Database Integration Wizard, you will need to set up a data source for the particular database in SQL Server where these tables exist.  On the sample screen below, a Defect_Data data source has been created for the database containing the two tables.

You should create a separate connection for each table, as shown below.  In addition, you should set up a third connection that can be used to flag records that have been processed by GainSeeker.  You may want to assign a different Description to each connection, so that you can distinguish between them later in the Database Integration Wizard.

Step 2

On Step 2 of the Database Integration Wizard, you will need to set up the basic SQL statement for each connection.

For this scenario, the first query should return all of the new records in the LOG_ALL table.

If a failure record is found in the LOG_ALL table, the template must query the LOG_FAIL table for any records that match the failing record.  You will need to edit the template later so that the search values for the DateTime, PartNo and Serial fields in LOG_FAIL can be changed to match the equivalent values found in the LOG_ALL table.  Therefore, you can use the 'TODO' placeholder for these values in the SQL statement, and later you can replace the 'TODO' placeholders with template commands.

After all of the records have been processed for each part that was inspected, the template must flag them as such.  The third SQL statement is used to change the value in the "Processed" field from 0 to 1.

Step 3

This template will need to store 1 DMS record for each part that was inspected, whether the part passed or failed the inspection.  Thus, the Connection that guides the template through data entry must be the connection used to query the LOG_ALL table.

Step 5

On this step, you can map the Part Number, Date/Time, Serial number, Equipment ID, and Pass/Fail information from the LOG_ALL table into the appropriate GainSeeker fields.  You can also map the defect description from the LOG_FAIL table into the appropriate GainSeeker field.  Finally, you can set any static values, such as the process, count for each defect type, and sample size.

Notice that the number of nonconforming units (or NCU) will come from the PassFail field, but some template editing will be required to convert a passing inspection to "0" (NCU) and a failing inspection to "1" (NCU).  Again, additional text using the 'TODO' placeholder makes sure that we will remember to modify this later.

Step 6

On step 6, you can decide how to terminate the template action, specify the date format found in your tables, and make other selections.  Click Finish to save this first draft of the template.

 

More:

Resulting template from the Database Integration Wizard

Working with multiple SQL statements