Accessing Remote Objects
To access data from specific objects of a remote system (remote objects), SAP HANA implements virtual tables. Virtual tables are catalog objects, and they are located in a schema.
A virtual table gives access to one remote object (a table or a view in the example below).

Note
- First, the type of remote artifacts depends on the remote system. In a database system, of course, these could be tables. But in a file system, there are no tables, but files. A .csv or .txt file with a well-defined structure can most certainly be converted into a virtual table, but this depends on the capability of the adapter and requires a metadata definition to identify column types, among others.
- Besides, even in a remote database system, there are classically tables and views. Most of the adapters can access remote tables and remote views in a similar way.
Once virtual tables are created, they can be consumed by the database processes as if they were physically located in the target database. However, the key principle of virtual tables is that they don’t store the data on the local database, but only metadata. Instead, they expose remote data through their supporting remote source whenever a query is executed on top of them.
Note
Virtual Table Definition
A virtual table has two parts in its definitions:
- The virtual table identifier
- The remote object identifier, including the reference to the remote source

Note
With other remote system types, a single remote source might reference a database server in which several databases can be reached. This is where the remote database setting is needed in a virtual table definition.
Security Consideration for Virtual Tables
When creating virtual tables, you need to fulfill a number of prerequisites regarding not only the availability of the remote source and remote system, but also the authorizations in place in both systems. Here they are.
On the Local System
To create a virtual table, the prerequisites for the local user are as follows:
- The local user who created the remote source is automatically granted the privilege to create virtual tables on this remote source.
- Any other use requires the CREATE VIRTUAL TABLE privilege on the remote source.
- In any case, the local user needs CREATE ANY privileges on the schema where the virtual table will be stored.
On the Remote System
The credentials configuration of the remote source (or an existing secondary credential for your user on that remote source) determines which remote user is accessing the remote/source object.
Caution
As a general rule, when you create a virtual table pointing to a remote database system, the remote user derived from the remote source definition (or an existing secondary credential associated to your user) only needs theCATALOG READprivilege (SAP HANA) or an equivalent, but NOT necessarily a SELECT privilege on the remote table or view (or its containing schema).
Note
How to Create a Virtual Table?
A virtual table can be created in two different ways:
- From the SAP HANA Database Explorer, using the catalog
- With an SQL statement

