Skip Headers
Oracle® Database Gateway for SQL Server User's Guide,
11g Release 2 (11.2)

Part Number E12069-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
GMSWN500

B Supported SQL Syntax and Functions

This appendix contains the following sections:

GMSWN775

Supported SQL Statements

With a few exceptions, the gateway provides full support for Oracle DELETE, INSERT, SELECT, and UPDATE statements.

The gateway does not support Oracle data definition language (DDL) statements. No form of the Oracle ALTER, CREATE, DROP, GRANT, or TRUNCATE statements can be used. Instead, use the pass-through feature of the gateway if you need to use DDL statements against the SQL Server database.

Note:

TRUNCATE cannot be used in a pass-through statement.

See Also:

Oracle Database Reference for detailed descriptions of keywords, parameters, and options.
GMSWN776

DELETE

The DELETE statement is fully supported. However, only Oracle functions supported by SQL Server can be used.

See Also:

"Functions Supported by SQL Server" for a list of supported functions.
GMSWN777

INSERT

The INSERT statement is fully supported. However, only Oracle functions supported by SQL Server can be used.

See Also:

"Functions Supported by SQL Server" for a list of supported functions.
GMSWN778

SELECT

The SELECT statement is fully supported, with these exceptions:

  • CONNECT BY condition

  • NOWAIT

  • START WITH condition

  • WHERE CURRENT OF

GMSWN779

UPDATE

The UPDATE statement is fully supported. However, only Oracle functions supported by SQL Server can be used.

See Also:

"Functions Supported by SQL Server" for a list of supported functions.
GMSWN780

Oracle Functions

All functions are evaluated by the SQL Server database after the gateway has converted them to SQL Server SQL equivalents. The exception is the TO_DATE function, which is evaluated by the gateway.

GMSWN781

Functions Not Supported by SQL Server

Oracle SQL functions with no equivalent function in SQL Server are not supported in DELETE, INSERT, or UPDATE statements, but are evaluated by the Oracle database if the statement is a SELECT statement. That is, the Oracle database performs post-processing of SELECT statements sent to the gateway.

If an unsupported function is used in a DELETE, INSERT, or UPDATE, statement, the following Oracle error occurs:

ORA-02070: database db_link_name does not support function in this context
GMSWN782

Functions Supported by SQL Server

The gateway translates the following Oracle database functions in SQL statements to their equivalent SQL Server functions:

GMSWN783

Arithmetic Operators

Oracle SQL Server
+ +
- -
* *
/ /

GMSWN784

Comparison Operators

Oracle SQL Server
= =
> >
< <
>= >=
<= <=
<>, !=, ^= <>
IS NOT NULL IS NOT NULL
IS NULL IS NULL

GMSWN785

Pattern Matching

Oracle SQL Server
LIKE LIKE
NOT LIKE NOT LIKE

GMSWN786

Group Functions

Oracle SQL Server
AVG AVG
COUNT COUNT
MAX MAX
MIN MIN
SUM SUM

GMSWN787

String Functions

Oracle SQL Server
||, CONCAT + (expression1 + expression2)
ASCII ASCII
CHR CHAR
INSTR (with two arguments) CHARINDEX
LENGTH DATALENGTH
LOWER LOWER
LTRIM LTRIM
RTRIM RTRIM
SUBSTR (second argument cannot be a negative number) SUBSTRING
UPPER UPPER

GMSWN788

Other Functions

Oracle SQL Server
ABS ABS
CEIL CEILING
COS COS
EXP EXP
FLOOR FLOOR
LN LOG
LOG LOG10
MOD %
NOT NVL IS NOT NULL
NVL IS NULL
POWER POWER
ROUND ROUND
SIN SIN
SQRT SQRT
TAN TAN

GMSWN789

Functions Supported by the Gateway

If an Oracle function has no equivalent function in SQL Server, the Oracle function is not translated into the SQL statement and must be post-processed if the SQL statement is a SELECT.

The gateway, however, does support the TO_DATE function equivalent in SQL Server, as follows:

TO_DATE(date_string | date_column)

Where:

date_string is converted to a string with the following format:

yyyy-mm-dd hh:mi:ss.fff

Recommendation:

Supply the date string with the same format as the result (that is, yyyyy-mm-dd hh:mi:ss.fff).

date_column is a column with a date data type. It is converted to a parameter with a timestamp data type.

Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Page

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF