SQL 
Use
You can use the
Structured Query Language (SQL) to define, display, insert, change and delete
data in the database. The database system executes SQL statements within
transactions.
The SQL statements
are divided into the following groups:
·
Data
definition
·
Authorization
·
Data
manipulation
·
Data
query
·
Transactions
·
Statistics
For an introduction
to the MaxDB SQL syntax, see the SQL Tutorial; for
a complete description, see the Reference
Manual.
Activities
·
To program a
database application, you can embed SQL statements in the programming language
of your choice and send them to the database instance via an
interface.
Users of the
database application then enter SQL statements only
implicitly.
·
You can
explicitly enter SQL statements with the following database tools,
among others:
¡
SQL Studio (GUI,
only for Microsoft Windows)
¡
SQLCLI (command
line for all supported operating systems)
¡
Web SQL
(web-based, for all supported operating systems)
Features
In the MaxDB
database system you can use the following data types, among others: BOOLEAN,
CHAR[ACTER] (ASCII, BYTE, UNICODE), DATE, FIXED, FLOAT, INT[EGER], LONG
(ASCII, BYTE,UNICODE) for saving BLOBs and CLOBs, SMALLINT, TIME, TIMESTAMP,
VARCHAR (ASCII, BYTE, UNICODE). See the Reference Manual, Data Type
(data_type)
By working with the
database system, you can choose the SQL mode. For more information about the
differences between the SQL modes INTERNAL and ORACLE, see the SQL Mode ORACLE
documentation.
Important SQL
Properties of MaxDB
Property
|
Additional
Information
|
Schema
|
Reference Manual, CREATE SCHEMA
Statement (create_schema_statement)
|
Foreign
keys
(referential
integrity)
|
SQL Tutorial, Foreign Key
Dependencies Between Tables
Reference Manual, Referential CONSTRAINT
Definition (referential_constraint_definition)
|
Explicit and
implicit locks on rows, tables and the database catalog
|
Reference
Manual,
LOCK Statement
(lock_statement)
LOCK Option
(lock_option)
|
Updatable view
table
|
SQL Tutorial, View
Tables
Reference Manual, CREATE VIEW Statement
(create_view_statement)
|
Temporary
table
|
Reference Manual, CREATE TABLE Statement
(create_table_statement)
|
Domain
definition
|
SQL Tutorial, Domains
Reference Manual, CREATE DOMAIN
Statement (create_domain_statement)
|
Outer
join
|
SQL Tutorial, Joins: Information
from Several Tables
Reference Manual, JOIN Predicate
(join_predicate)
|
Subquery
|
SQL Tutorial, Subquery: Inner
Queries
Reference Manual, Subquery
(subquery)
|
Subtransaction
|
Reference Manual, SUBTRANS Statement
(subtrans_statement)
|
Number generator
(auto-increment column)
|
SQL Tutorial, Number Generators for
Tables
Reference Manual, CREATE SEQUENCE
Statement (create_sequence_statement)
|
Database procedure
(stored procedures)
|
SQL
Tutorial, Database
Procedures
Reference Manual, CREATE DBPROC[EDURE]
Statement (create_dbproc_statement)
|
Database function
(user-defined function)
|
SQL
Tutorial, Database
Functions
Reference Manual, CREATE FUNCTION
Statement (create_function_statement)
|
Triggers
|
SQL
Tutorial Database
Trigger
Reference
Manual,
CREATE TRIGGER
Statement (create_trigger_statement)
CREATE SYSTEM TRIGGER
Statement (create_system_trigger_statement)
|
Server-side
cursor
|
Reference Manual, DECLARE CURSOR
Statement (declare_cursor_statement)
|
Shared SQL (re-use
of execution plans)
|
Special Database
Parameters SHAREDSQL
|
Optimization
|
SQL
Optimizer
|
You can find an
overview of all SQL statements in the Reference Manual under SQL Statements:
Overview.
For information
about restrictions, see the Reference Manual, Restrictions for SQL
Statements
See
also:
Transactions
Locking for Database
Objects
Developing Database
Applications
Overview of the
Database System