diff --git a/admin/System_Properties.adoc b/admin/System_Properties.adoc index 336af00e06..e90ed98db4 100644 --- a/admin/System_Properties.adoc +++ b/admin/System_Properties.adoc @@ -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* diff --git a/reference/DDL_Metadata.adoc b/reference/DDL_Metadata.adoc index dd06654e1d..7401d642e8 100644 --- a/reference/DDL_Metadata.adoc +++ b/reference/DDL_Metadata.adoc @@ -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. @@ -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*: diff --git a/reference/Procedures.adoc b/reference/Procedures.adoc index b0c16064a3..bdbfbc7bc7 100644 --- a/reference/Procedures.adoc +++ b/reference/Procedures.adoc @@ -1,3 +1,5 @@ = Procedures +Teiid supports calling foreign procedures and defining virtual procedures and triggers using a procedure language. + diff --git a/reference/Virtual_Procedures.adoc b/reference/Virtual_Procedures.adoc index 95ae6c988b..3ecfb8da73 100644 --- a/reference/Virtual_Procedures.adoc +++ b/reference/Virtual_Procedures.adoc @@ -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.