SQL statements that access more than one database
Only the data manipulation language (DML) statements of SQL, and a subset of the data definition language (DDL) statements of SQL can reference database objects outside the local database from which the statement is issued, or in databases of server instances that are not the local HCL OneDB™ server instance.
- CREATE DATABASE
- CREATE SYNONYM
- CREATE VIEW
- DATABASE
- DELETE
- DROP DATABASE
- EXECUTE FUNCTION
- EXECUTE PROCEDURE
- INFO
- INSERT
- LOAD
- LOCK TABLE
- MERGE
- SELECT
- UNLOAD
- UNLOCK TABLE
- UPDATE
To run each of these SQL statements successfully across databases or across database servers, the local database and the external databases must all have the same logging mode. For example, if the local database from which you issue a distributed query was created as MODE ANSI, any other database that the query accesses cannot be unlogged, and cannot use explicit transactions.
Return data types in cross-database operations
- Any built-in atomic data type that is not opaque
- The built-in opaque types BLOB, BOOLEAN, BSON, CLOB, JSON, and LVARCHAR
- DISTINCT types based on a non-opaque built-in atomic type, or on a built-in opaque type listed above
- User-defined data types (UDTs) that can be cast to built-in types.
These data types can be returned by SPL, C, and Java-language UDRs as parameters or as return values, if the UDRs are defined in all of the participating databases. The DISTINCT data types must have exactly the same data type hierarchy defined in all databases that participate in the distributed query.
- IMPEXP
- IMPEXPBIN
- LOLIST
- SENDRECV
- DISTINCT of any of the built-in opaque data types in this list
- Complex types, including COLLECTION, LIST, MULTISET, or SET, and named or unnamed ROW types.
This restriction against cross-database distributed operations that access tables with these built-in opaque or complex data types also applies to operations that access databases of two or more database server instances, which the next section describes.
Return data types in cross-server operations
- Any non-opaque built-in data type
- BOOLEAN
- BSON
- JSON
- LVARCHAR
- DISTINCT of non-opaque built-in types
- DISTINCT of BOOLEAN or LVARCHAR
- DISTINCT of BSON or JSON
- DISTINCT of any of the DISTINCT types in this list.
- BLOB
- BYTE
- CLIENTBINVAL
- CLOB
- IFX_LO_SPEC
- IFX_LO_STAT
- IMPEXP
- IMPEXPBIN
- INDEXKEYARRAY
- LOLIST
- POINTER
- RTNPARAMTYPES
- SELFUNCARGS
- SENDRECV
- STAT
- TEXT
- XID
- User-defined OPAQUE type
- Complex types, including COLLECTION, LIST, MULTISET, or SET, and named or unnamed ROW types.
- DISTINCT of any of the opaque or complex data types in this list.