![]() |
SQL-J Language Reference
|
Reference Manual |
ExternalVirtualTableCloudscape's Virtual Table Interface (VTI) allows objects that meet Cloudscape VTI requirements to appear as ExternalVirtualTables within SQL-J statements. Cloudscape supports two different kinds of ExternalVirtualTables:
The use of a VTI in SQL-J, similar to the way Java objects can be referenced in other constructs, is dynamic, not declarative; there is no CREATE EXTERNAL VIRTUAL TABLE statement. Instead, you call the constructor of the class that implements the VTI requirements, to instantiate an ExternalVirtualTable on the fly within the statement. The VTI is a powerful tool that can be used to make any external data source, such as a flat text file, a live data feed, or a gateway to another RDBMS, appear as a table to Cloudscape. NEW: Read-write VTIs are new in Version 3.6. SyntaxNEW { JavaClassName | ClassAlias }(parameterList) In a SelectExpression, as with other derived tables, you must give an ExternalVirtualTable a CorrelationName as described in TableExpression. Names of derived columns are optional. NOTE: Column names returned by a VTI are treated as case-sensitive, delimited identifiers. Provide names of derived columns in the correlation name to treat them as case-insensitive names, or program your VTI to return all uppercase column names. ExternalVirtualTable Examples
-- FileImport is an alias for the class
-- jarvti is a class alias for a sample VTI class
-- JBMSTours.vti.jdbc1_2.ExternalCloudscapeTable Dependency SystemA statement is not dependent on a VTI. The statement that references the VTI is not dependent on any of the objects referenced within the VTI. (As in a java method call, any statements nested within the VTI are dependent on the objects that they reference.) Inserting from Table in Same DatabaseBe careful when using an ExternalVirtualTable to reference a table in the current database. If the ExternalVirtualTable is accessing a table in the current database, and you are using that ExternalVirtualTable as the source of an INSERT, the query could result in an infinite loop. Cloudscape does not detect that situation. For example, the following statement would result in an infinite loop:
-- INSERT INTO FlightAvailability If the statement involves two ExternalVirtualTables, each of which references the other, the statement cannot be evaluated and is not permitted, as in the following example: SELECT * NOTE: If a VTI cannot be instantiated more than once and it takes a join column as a parameter, no legal join order is possible, and an exception is thrown. |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |