Firebird Documentation IndexFirebird 2.5 Language Reference → Data Manipulation (DML) Statements
Firebird Home Firebird Home Prev: COMMENTSFirebird Documentation IndexUp: Firebird 2.5 Language ReferenceNext: SELECT

Chapter 6: Data Manipulation (DML) Statements

Table of Contents

SELECT
FIRST, SKIP
Characteristics of FIRST and SKIP
The SELECT Columns List
The FROM clause
Selecting FROM a table or view
Selecting FROM a stored procedure
Selecting FROM a derived table
Selecting FROM a CTE
Joins
Inner vs. outer joins
Qualified joins
Natural joins
A Note on Equality
Cross joins
Ambiguous field names in joins
Joins with stored procedures
The WHERE clause
The GROUP BY clause
HAVING
The PLAN clause
Simple plans
Composite plans
UNION
ORDER BY
Sorting Direction
Collation Order
NULLs Position
Ordering UNION-ed Sets
ROWS
Mixing ROWS and FIRST/SKIP
ROWS Syntax in UNION Queries
FOR UPDATE [OF]
WITH LOCK
Usage with a FOR UPDATE Clause
How the engine deals with WITH LOCK
Caveats using WITH LOCK
INTO
Common Table Expressions (“WITH ... AS ... SELECT”)
Recursive CTEs
INSERT
INSERT ... VALUES
INSERT ... SELECT
The “Unstable Cursor” Problem
INSERT ... DEFAULT VALUES
The RETURNING clause
Inserting into BLOB columns
UPDATE
Using an alias
The SET Clause
The WHERE Clause
The “Unstable Cursor” Problem
The ORDER BY and ROWS Clauses
The RETURNING Clause
The INTO Sub-clause
Updating BLOB columns
UPDATE OR INSERT
The RETURNING clause
DELETE
Aliases
WHERE
PLAN
ORDER BY and ROWS
RETURNING
MERGE
EXECUTE PROCEDURE
Executable” Stored Procedure
EXECUTE BLOCK
Input and output parameters
Statement Terminators

REVIEW STATUS

All sections from this point forward to the end of the chapter are awaiting technical and editorial review.

DML—data manipulation language— is the subset of SQL that is used by applications and procedural modules to extract and change data. Extraction, for the purpose of reading data, both raw and manipulated, is achieved with the SELECT statement. INSERT is for adding new data and DELETE is for erasing data that are no longer required. UPDATE, MERGE and INSERT OR UPDATE all modify data in various ways.

Prev: COMMENTSFirebird Documentation IndexUp: Firebird 2.5 Language ReferenceNext: SELECT
Firebird Documentation IndexFirebird 2.5 Language Reference → Data Manipulation (DML) Statements