SQL - Dynamic SQL

Data System Architecture

About

Some programs (a general-purpose report writer for example) must build and process a variety of SQL statements, where the exact text of the statement is unknown until run time. Such statements probably change from execution to execution. They are called dynamic SQL statements.

Example

SELECT 
  statement||DECODE(ROWNUM, MAX(ROWNUM) over (PARTITION BY 1),' order by aantal, table_name;',' union all')
FROM
(
  SELECT 'select '''||table_name||''' table_name, count(1) numberOfRows from '||table_name AS statement
  FROM user_tables
  ORDER BY table_name
);





Discover More
Data System Architecture
Database - Call level interface (CLI)

Call level interface (CLI) is a type of database interface (next to Jdbc/ODBC). It's also known as the callable Structured Query Language (SQL) programming interface. A callable SQL interface is a WinsockWinSock...
Jdbc Class Architecture
JDBC - Oracle

Definition of the JDBC Oracle API or how to connect to a JDBC oracle and made database operations. A simple application includes the following classes: DataHandler.java. This class contains all...
Card Puncher Data Processing
PL/SQL - Dynamic SQL

SQL statements that are only know until run time are called dynamic SQL statements. To process a dynamic sql statement, you can use the following Native dynamic SQL statement: the statement with the...



Share this page:
Follow us:
Task Runner