1.

Procedure to create a Query

Answer»

ClickNewand selectProcedure.

Response: AProcedure Element tabis opened.

In theData Sourcestree, click on the database procedure you wish to use.

ClickSelect.

Response: The database procedure is added to the tab. Information Designer analyzes the database procedure and makes a guess as to whether it is a pre-update procedure or a query procedure (it never sets post-procedure by default).

Select theProcedure type: Query.

In theDescriptionfield, type your own description of the procedure.

If the database procedure requires anyInput Parameters, their name and type are displayed.

Select whether the input parameter should receive aDefault Valueby typing a value (of the appropriate type) in the input field. If not, leave the field blank.

Comment: Type ?param_name to use a parameter as the default value, where param_name is the name to identify the parameter by.Note:If you use a parameter for the default value, you must choose Prompt: . SeeParameterized Information Linksfor more information.

Select whether you want the end user to be prompted for a single value or not at all, from thePromptdrop-down list.

If you want to allow the input parameter to be Null, select thePermit Nullcheck box.

Example 1: Type a Default value and set prompt to . This means that the specified default value will always be used as input parameter.Example 2: Leave Default value empty, select Permit Null and Single value prompt. This will cause the end user to be prompted for a value. If the end user does not enter a value in the prompt, Null will be used.Example 3: Leave Default value empty, leave Permit Null empty and Single value prompt. This will cause the end user to be prompted for a value. If the end user does not enter a value in the prompt, an error message will appear since Null is not allowed.Comment: You cannot select the combination: No Default value, Not allow Permit Null and No Prompt, since this is a paradox.

Expand theResult Columnssection.

Either keep theInclude all result columnscheck box selected, or clear the check box and clickAdd...to specify your own result columns. If the check box is selected, go to step 15, otherwise continue with step 12.

In theOriginal namefield, enter the exact name of a column the database procedure returns. This name is specified in the actual database procedure, so you have to know this beforehand.

Type aDisplay nameto use when the result column is opened in TIBCO Spotfire.

Select theData typethe resulting column should have.

If you want to specify a join between the database procedure and another table, use theJoinsection.Comment: Joining is necessary if you intend to use the result columns from this procedure together with column elements from another data table in an information link. You can only specify one join.

Join columns can be added from three different sources:* From the Data Sources tree. This option is similar to selecting join columns at the creation of join elements. Click on a column in the Data Sources tree (or click on the column under its data source in the Elements tree) and then select the From Data Sources Tree option in the Add drop-down list.* From a previously specified Result Column. Any result columns that have been defined will be listed directly in the Add drop-down list.* From a New Result Column. The third option is used if you want to join over a result column from the procedure but you do not want to use it as output when retrieving data.ClickAddand select an option from the drop-down list.

Repeat step 16 for another join column. Normally, you will have one column from the data sources tree and one result column in the join.

Select aConditionfrom the drop-down list.Comment: There are two basic types of joins that can be done between tables:inner joinsandouter joins. An inner join will return rows for which only the matching fields in both tables are equal. An outer join will return all the rows (including NULL values) from one table, and only the matching rows from the other table. See alsoFreehand Joins.

ClickSave.

Response: The Save As dialog is displayed.

Click to select the folder where you wish to save the procedure element.

ClickSave.

Response: The procedure is saved in the selected folder, and will be denoted with theicon. Note that the procedure object will be visible to the end user in the list of information links. You can also make larger, more complex information links using the procedure when creating an information link in Information Designer.



Discussion

No Comment Found