db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Vyvyan (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DERBY-6118) Allow Table Functions to return dynamic table shapes
Date Thu, 21 Mar 2013 16:39:16 GMT
David Vyvyan created DERBY-6118:
-----------------------------------

             Summary: Allow Table Functions to return dynamic table shapes
                 Key: DERBY-6118
                 URL: https://issues.apache.org/jira/browse/DERBY-6118
             Project: Derby
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 10.8.3.0
            Reporter: David Vyvyan


This feature request comes from this forum discussion:
http://apache-database.10148.n7.nabble.com/Limitations-of-Table-Functions-vs-old-VTIs-td127988.html#a127995

Currently, Table Functions have to be created with a static table shape, e.g:
CREATE FUNCTION TF_TEST1(ARG1 INT) RETURNS TABLE(C1 INT, C2 VARCHAR(32672)) PARAMETER STYLE
DERBY_JDBC_RESULT_SET LANGUAGE JAVA NOT DETERMINISTIC READS SQL DATA EXTERNAL NAME 'core.TestTableFunctions.TF_TEST1'


The old VTIs offer dynamic table shapes: Derby resolves the table shape of a VTI using method
getMetaData() when compiling a new query that references one.

Stored procedures also offer dynamic table shapes: This is specified at creation time using
the syntax: "DYNAMIC RESULT SETS".

It would be very useful if Table Functions could offer the same, e.g:
CREATE FUNCTION TF_TEST1(ARG1 INT) RETURNS DYNAMIC RESULT SET PARAMETER STYLE DERBY_JDBC_RESULT_SET
LANGUAGE JAVA NOT DETERMINISTIC READS SQL DATA EXTERNAL NAME 'core.TestTableFunctions.TF_TEST1'


Otherwise, they will always remain behind VTIs in capability.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message