Skip to content

Commit

Permalink
TEIID-5130 updating docs related to RESULT parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Oct 30, 2017
1 parent 2caa35e commit cea71d3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions admin/System_Properties.adoc
Expand Up @@ -37,6 +37,7 @@ NOTE: Strings are always fully held in memory. Do not set this value too high as
* _org.teiid.widenComparisonToString_ - defaults to false. Set to true to enable widening of values to string in comparisons, which was the default behavior prior to Teiid 9. For example with this setting as false timestamp_col < 'a' will produce an exception whereas when set to true it would effectively evaluate cast(timestamp_col as string) < `a'.
* _org.teiid.aggressiveJoinGrouping_ - defaults to true. Set to false to not aggressively group joins (typically allowed if there exists an explicit relationship) against the same source for pushdown and rely more upon a cost based ordering.
* _org.teiid.maxSessionBufferSizeEstimate_ - defaults to 2^63 - 1. Set to the desired size in bytes to limit the amount of buffer resources (heap and disk) consumed by a single session's tuple buffers and table structures. This is based upon the memory footprint estimate and may not correspond exactly to heap or disk consumption.
* _org.teiid.resultAnyPosition_ - defaults to false. Set to true to allow a RESULT parameter to appear at in position in a procedure parameter list.

*Security*

Expand Down
8 changes: 5 additions & 3 deletions reference/DDL_Metadata.adoc
Expand Up @@ -167,7 +167,7 @@ image:images/create_column.jpg[images/create_column.jpg]
|costing information. Number of distinct values in this column
|===

Columns may also be marked as NOT NULL, auto_increment, and with a DEFAULT value. Currently only string values are supported as the default value. To have the string interpreted as an expression use the extension property teiid_rel:default_handling set to expression.
Columns may also be marked as NOT NULL, auto_increment, and with a DEFAULT value.

A column of type bigdecimal/decimal/numeric can be declared without a precision/scale which will default to an internal maximum for precision with half scale, or with a precision which will default to a scale of 0.

Expand Down Expand Up @@ -490,9 +490,11 @@ CREATE VIRTUAL FUNCTION CustomerRank(customerid integer)
END
----

Procedure columns may also be marked as NOT NULL, or with a DEFAULT value. Currently only string values are supported as the default value. To have the string interpreted as an expression use the extension property teiid_rel:default_handling set to expression. On a source procedure if you want the parameter to be defaultable in the source procedure and not supply a default value in Teiid, then the parameter must be nullable and use the extension property teiid_rel:default_handling set to omit.
Procedure columns may also be marked as NOT NULL, or with a DEFAULT value. On a source procedure if you want the parameter to be defaultable in the source procedure and not supply a default value in Teiid, then the parameter must be nullable and use the extension property teiid_rel:default_handling set to omit.

There can only be a single RESULT parameter and it must be an out parameter. A RESULT parameter is the same as having a single non-table RETURNS type. If both are declared they are expected to match otherwise an exception is thrown. One is no more correct than the other. "RETURNS type" is shorter hand syntax especially for functions, while the parameter form is useful for additional metadata (explicit name, extension metadata, also defining a returns table, etc.)
There can only be a single RESULT parameter and it must be an out parameter. A RESULT parameter is the same as having a single non-table RETURNS type. If both are declared they are expected to match otherwise an exception is thrown. One is no more correct than the other. "RETURNS type" is shorter hand syntax especially for functions, while the parameter form is useful for additional metadata (explicit name, extension metadata, also defining a returns table, etc.).

A return parameter will be treated as the first parameter in for the procedure at runtime, regardless of where it appears in the argument list. This matches the expectation of Teiid and JDBC calling semantics that expect assignments in the form "? = EXEC ...".

*Relational Extension OPTIONS*:

Expand Down
2 changes: 2 additions & 0 deletions reference/Procedures.adoc
@@ -1,3 +1,5 @@

= Procedures

Teiid supports calling foreign procedures and defining virtual procedures and triggers using a procedure language.

2 changes: 2 additions & 0 deletions reference/Virtual_Procedures.adoc
Expand Up @@ -16,6 +16,8 @@ In Designer:

In DDL: link:DDL_Metadata.adoc#_create_procedure_function[DDL Metadata#Create Procedure/Function]

Note that the optional result parameter is always considered the first parameter

Within the body of the procedure, any valid link:Procedure_Language.adoc[statement] may be used.

There is no explicit cursoring or value returning statement, rather the last unnamed command statement executed in the procedure that returns a result set will be returned as the result. The output of that statement must match the expected result set and parameters of the procedure.
Expand Down

0 comments on commit cea71d3

Please sign in to comment.