Background documentationSQL Locate this document in the navigation structure

 

To define, query, insert, change, and delete data in an SAP MaxDB database, you use the Structured Query Language (SQL).

To program a database application, you can embed SQL statements in a programming language and send them to the database via one of the SAP MaxDB interfaces. Users of the database application then only implicitly enter SQL statements. More information: Database Administration, Developing Database Applications

For development and tests you can explicitly enter SQL statements using the following database tools:

SQL Syntax

The SQL statements are divided into the following groups: data definition, authorization, data manipulation, data query, transactions, and statistics.

More information:

SQL Properties of SAP MaxDB (Selection)

Property

More information

Schema

SQL Tutorial, Schemas

SQL Reference Manual, CREATE SCHEMA Statement (create_schema_statement)

Foreign Keys

(referential integrity)

SQL Tutorial, Foreign Key Dependencies Between Tables

SQL Reference Manual, Referential CONSTRAINT Definition (referential_constraint_definition)

Explicit and implicit locks on rows, tables and the database catalog

SQL Reference Manual, Transactions

LOCK Statement (lock_statement)

LOCK Option (lock_option)

Updatable view table

SQL Tutorial, View Tables

SQL Reference Manual, CREATE VIEW Statement (create_view_statement)

Temporary table

SQL Reference Manual, CREATE TABLE Statement (create_table_statement)

Domain definition

SQL Tutorial, Domains

SQL Reference Manual, CREATE DOMAIN Statement (create_domain_statement)

Join

SQL Tutorial, Joins: Information From Several Tables

SQL Reference Manual, JOIN Predicate (join_predicate)

Subquery

SQL Tutorial, Subquery: Inner Queries

SQL Reference Manual, Subquery (subquery)

Subtransaction

SQL Reference Manual, SUBTRANS Statement (subtrans_statement)

Number generator (auto-increment column)

SQL Tutorial, Number Generators for Tables

SQL Reference Manual, CREATE SEQUENCE Statement (create_sequence_statement)

Database procedure (stored procedures)

SQL Tutorial, Database Procedures

SQL Reference Manual, CREATE DBPROC[EDURE] Statement (create_dbproc_statement)

Database function (user-defined function)

SQL Tutorial, Database Functions

SQL Reference Manual, CREATE FUNCTION Statement (create_function_statement)

Triggers

SQL Tutorial, Database Triggers

SQL Reference Manual,

CREATE TRIGGER Statement (create_trigger_statement)

CREATE SYSTEM TRIGGER Statement (create_system_trigger_statement)

Server-side cursor

SQL Reference Manual, DECLARE CURSOR Statement (declare_cursor_statement)

Shared SQL (re-use of execution plans)

Special Database Parameters UseSharedSQL

Optimization

SQL Optimizer

Data Types
SAP MaxDB Data Types

Data Type

Description in SQL Reference Manual

BOOLEAN

Boolean

CHAR[ACTER] (ASCII, BYTE, UNICODE)

CHAR[ACTER]

DATE

DATE (date value)

FIXED

FIXED

FLOAT

FLOAT

INT[EGER]

INT[EGER]

CLOB [ASCII]

CLOB UNICODE

BLOB

LOB Column

In earlier database versions, this data type was known as LONG.

SMALLINT

SMALLINT

TIME

TIME (time value)

TIMESTAMP

TIMESTAMP (time stamp value)

VARCHAR (ASCII, BYTE, UNICODE)

VARCHAR

More information: SQL Reference Manual, Data Type (data_type)

Compatibility

You can choose between two SQL modes: INTERNAL and ORACLE.

More information: SQL Mode ORACLE

More Information

Transactions

Locks