[teiid-issues] [JBoss JIRA] (TEIID-1131) Document/expand sequence support

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Thu Jul 11 10:38:20 EDT 2013


    [ https://issues.jboss.org/browse/TEIID-1131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12789146#comment-12789146 ] 

Steven Hawkins commented on TEIID-1131:
---------------------------------------

The metadata processor logic at least for pg/oracle can be made to perform the sequence as function import automatically.  For example the following could augment the createMetadataProcessor call in the OracleExecutionFactory:

{code}
@Override
protected Table addTable(MetadataFactory metadataFactory,
	String tableCatalog, String tableSchema, String tableName,
	String remarks, String fullName, ResultSet tables) throws SQLException {
	String tableType = tables.getString(4);
	if ("SEQUENCE".equals(tableType)) { //$NON-NLS-1$
		FunctionMethod method = metadataFactory.addFunction((useFullSchemaName?fullName:tableName) + "_nextval", TypeFacility.RUNTIME_NAMES.INTEGER); //$NON-NLS-1$
		method.setProperty(SQLConversionVisitor.TEIID_NATIVE_QUERY, getFullyQualifiedName(tableCatalog, tableSchema, tableName, true) + ".nextval"); //$NON-NLS-1$
		method = metadataFactory.addFunction((useFullSchemaName?fullName:tableName) + "_currval", TypeFacility.RUNTIME_NAMES.INTEGER); //$NON-NLS-1$
		method.setProperty(SQLConversionVisitor.TEIID_NATIVE_QUERY, getFullyQualifiedName(tableCatalog, tableSchema, tableName, true) + ".currval"); //$NON-NLS-1$
		return null;
	}
	return super.addTable(metadataFactory, tableCatalog, tableSchema, tableName,
			remarks, fullName, tables);
}
{code}
                
> Document/expand sequence support
> --------------------------------
>
>                 Key: TEIID-1131
>                 URL: https://issues.jboss.org/browse/TEIID-1131
>             Project: Teiid
>          Issue Type: Feature Request
>          Components: JDBC Connector, Query Engine
>    Affects Versions: 7.0
>            Reporter: Steven Hawkins
>            Assignee: Steven Hawkins
>
> Currently sequence workaround logic only exists for oracle and is undocumented.  We should look at expanding sequence support - even for dynamic vdbs, see SQuriel's handling of system queries for retrieving sequence metadata.
> At least allowing the workaround logic to work for all sources that support sequences (Postgres, DB2, etc.) would be good.

--
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


More information about the teiid-issues mailing list