decide consulting
 

conclusion©


Stored Procedure Generation

Introduction

Decide's Conclusion is a tool that is capable of analyzing database tables and generating stored procedures for basic CRUD (Create, Read, Update, Delete) operations and more. The generated procedure scripts can then be executed on a target database to install the procedures. There are four steps for accomplishing this:

  1. Choose the data tables for which the procedures will be created.
  2. Choose the types of procedures that will created for the chosen tables by selecting the stored procedure templates.
  3. Customize the fields that will participate in the procedures and define any JOIN operations.
  4. Generate and install the procedure scripts.

Generation Screens

Throughout Conclusion the code generation screens all take the same format. They can be accessed from the Main Menu's Generate menu. A menu will pop up with three tabs. The first tab allows users to choose from a list box on the left to select the source of code generation and to select templates from a box on the right. Under the Source checkboxes there will be two or three buttons:

  • ALL: Automatically selects all items
  • None: Automatically unchecks all items
  • Delete: Allows deletion of checked items from the list (not available on stored proc screen)
The stored procedure generation window's data source list contains data tables found in the target database. The template window contains Conclusion templates - one for each type of procedure that should be generated for each selected data table. Once selections have been made the user can click the Next button to bring up the Fields tab.

Customizing Output

Within Conclusion it is possible to customize what fields are involved in the generated stored procedures. The Fields tab of generation window will have one tab for each selected template. On that tab will be a grid where users can configure which fields should be involved. They can also create JOIN operations so that other descriptive data can be brought in as another output of the generated stored procedure.

The previous picture shows an example of how to configure fields. When the Select template is used to generate a Select procedure based on the Customers table its output will not include the CompanyName field and yet it will include and extra OrderDate field. This configuration shows Order information which is "joined" to the customer data via the CustomerID key field. Once the fields have been customized (if needed) the user can click the Generate button to generate the stored procedure scripts. The Code tab will pop up.

The Code Window

The code window shows all the generated code for all the selected items and templates. After generation they still only exist in memory but users can click the Create Files but to write the code to individual files in the Conclusion Results folders. The results folders are configured in Project Setup screen from the Main Menu's File menu. Users can also execute the generated scripts on the target database by clicking the Execute Scripts button.


Conclusion Ver 1.4 - WGU 3/10/2005