Omitting the list of columns is equivalent to specifying all values SELECT - INSERT • E.g. INSERT INTO TEMP (A#, B) SELECT A#, SUM(B) FROM TEMP1 GROUP BY A# ; DML statements (contd...) UPDATE E.g.. UPDATE tablename SET Columnname(s) = scalar expression WHERE [ condition ] Single or Multiple row updates Update with a Subquery DML statements (contd...) DELETE E.g. DELETE FROM Tablename WHERE [condition ]; Single or multiple row delete or deletion of all rows Static SQL Hard-coded into an application program cannot be modified during the program’s execution except for changes to the values assigned to the host variables Cursors are used to access set-level data (i.e when a SQL SELECT returns more than 1 row) The general form is EXEC SQL [SQL statements] END-EXEC. Dynamic SQL Statements can change throughout the program’s execution When the SQL is bound, the application plan or package that is created does not contain the same information as that for a static SQL program The access paths cannot be determined before execution What is an Index ?
Omitting the list of columns is equivalent to specifying all values • SELECT - INSERT E.g. INSERT INTO TEMP (A#, B) SELECT A#, SUM(B) FROM TEMP1 GROUP BY A# ; DML statements (contd...) UPDATE E.g.. UPDATE tablename SET Columnname(s) = scalar expression WHERE [ condition ] Single or Multiple row updates Update with a Subquery DML statements (contd...) DELETE E.g. DELETE FROM Tablename WHERE [condition ]; Single or multiple row delete or deletion of all rows Static SQL Hard-coded into an application program cannot be modified during the program’s execution except for changes to the values assigned to the host variables Cursors are used to access set-level data (i.e when a SQL SELECT returns more than 1 row) The general form is EXEC SQL [SQL statements] END-EXEC. Dynamic SQL Statements can change throughout the program’s execution When the SQL is bound, the application plan or package that is created does not contain the same information as that for a static SQL program The access paths cannot be determined before execution What is an Index ?
db2.docx