15. Open SQL Extensions Flashcards
SELECT DISTINCT
Option is used to return only one record for each unique occurrence of data in a column based on a field name (or combination of field names). All other records that have the same matching data, will not be included in the result set.
Aggregate Functions
MIN, MAX, AVG, SUM and COUNT
CONCATENATE statement
is a string processing statement which enables the programmer to combine the contents of one or more source fields into a single target field.
SEPARATED BY statement
is useful for embedding spaces or special characters between the multiple source fields before they are transported to the target field.
PACKAGE SIZE
Reading selected rows into an internal table in packages of a predefined size is possible using the PACKAGE SIZE option with the INTO clause.
CURSOR
is used to fetch the next row (or set of rows) from almost any SELECT statement that produces a result set of more than one row.
OPEN CURSOR statement
The CURSOR is associated with a SELECT statement in the OPEN CURSOR statement.
FETCH statement
Retrieves the rows from the CURSOR one by one until there are no more rows left
CLOSE CURSOR
is used to terminate CURSOR processing. When the statement is issued, the internal result set is destroyed and access is no longer possible unless a new OPEN CURSOR statement is executed.
joins
Are more efficient than logical databases and nested selects. They access multiple tables with one select statement.
• Joins have the advantage of accessing multiple tables with one Select statement, thereby reducing the amount of server overhead.
Inner joins
Allow access to multiple tables with a single select statement by creating a temporary table based on the conditions in the ON statement. Inner Joins are equivalent to views created in the Dictionary (see Data Dictionary part).
HAVING clause
assigns the selection criteria handling to the database instead of the application server. Similar to the subquery, the advantage of this is the reduction in the amount of data being transferred between the two layers.