SAP ASE, originally known as Sybase SQL Server is a relational model database server developed by Sybase Corporation, which later became part of SAP AG.
While the jTDS driver is pre-installed in EXAOperation, you still need to upload jdts.jar
to BucketFS.
You can check the Sybase version with the following SQL command:
SELECT @@version;
- Create a bucket in BucketFS
- Upload the driver to BucketFS
Upload the latest available release of Virtual Schema JDBC Adapter to Bucket FS.
Then create a schema to hold the adapter script.
CREATE SCHEMA ADAPTER;
The SQL statement below creates the adapter script, defines the Java class that serves as entry point and tells the UDF framework where to find the libraries (JAR files) for Virtual Schema and database driver.
CREATE OR REPLACE JAVA ADAPTER SCRIPT ADAPTER.JDBC_ADAPTER AS
%scriptclass com.exasol.adapter.RequestDispatcher;
%jar /buckets/<BFS service>/<bucket>/virtualschema-jdbc-adapter-dist-2.2.0.jar;
%jar /buckets/<BFS service>/<bucket>/jtds-<version>.jar;
/
Define the connection to Sybase as shown below.
CREATE OR REPLACE CONNECTION SYBASE_CONNECTION
TO 'jdbc:jtds:sybase://<host>:<port>/<database name>'
USER '<user>'
IDENTIFIED BY '<password>';
Below you see how a Sybase Virtual Schema is created.
CREATE VIRTUAL SCHEMA <virtual schema name>
USING ADAPTER.JDBC_ADAPTER
WITH
SQL_DIALECT = 'SYBASE'
CONNECTION_NAME = 'SYBASE_CONNECTION'
CATALOG_NAME = '<catalog name>'
SCHEMA_NAME = '<schema name>';
NUMERIC/DECIMAL(precision, scale)
: Sybase supports precision values up to 38, Exasol only up to 36 decimals.NUMERIC/DECIMAL
with precision <= 36 are mapped to Exasol'sDECIMAL
type; greater precision values are mapped to aVARCHAR
column.- The Sybase data type
CHAR(n > 2000)
is mapped to Exasol'sVARCHAR(n)
. Exasol only supportsn <= 2000
for data typeCHAR
. - The Sybase data types
TEXT
andUNITEXT
are mapped toVARCHAR(2000000) UTF8
. If the virtual schema is queried and a row of the text column is matched that contains a value that exceed Exasol's column size, an error is shown. - The Sybase data types
BINARY
,VARBINARY
, andIMAGE
are not supported.
The Sybase dialect was tested with the jTDS 1.3.1 JDBC driver and Sybase 16.0.