The document discusses different ways to avoid mutating table errors when using triggers in Oracle:
1. Use a compound trigger instead of a row-level trigger to avoid the error. A compound trigger allows initializing variables before and after statements to prevent mutating errors.
2. An example is given of a compound trigger that enforces a business rule limiting salary increases to 10% of the department average without causing a mutating error.
3. The mutating error occurs when a trigger references the table that owns the trigger, preventing the trigger from seeing changes made by its own statement.
Oracle - Program with PL/SQL - Lession 07Thuan Nguyen
1. Cursors can be declared with parameters to return different active sets each time the cursor is opened. Parameters allow filtering the cursor result set.
2. The FOR UPDATE clause locks rows before updating or deleting them using a cursor. It is required when updating or deleting the current row referenced by the WHERE CURRENT OF clause.
3. The WHERE CURRENT OF clause references the current row of an explicit cursor and is used with the FOR UPDATE clause to update or delete the row currently being processed by the cursor.
Oracle - Program with PL/SQL - Lession 03Thuan Nguyen
This document discusses interacting with Oracle Server objects through PL/SQL. It covers:
1. Writing SELECT, DML, and transaction control statements in PL/SQL to extract, modify and manage data.
2. Using implicit cursors and attributes to check outcomes of SQL statements.
3. Best practices for naming conventions to avoid ambiguities between local and database identifiers.
1. The document discusses various SQL commands for creating, manipulating, and querying database tables. It covers commands like CREATE TABLE, INSERT, SELECT, UPDATE, DELETE, ALTER TABLE, COMMENT, and more.
2. Mathematical functions like COUNT, MAX, MIN, ROUND, TRUNC are described along with logical and comparison operators.
3. The document provides examples of using operators, functions, joins and grouping with detailed explanations.
This document describes various single-row functions in SQL that can manipulate or modify data. It discusses character, number, date, and conversion functions and provides examples of how to use functions like TO_CHAR, TO_NUMBER, ROUND, TRUNC, and DECODE in SELECT statements. Common uses of functions include performing calculations, formatting output, converting data types, and conditional processing of data. Nesting functions allows multiple operations to be applied sequentially.
Oracle - Program with PL/SQL - Lession 16Thuan Nguyen
This document describes how to create and use database triggers in Oracle. It discusses the different types of triggers, how to create triggers for DML statements and views, and how to manage triggers. Key points include:
- Triggers can be defined to fire before or after DML statements or instead of DML on views.
- Row triggers fire once per row affected, statement triggers fire once per statement.
- Triggers use OLD and NEW qualifiers to access old and new row values.
- INSTEAD OF triggers on views perform DML instead of the triggering statement.
- Triggers must be carefully tested to avoid unintended consequences.
This document provides an overview of basic SQL statements and SQL*Plus commands. It covers capabilities of SELECT statements, executing a basic SELECT statement, writing SQL statements, selecting specific columns, using arithmetic expressions and operators, defining aliases and literals, eliminating duplicate rows, and interacting with SQL*Plus through commands like editing, saving, and running SQL statements.
Oracle - Program with PL/SQL - Lession 04Thuan Nguyen
This document discusses control structures in PL/SQL including IF statements, CASE expressions, and loops. It provides examples of using IF-THEN-ELSE statements and IF-THEN-ELSIF statements to conditionally execute code. It also demonstrates using basic, WHILE, and FOR loops to iteratively execute code. Guidelines are provided for using control structures and nested loops with labels.
Subqueries allow queries to be nested within other queries. They can return either single rows or multiple rows. Single-row subqueries use comparison operators like = or >, while multiple-row subqueries use operators like IN, ANY, or ALL. Subqueries execute first before the outer or main query uses the results. This allows the main query to filter or compare based on unknown values from the subquery.
Oracle - Program with PL/SQL - Lession 07Thuan Nguyen
1. Cursors can be declared with parameters to return different active sets each time the cursor is opened. Parameters allow filtering the cursor result set.
2. The FOR UPDATE clause locks rows before updating or deleting them using a cursor. It is required when updating or deleting the current row referenced by the WHERE CURRENT OF clause.
3. The WHERE CURRENT OF clause references the current row of an explicit cursor and is used with the FOR UPDATE clause to update or delete the row currently being processed by the cursor.
Oracle - Program with PL/SQL - Lession 03Thuan Nguyen
This document discusses interacting with Oracle Server objects through PL/SQL. It covers:
1. Writing SELECT, DML, and transaction control statements in PL/SQL to extract, modify and manage data.
2. Using implicit cursors and attributes to check outcomes of SQL statements.
3. Best practices for naming conventions to avoid ambiguities between local and database identifiers.
1. The document discusses various SQL commands for creating, manipulating, and querying database tables. It covers commands like CREATE TABLE, INSERT, SELECT, UPDATE, DELETE, ALTER TABLE, COMMENT, and more.
2. Mathematical functions like COUNT, MAX, MIN, ROUND, TRUNC are described along with logical and comparison operators.
3. The document provides examples of using operators, functions, joins and grouping with detailed explanations.
This document describes various single-row functions in SQL that can manipulate or modify data. It discusses character, number, date, and conversion functions and provides examples of how to use functions like TO_CHAR, TO_NUMBER, ROUND, TRUNC, and DECODE in SELECT statements. Common uses of functions include performing calculations, formatting output, converting data types, and conditional processing of data. Nesting functions allows multiple operations to be applied sequentially.
Oracle - Program with PL/SQL - Lession 16Thuan Nguyen
This document describes how to create and use database triggers in Oracle. It discusses the different types of triggers, how to create triggers for DML statements and views, and how to manage triggers. Key points include:
- Triggers can be defined to fire before or after DML statements or instead of DML on views.
- Row triggers fire once per row affected, statement triggers fire once per statement.
- Triggers use OLD and NEW qualifiers to access old and new row values.
- INSTEAD OF triggers on views perform DML instead of the triggering statement.
- Triggers must be carefully tested to avoid unintended consequences.
This document provides an overview of basic SQL statements and SQL*Plus commands. It covers capabilities of SELECT statements, executing a basic SELECT statement, writing SQL statements, selecting specific columns, using arithmetic expressions and operators, defining aliases and literals, eliminating duplicate rows, and interacting with SQL*Plus through commands like editing, saving, and running SQL statements.
Oracle - Program with PL/SQL - Lession 04Thuan Nguyen
This document discusses control structures in PL/SQL including IF statements, CASE expressions, and loops. It provides examples of using IF-THEN-ELSE statements and IF-THEN-ELSIF statements to conditionally execute code. It also demonstrates using basic, WHILE, and FOR loops to iteratively execute code. Guidelines are provided for using control structures and nested loops with labels.
Subqueries allow queries to be nested within other queries. They can return either single rows or multiple rows. Single-row subqueries use comparison operators like = or >, while multiple-row subqueries use operators like IN, ANY, or ALL. Subqueries execute first before the outer or main query uses the results. This allows the main query to filter or compare based on unknown values from the subquery.
Group functions operate on sets of rows to give one result per group. Some key points covered in the document include:
1. Group functions like AVG, COUNT, MAX, MIN, SUM allow aggregating data across rows grouped by columns like department.
2. The GROUP BY clause is used to divide rows into groups and column(s) in the SELECT that are not aggregate functions must be in the GROUP BY.
3. The HAVING clause is used to filter groups based on conditions with aggregate functions and comes after GROUP BY.
This document discusses how to limit and sort data retrieved from a database table using SQL queries. It covers using the WHERE clause to restrict rows by conditions, comparison operators like = and BETWEEN, logical operators like AND and OR, and the ORDER BY clause to sort rows in ascending or descending order based on one or more columns. Examples are provided for each technique.
Oracle - Program with PL/SQL - Lession 01Thuan Nguyen
This document discusses declaring and using variables in PL/SQL blocks. It covers declaring scalar variables like numbers, dates, strings, and booleans. It also discusses composite variables, reference variables, and LOB variables. It explains initializing variables, naming conventions, and using the %TYPE attribute. It describes using DBMS_OUTPUT to display output and bind variables to pass values between PL/SQL and SQL*Plus. The overall goal is to teach how to declare variables, execute blocks, and handle exceptions when programming in PL/SQL.
Oracle - Program with PL/SQL - Lession 09Thuan Nguyen
This document discusses procedures in PL/SQL, including:
1. How to create procedures using the CREATE PROCEDURE statement and define parameters.
2. The different parameter modes: IN, OUT, and IN OUT.
3. How to handle exceptions within procedures.
4. How to invoke procedures from other procedures, scripts, or applications.
5. Best practices for developing reusable procedures.
This document discusses how to restrict and sort data retrieved by SQL queries. It covers limiting rows using the WHERE clause and comparison operators, and sorting rows using the ORDER BY clause. Examples are provided for each clause and operator to filter rows by conditions and sort the output in ascending or descending order on one or multiple columns. Parentheses can be used to override the default order of operation precedence.
Oracle - Program with PL/SQL - Lession 17Thuan Nguyen
This document discusses advanced concepts for creating and using database triggers in Oracle. It covers creating triggers on DDL statements, system events, and tables. Triggers can be used to enforce security, data integrity, referential integrity, event logging, and compute derived values. The document provides examples of triggers for these purposes and discusses best practices for managing triggers.
MySQL is an open-source relational database management system that uses SQL and runs a server providing multi-user access to databases. It allows users to perform queries and make changes to data through commands like SELECT, INSERT, UPDATE, DELETE. Stored procedures and functions allow users to write and save blocks of SQL code for repeated execution with consistent results.
This document discusses data manipulation in Oracle databases. It describes how to insert, update, and delete rows from tables using DML statements like INSERT, UPDATE, and DELETE. It also covers transaction management using COMMIT, ROLLBACK, and SAVEPOINT statements to control when changes are committed to the database or rolled back. Key aspects covered include inserting new rows, updating and deleting specific rows or all rows, and handling integrity constraints and transactions.
This document discusses views in Oracle databases. It defines a view as a virtual table derived from one or more underlying base tables or other views. The document covers how to create simple and complex views, modify view definitions, perform DML operations on views, and remove views. Key points include that views allow restricting access, simplifying queries, and presenting different perspectives of the same data without affecting the base tables.
Abstract: Developers - If you are not using Bulk Binds you are not writing PL/SQL efficiently!
Bulk binding has been around for a long time, yet there are sites out there that don't utilise this feature to its full extent, if at all. Every release of Oracle improves on this functionality so obviously it's a topic worthy of consistent awareness.
In PL/SQL and SQL, there are a few nifty features related to bulk binding you may not have seen - it's not all about BULK COLLECT. Whether you're on 8i, 11g or anything in between, you'll benefit from the concepts described in this seminar and become a Bulk Binding Baron!
The document discusses how to create and manage database tables. Key topics covered include using CREATE TABLE to define table structure, ALTER TABLE to modify tables, DROP TABLE to remove tables, and TRUNCATE TABLE to delete all rows. Datatypes, naming conventions, adding comments, and joining tables with subqueries are also summarized.
The document provides an overview of basic SQL statements and capabilities. It discusses using SELECT statements to project columns, select rows, and join tables. It also covers arithmetic expressions, column aliases, concatenation, and eliminating duplicate rows. SQL statements are executed through the SQL*Plus environment, which allows editing, saving, and running SQL code and commands.
Oracle 11g new features for developersScott Wesley
Abstract: There are a wealth of new features available in the 11g database release. This presentation touches on SQL & PL/SQL features I found of interest, and concentrates particularly on virtual columns.
Relevant scripts found at my blog
http://grassroots-oracle.com/2009/07/presentations.html#11gNewFeatures
The document discusses data manipulation language (DML) statements in SQL. It describes how to insert rows into a table using INSERT, update rows using UPDATE, and delete rows from a table using DELETE. It also covers transaction control using COMMIT to save changes permanently and ROLLBACK to undo pending changes back to a savepoint.
The document provides an overview of various Oracle tips and tricks, including CASE statements, joins, timestamps, renaming tables/columns, merge statements, subqueries, window functions, hierarchical queries, XML, grouping sets, rollups and cubes, indexes, temporary tables and more. Key features introduced in Oracle 9i such as the CASE statement, full outer joins, timestamps and the WITH clause are highlighted.
This document discusses techniques for joining data from multiple database tables. It covers equijoins to retrieve matching records between tables, non-equijoins to retrieve records with non-equal conditions, outer joins to include non-matching records, and self joins to join a table to itself. Examples are provided to demonstrate how to write SQL statements to perform each type of join and include additional conditions.
Single-row functions can manipulate data items, accept arguments and return one value, and act on each row returned. There are various types of single-row functions including character, number, date, and conversion functions. Character functions manipulate character strings, number functions perform calculations, and date functions modify date formats. Functions allow data to be formatted, calculated, and converted as needed for different queries and outputs.
The document provides guidance on optimizing PL/SQL code performance. It discusses avoiding unnecessary row-by-row processing, nested row-by-row processing, and excessive access to the DUAL table. Instead, it recommends performing set-based operations using SQL and caching frequently accessed values in memory to reduce database hits. The document also covers reducing excessive function calls and unnecessary parsing through techniques like result caching and inline views.
This document discusses database management systems and SQL. It provides examples of creating tables, inserting and retrieving data using commands like SELECT, UPDATE, and DELETE. It also covers SQL sublanguages, data types, logical operators, and pattern matching operators. Key points include that a DBMS manages a database using software, SQL is the standard language used to communicate with databases, and tables are used to store data in rows and columns.
The document describes various data manipulation language (DML) commands in Oracle such as INSERT, SELECT, UPDATE, DELETE, logical operators, pattern matching, aggregate functions, and date functions. Examples are provided to demonstrate inserting, selecting, updating, deleting records from a table and using functions to analyze and retrieve data based on conditions.
This document discusses various ways to set and check the optimizer mode in Oracle at both the parameter and session level. It also provides examples of using EXPLAIN PLAN to view execution plans for different types of queries, examples of query transformations Oracle can perform, and tips for SQL performance tuning such as using appropriate data types in comparisons and minimizing functions in joins.
The document provides an overview of Data Query Language (DQL) syntax for SELECT statements including:
- Selecting columns from tables
- Using column aliases
- Filtering rows with the WHERE clause
- Working with NULL values
- Sorting results with the ORDER BY clause
- Grouping rows with the GROUP BY clause and aggregate functions
- Filtering groups with the HAVING clause
- Sorting on multiple columns
- Nested subqueries
Group functions operate on sets of rows to give one result per group. Some key points covered in the document include:
1. Group functions like AVG, COUNT, MAX, MIN, SUM allow aggregating data across rows grouped by columns like department.
2. The GROUP BY clause is used to divide rows into groups and column(s) in the SELECT that are not aggregate functions must be in the GROUP BY.
3. The HAVING clause is used to filter groups based on conditions with aggregate functions and comes after GROUP BY.
This document discusses how to limit and sort data retrieved from a database table using SQL queries. It covers using the WHERE clause to restrict rows by conditions, comparison operators like = and BETWEEN, logical operators like AND and OR, and the ORDER BY clause to sort rows in ascending or descending order based on one or more columns. Examples are provided for each technique.
Oracle - Program with PL/SQL - Lession 01Thuan Nguyen
This document discusses declaring and using variables in PL/SQL blocks. It covers declaring scalar variables like numbers, dates, strings, and booleans. It also discusses composite variables, reference variables, and LOB variables. It explains initializing variables, naming conventions, and using the %TYPE attribute. It describes using DBMS_OUTPUT to display output and bind variables to pass values between PL/SQL and SQL*Plus. The overall goal is to teach how to declare variables, execute blocks, and handle exceptions when programming in PL/SQL.
Oracle - Program with PL/SQL - Lession 09Thuan Nguyen
This document discusses procedures in PL/SQL, including:
1. How to create procedures using the CREATE PROCEDURE statement and define parameters.
2. The different parameter modes: IN, OUT, and IN OUT.
3. How to handle exceptions within procedures.
4. How to invoke procedures from other procedures, scripts, or applications.
5. Best practices for developing reusable procedures.
This document discusses how to restrict and sort data retrieved by SQL queries. It covers limiting rows using the WHERE clause and comparison operators, and sorting rows using the ORDER BY clause. Examples are provided for each clause and operator to filter rows by conditions and sort the output in ascending or descending order on one or multiple columns. Parentheses can be used to override the default order of operation precedence.
Oracle - Program with PL/SQL - Lession 17Thuan Nguyen
This document discusses advanced concepts for creating and using database triggers in Oracle. It covers creating triggers on DDL statements, system events, and tables. Triggers can be used to enforce security, data integrity, referential integrity, event logging, and compute derived values. The document provides examples of triggers for these purposes and discusses best practices for managing triggers.
MySQL is an open-source relational database management system that uses SQL and runs a server providing multi-user access to databases. It allows users to perform queries and make changes to data through commands like SELECT, INSERT, UPDATE, DELETE. Stored procedures and functions allow users to write and save blocks of SQL code for repeated execution with consistent results.
This document discusses data manipulation in Oracle databases. It describes how to insert, update, and delete rows from tables using DML statements like INSERT, UPDATE, and DELETE. It also covers transaction management using COMMIT, ROLLBACK, and SAVEPOINT statements to control when changes are committed to the database or rolled back. Key aspects covered include inserting new rows, updating and deleting specific rows or all rows, and handling integrity constraints and transactions.
This document discusses views in Oracle databases. It defines a view as a virtual table derived from one or more underlying base tables or other views. The document covers how to create simple and complex views, modify view definitions, perform DML operations on views, and remove views. Key points include that views allow restricting access, simplifying queries, and presenting different perspectives of the same data without affecting the base tables.
Abstract: Developers - If you are not using Bulk Binds you are not writing PL/SQL efficiently!
Bulk binding has been around for a long time, yet there are sites out there that don't utilise this feature to its full extent, if at all. Every release of Oracle improves on this functionality so obviously it's a topic worthy of consistent awareness.
In PL/SQL and SQL, there are a few nifty features related to bulk binding you may not have seen - it's not all about BULK COLLECT. Whether you're on 8i, 11g or anything in between, you'll benefit from the concepts described in this seminar and become a Bulk Binding Baron!
The document discusses how to create and manage database tables. Key topics covered include using CREATE TABLE to define table structure, ALTER TABLE to modify tables, DROP TABLE to remove tables, and TRUNCATE TABLE to delete all rows. Datatypes, naming conventions, adding comments, and joining tables with subqueries are also summarized.
The document provides an overview of basic SQL statements and capabilities. It discusses using SELECT statements to project columns, select rows, and join tables. It also covers arithmetic expressions, column aliases, concatenation, and eliminating duplicate rows. SQL statements are executed through the SQL*Plus environment, which allows editing, saving, and running SQL code and commands.
Oracle 11g new features for developersScott Wesley
Abstract: There are a wealth of new features available in the 11g database release. This presentation touches on SQL & PL/SQL features I found of interest, and concentrates particularly on virtual columns.
Relevant scripts found at my blog
http://grassroots-oracle.com/2009/07/presentations.html#11gNewFeatures
The document discusses data manipulation language (DML) statements in SQL. It describes how to insert rows into a table using INSERT, update rows using UPDATE, and delete rows from a table using DELETE. It also covers transaction control using COMMIT to save changes permanently and ROLLBACK to undo pending changes back to a savepoint.
The document provides an overview of various Oracle tips and tricks, including CASE statements, joins, timestamps, renaming tables/columns, merge statements, subqueries, window functions, hierarchical queries, XML, grouping sets, rollups and cubes, indexes, temporary tables and more. Key features introduced in Oracle 9i such as the CASE statement, full outer joins, timestamps and the WITH clause are highlighted.
This document discusses techniques for joining data from multiple database tables. It covers equijoins to retrieve matching records between tables, non-equijoins to retrieve records with non-equal conditions, outer joins to include non-matching records, and self joins to join a table to itself. Examples are provided to demonstrate how to write SQL statements to perform each type of join and include additional conditions.
Single-row functions can manipulate data items, accept arguments and return one value, and act on each row returned. There are various types of single-row functions including character, number, date, and conversion functions. Character functions manipulate character strings, number functions perform calculations, and date functions modify date formats. Functions allow data to be formatted, calculated, and converted as needed for different queries and outputs.
The document provides guidance on optimizing PL/SQL code performance. It discusses avoiding unnecessary row-by-row processing, nested row-by-row processing, and excessive access to the DUAL table. Instead, it recommends performing set-based operations using SQL and caching frequently accessed values in memory to reduce database hits. The document also covers reducing excessive function calls and unnecessary parsing through techniques like result caching and inline views.
This document discusses database management systems and SQL. It provides examples of creating tables, inserting and retrieving data using commands like SELECT, UPDATE, and DELETE. It also covers SQL sublanguages, data types, logical operators, and pattern matching operators. Key points include that a DBMS manages a database using software, SQL is the standard language used to communicate with databases, and tables are used to store data in rows and columns.
The document describes various data manipulation language (DML) commands in Oracle such as INSERT, SELECT, UPDATE, DELETE, logical operators, pattern matching, aggregate functions, and date functions. Examples are provided to demonstrate inserting, selecting, updating, deleting records from a table and using functions to analyze and retrieve data based on conditions.
This document discusses various ways to set and check the optimizer mode in Oracle at both the parameter and session level. It also provides examples of using EXPLAIN PLAN to view execution plans for different types of queries, examples of query transformations Oracle can perform, and tips for SQL performance tuning such as using appropriate data types in comparisons and minimizing functions in joins.
The document provides an overview of Data Query Language (DQL) syntax for SELECT statements including:
- Selecting columns from tables
- Using column aliases
- Filtering rows with the WHERE clause
- Working with NULL values
- Sorting results with the ORDER BY clause
- Grouping rows with the GROUP BY clause and aggregate functions
- Filtering groups with the HAVING clause
- Sorting on multiple columns
- Nested subqueries
The document provides examples of SQL statements used to create database objects like tables, users, schemas, procedures, and triggers in Oracle/PLSQL. It includes the CREATE statements to create a database, tablespace, user, schema, procedure, function, role, and trigger. It also includes examples of GRANT, REVOKE, and ALTER statements to manage privileges and roles.
The document discusses various ways that web developers can leverage database techniques to simplify and optimize data-intensive web applications. It describes database views, virtual columns, packages with stored procedures and functions, subquery factoring, pipelined functions, triggers, LDAP integration, and TCP/IP connections - all of which can be used at the database level to add value to applications and handle complex business logic and data processing close to the data for better performance.
The document discusses various SQL commands used for data manipulation:
1. The INSERT command is used to add rows to a table by specifying column values.
2. The SELECT command is used to retrieve data from one or more tables.
3. The UPDATE command modifies existing records in a table by changing column values.
4. The DELETE command removes rows from a table.
This document discusses database functions and procedures in PostgreSQL. It begins with an overview of what functions and procedures are, when and where they are used. It then covers topics like:
- The basic syntax for creating functions and procedures
- Different types of parameters like IN, OUT, INOUT
- Calling user-defined functions
- Explaining queries using functions
- Transaction handling in functions and procedures
- Aggregate and custom aggregate functions
- Triggers and when they are used
- Database partitioning for performance optimization
The document provides examples of creating and using various types of functions, procedures and triggers in PostgreSQL. It also summarizes the differences between functions and procedures.
The document provides instructions for connecting to an Oracle database and completing several labs on Oracle concepts like subqueries, indexes, data dictionary, concurrency, schema objects, and table partitioning. It includes SQL examples and steps to create views, procedures, functions, triggers, and partitioned tables using techniques like list, range, and hash partitioning. The labs cover important Oracle topics to help learn how to optimize queries, understand the database metadata, handle concurrency issues, and partition tables for improved performance.
The document provides examples of SQL commands for:
1. Selecting data from tables including top rows, random rows, joins, outer joins, and grouping.
2. Creating views and stored procedures.
3. Differences between functions and stored procedures.
4. Using triggers, cursors, and retrieving the second highest/lowest value from a column.
5. Common DDL commands like creating, copying, deleting, and altering tables.
So in summary, it covers the basics of SQL including queries, views, stored procedures, functions, triggers and DDL commands.
This document discusses various SQL functions and concepts including:
1. Single row and multiple row/aggregate functions where single row functions return one result per row and aggregate functions return one result for a group of rows. Common aggregate functions discussed are AVG, COUNT, MAX, MIN, and SUM.
2. The GROUP BY clause which combines records with the same field values and the HAVING clause which specifies conditions for grouped data.
3. Joins which combine data from multiple tables. Types discussed are Cartesian products and equi-joins.
4. SQL constraints including NOT NULL, DEFAULT, UNIQUE, and PRIMARY KEY constraints.
SQL is a language used to manage and manipulate databases. It allows users to create, update, and delete data from databases. The main components of SQL are the data query language (DQL) which is used to retrieve data, the data manipulation language (DML) which is used to insert, update and delete data, and the data definition language (DDL) which is used to define and manage database objects like tables and indexes. SQL also supports functions, joins, and other operations to help manage and analyze data in databases.
Introduction to Oracle Functions--(SQL)--Abhishek Sharmaअभिषेक शर्मा
Functions make query results easier to understand and manipulate data values. There are two categories of functions: single row/scalar functions that return one value per row, and group/aggregate functions that operate on sets of values to return a single result. The GROUP BY clause groups rows based on columns and is used with aggregate functions to return summary results for each group.
Top MNC'S Interview questions and answersMadhu Dhare
The document discusses various SQL and PL/SQL concepts:
1. It explains the differences between HAVING and WHERE clauses when used with GROUP BY. HAVING is used for aggregate conditions while WHERE can be used for any non-aggregate conditions.
2. It describes the different types of parameters in PL/SQL - IN parameters which can be referenced but not modified, OUT parameters which cannot be referenced but can be modified, and IN OUT parameters which can be both referenced and modified.
3. It outlines some key differences between value sets and lookups in Oracle - value sets can be attached to concurrent program parameters while lookups cannot, value sets are maintained by administrators while lookups can be maintained by users, etc
The document discusses various SQL statements that can be used in PL/SQL programs including SELECT, INSERT, UPDATE, DELETE, and MERGE. It provides examples of using each statement to retrieve, manipulate, and manage data in Oracle databases. The SELECT statement is used to query data, INSERT adds new rows, UPDATE modifies rows, DELETE removes rows, and MERGE can insert or update rows in a single statement. Joins and cursors are also introduced.
The document discusses the EXISTS function in SQL, which checks if the result of a correlated nested query is empty or not. It provides an example query (Q16B) that uses EXISTS to retrieve the names of employees who have a dependent with the same first name, sex, and social security number. The document also explains how EXISTS and NOT EXISTS work and provides additional example queries using these functions.
The MySQL LIKE operator is used in SELECT statements to search for a pattern within a column and works with wildcard characters. It allows finding rows that match or contain a certain substring. The % wildcard represents zero, one, or multiple characters while _ represents a single character. Some examples of LIKE queries include finding rows where a column starts with, ends with, or contains a substring.
This document discusses advanced subquery techniques in SQL, including:
1) Writing multiple-column subqueries that can perform pairwise or nonpairwise comparisons.
2) Using scalar subqueries that return a single value in more clauses and expressions.
3) Writing correlated subqueries that are executed once per row to filter or update related data.
4) Using the EXISTS operator to check for matching rows in a subquery results set.
5) Leveraging the WITH clause to reuse query blocks and improve performance of complex queries.
Functions in Oracle can be used to manipulate data values and are categorized as single-row/scalar functions and group/aggregate functions. Single-row functions operate on each row and return one value per row, while group functions operate on sets of values to return one result. The GROUP BY clause is used to group or categorize data and can be used with aggregate functions to return summary results for each group.
Oracle - Program with PL/SQL - Lession 05Thuan Nguyen
This document discusses composite data types in PL/SQL including records, INDEX BY tables, and tables of records. It provides examples of how to create each type, use the %ROWTYPE attribute to define records based on database tables, and demonstrates various methods for accessing and manipulating data in INDEX BY tables including COUNT, EXISTS, DELETE and TRIM. The key concepts covered are how to define and work with composite data structures in PL/SQL to efficiently retrieve and process sets of related data.
Introduction Oracle Database 11g Release 2 for developersLucas Jellema
"This presentations provides an overview of the most striking new functionality in Oracle Database 11g Release 2, as seen through the eyes of (database) developers. The presentation introduces new analytical functionality, the successor to the connect by clause for hierarchical queries, parallel statement execution, new packages and especially: Edition Based Redefinition. This presentation was performed (with live demos) during the AMIS Query on 29th September 2009.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
What is Master Data Management by PiLog Groupaymanquadri279
PiLog Group's Master Data Record Manager (MDRM) is a sophisticated enterprise solution designed to ensure data accuracy, consistency, and governance across various business functions. MDRM integrates advanced data management technologies to cleanse, classify, and standardize master data, thereby enhancing data quality and operational efficiency.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
What is Augmented Reality Image Trackingpavan998932
Augmented Reality (AR) Image Tracking is a technology that enables AR applications to recognize and track images in the real world, overlaying digital content onto them. This enhances the user's interaction with their environment by providing additional information and interactive elements directly tied to physical images.
Oracle Database 19c New Features for DBAs and Developers.pptx
Trig
1. Declaring an Autonomous Function in a Package
Example 6-43 Declaring an Autonomous Function in a Package
CREATE OR REPLACE PACKAGE emp_actions AS -- package specification
FUNCTION raise_salary (emp_id NUMBER, sal_raise NUMBER) RETURN NUMBER;
END emp_actions;
/
CREATE OR REPLACE PACKAGE BODY emp_actions AS -- package body
-- code for function raise_salary
FUNCTION raise_salary (emp_id NUMBER, sal_raise NUMBER) RETURN NUMBER IS
PRAGMA AUTONOMOUS_TRANSACTION;
new_sal NUMBER(8,2);
BEGIN
UPDATE employees SET salary = salary + sal_raise WHERE employee_id = emp_id;
COMMIT;
SELECT salary INTO new_sal FROM employees WHERE employee_id = emp_id;
RETURN new_sal;
END raise_salary;
END emp_actions;
/
Create GLOBAL TEMPORARY Table.
CREATE GLOBAL TEMPORARY TABLE admin_work_area
(startdate DATE,
enddate DATE,
class CHAR(20))
ON COMMIT DELETE ROWS;
Posted by Asif at 8:30 PM
CREATE TRIGGER Statement
Using Triggers:Example 9-1 CREATE TRIGGER Statement
CREATE OR REPLACE TRIGGER Print_salary_changes
BEFORE DELETE OR INSERT OR UPDATE ON emp
FOR EACH ROW
WHEN (NEW.EMPNO > 0)
DECLARE
sal_diff number;
BEGIN
sal_diff := :NEW.SAL - :OLD.SAL;
dbms_output.put('Old salary: ' || :OLD.sal);
dbms_output.put(' New salary: ' || :NEW.sal);
dbms_output.put_line(' Difference ' || sal_diff);
END;
/
2. CREATE TRIGGER -Calling a Procedure in a Trigger Body:
CREATE TRIGGER: Calling a Procedure in a Trigger Body: Example You could create
the salary_check trigger described in the preceding example by calling a procedure instead of providing
the trigger body in a PL/SQL block. Assume you have defined a procedure check_sal in the hr schema,
which verifies that an employee's salary is in an appropriate range. Then you could create the
trigger salary_check as follows:
CREATE TRIGGER salary_check
BEFORE INSERT OR UPDATE OF salary, job_id ON employees
FOR EACH ROW
WHEN (new.job_id <> 'AD_VP')
CALL check_sal(:new.job_id, :new.salary, :new.last_name)
Posted by Asif at 4:34 AM
Hierarchical Level Query Example using SYS_CONNECT_BY_PATH
SYS_CONNECT_BY_PATH: is valid only in hierarchical queries. It returns the path of a column value
from root to node, with column values separated by char for each row returned
by CONNECT BY condition.
Both column and char can be any of the datatypes CHAR, VARCHAR2, NCHAR, or NVARCHAR2.
The string returned is of VARCHAR2 datatype and is in the same character set as column.
Examples
The following example returns the path of employee names from employee Kochhar to
all employees of Kochhar (and their employees):
SELECT LPAD(' ', 2*level-1)||SYS_CONNECT_BY_PATH(last_name, '/') "Path"
FROM employees
START WITH last_name = 'Kochhar'
CONNECT BY PRIOR employee_id = manager_id;
Path
---------------------------------------------------------------
/Kochhar
/Kochhar/Greenberg
/Kochhar/Greenberg/Faviet
/Kochhar/Greenberg/Chen
/Kochhar/Greenberg/Sciarra
/Kochhar/Greenberg/Urman
/Kochhar/Greenberg/Popp
/Kochhar/Whalen
/Kochhar/Mavris
/Kochhar/Baer
/Kochhar/Higgins
/Kochhar/Higgins/Gietz
Hierarchical Queries -CONNECT_BY_ROOT Examples
Hierarchical Queries: CONNECT_BY_ROOT Examples The following example returns the last name
of each employee in department 110, each manager above that employee in the hierarchy, the number
of levels between manager and employee, and the path between the two:
SELECT last_name "Employee", CONNECT_BY_ROOT last_name "Manager",
LEVEL-1 "Pathlen", SYS_CONNECT_BY_PATH(last_name, '/') "Path"
FROM employees
WHERE LEVEL > 1 and department_id = 110
CONNECT BY PRIOR employee_id = manager_id;
3. Employee Manager Pathlen Path
--------------- ------------ ---------- -----------------------------------
Higgins Kochhar 1 /Kochhar/Higgins
Gietz Kochhar 2 /Kochhar/Higgins/Gietz
Gietz Higgins 1 /Higgins/Gietz
Higgins King 2 /King/Kochhar/Higgins
Gietz King 3 /King/Kochhar/Higgins/Gietz
Avoiding Collection Exceptions
Avoiding Collection Exceptions
In most cases, if you reference a nonexistent collection element, PL/SQL raises a predefined
exception. Consider the following example:
DECLARE
TYPE NumList IS TABLE OF NUMBER;
nums NumList; -- atomically null
BEGIN
/* Assume execution continues despite the raised exceptions. */
nums(1) := 1; -- raises COLLECTION_IS_NULL (1)
nums := NumList(1,2); -- initialize table
nums(NULL) := 3 -- raises VALUE_ERROR (2)
nums(0) := 3; -- raises SUBSCRIPT_OUTSIDE_LIMIT (3)
nums(3) := 3; -- raises SUBSCRIPT_BEYOND_COUNT (4)
nums.DELETE(1); -- delete element 1
IF nums(1) = 1 THEN ... -- raises NO_DATA_FOUND (5)
In the first case, the nested table is atomically null. In the second case, the subscript is null. In
the third case, the subscript is outside the legal range. In the fourth case, the subscript exceeds
the number of elements in the table. In the fifth case, the subscript designates a deleted
element.
The following list shows when a given exception is raised:
Collection Exception Raised when...
COLLECTION_IS_NULL
you try to operate on an atomically null collection.
NO_DATA_FOUND
a subscript designates an element that was deleted, or a nonexistent element of an associative
array.
SUBSCRIPT_BEYOND_COUNT
a subscript exceeds the number of elements in a collection.
SUBSCRIPT_OUTSIDE_LIMIT
a subscript is outside the allowed range.
4. VALUE_ERROR
a subscript is null or not convertible to the key type. This exception might occur if the key is
defined as a PLS_INTEGER range, and the subscript is outside this range.
In some cases, you can pass invalid subscripts to a method without raising an exception. For
instance, when you pass a null subscript to procedure DELETE, it does nothing. Also, you can
replace deleted elements without raising NO_DATA_FOUND, as the following example shows:
DECLARE
TYPE NumList IS TABLE OF NUMBER;
nums NumList := NumList(10,20,30); -- initialize table
BEGIN
nums.DELETE(-1); -- does not raise SUBSCRIPT_OUTSIDE_LIMIT
nums.DELETE(3); -- delete 3rd element
dbms_output.put_line(nums.COUNT); -- prints 2
nums(3) := 30; -- allowed; does not raise NO_DATA_FOUND
dbms_output.put_line(nums.COUNT); -- prints 3
END;
Posted by Asif at 1:28 AM
ORACLE-BASE - Using Ref Cursors To Return Recordsets
Using Ref Cursors To Return Recordsets
The Reference Cursor which is also called the Cursor Variables is available since Oracle 7.3 the REF
CURSOR type has been available to allow recordsets to be returned from stored procedures and functions.
Oracle 9i introduced the predefined SYS_REFCURSOR type, meaning we no longer have to define our
own REF CURSOR types. The example below uses a ref cursor to return a subset of the records in
the EMP table.
The following procedure opens a query using a SYS_REFCURSOR output parameter. Notice the cursor is
not closed in the procedure. It is up to the calling code to manage the cursor once it has been opened.
CREATE OR REPLACE
PROCEDURE get_emp_rs (p_deptno IN emp.deptno%TYPE,
p_recordset OUT SYS_REFCURSOR) AS
BEGIN
OPEN p_recordset FOR
SELECT ename,
empno,
deptno
FROM emp
WHERE deptno = p_deptno
ORDER BY ename;
END GetEmpRS;
/
The resulting cursor can be referenced from PL/SQL as follows.
5. SET SERVEROUTPUT ON SIZE 1000000
DECLARE
l_cursor SYS_REFCURSOR;
l_ename emp.ename%TYPE;
l_empno emp.empno%TYPE;
l_deptno emp.deptno%TYPE;
BEGIN
get_emp_rs (p_deptno => 30,
p_recordset => l_cursor);
LOOP
FETCH l_cursor
INTO l_ename, l_empno, l_deptno;
EXIT WHEN l_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(l_ename || ' | ' || l_empno || ' | ' || l_deptno);
END LOOP;
CLOSE l_cursor;
END;
/
Posted by
Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM -
Stack Overflow
User defined Exception with Naming and assigning the Error Code no.
1 declare
2 ex_custom EXCEPTION;
3 PRAGMA EXCEPTION_INIT( ex_custom, -20001 );
4 begin
5 raise_application_error( -20001, 'This is a custom error' );
6 exception
7 when ex_custom
8 then
9 dbms_output.put_line( sqlerrm );
10* end;
SQL> /
ORA-20001: This is a custom error
PL/SQL procedure successfully completed.
Compound Triggers , Avoid Mutating-Table Error
Using Compound Triggers to Avoid Mutating-Table Error
You can use compound triggers to avoid the mutating-table error (ORA-04091) described in Trigger
Restrictions on Mutating Tables.
Scenario: A business rule states that an employee's salary increase must not exceed 10% of the
average salary for the employee's department. This rule must be enforced by a trigger.
6. Solution: Define a compound trigger on updates of the table hr.employees, as in Example 9-4. The
state variables are initialized each time the trigger fires (even when the triggering statement is
interrupted and restarted).
Example 9-4 Compound Trigger that Avoids Mutating-Table Error
CREATE OR REPLACE TRIGGER Check_Employee_Salary_Raise
FOR UPDATE OF Salary ON Employees
COMPOUND TRIGGER
Ten_Percent CONSTANT NUMBER := 0.1;
TYPE Salaries_t IS TABLE OF Employees.Salary%TYPE;
Avg_Salaries Salaries_t;
TYPE Department_IDs_t IS TABLE OF Employees.Department_ID%TYPE;
Department_IDs Department_IDs_t;
TYPE Department_Salaries_t IS TABLE OF Employees.Salary%TYPE
INDEX BY VARCHAR2(80);
Department_Avg_Salaries Department_Salaries_t;
BEFORE STATEMENT IS
BEGIN
SELECT AVG(e.Salary), NVL(e.Department_ID, -1)
BULK COLLECT INTO Avg_Salaries, Department_IDs
FROM Employees e
GROUP BY e.Department_ID;
FOR j IN 1..Department_IDs.COUNT() LOOP
Department_Avg_Salaries(Department_IDs(j)) := Avg_Salaries(j);
END LOOP;
END BEFORE STATEMENT;
7. AFTER EACH ROW IS
BEGIN
IF :NEW.Salary - :Old.Salary >
Ten_Percent*Department_Avg_Salaries(:NEW.Department_ID)
THEN
Raise_Application_Error(-20000, 'Raise too big');
END IF;
END AFTER EACH ROW;
END Check_Employee_Salary_Raise;
Mutating Oracle triggers
Avoiding Mutating triggers
The insertto the childtable causedthe foreignkeytovalidate the dataonthe parent (whichfiredthe
trigger) causingthe insertof the childtable toresultina mutatingtable erroron the parenttable.
The Oracle mutatingtriggererroroccurs whena triggerreferencesthe table thatownsthe trigger,
resultinginthe "ORA-04091: table name ismutating,trigger/functionmaynotsee it."message.
Don't use triggers - The bestway to avoidthe mutatingtable errorisnot to use triggers. While
the object-orientedOracle provides"methods"thatare associatedwithtables,mostsavvyPL/SQL
developersavoidtriggersunlessabsolutelynecessary.
Use an "after" or "insteadof" trigger- If youmust use a trigger,it'sbestto avoidthe mutating
table errorby usingan "after"trigger,toavoidthe currency issuesassociatedwithamutatingtable. For
example,usingatrigger":afterupdate onxxx",the original update hascompletedandthe table will not
be mutating.
Re-work the trigger syntax - Dr. Hall has some greatnoteson mutatingtable errors,andoffers
otherwaysto avoidmutatingtableswith acombinationof row-levelandstatement-leveltriggers.
Use autonomous transactions - You can avoidthe mutatingtable errorby markingyourtrigger
as an autonomoustransaction,makingitindependentfromthe table thatcallsthe procedure.
At the endof the day,the mutatingtable erroris usuallythe resultof apoor applicationdesignand
mutatingtriggersshouldbe avoidedwheneverpossible.
Steve Callanhasthese notesonthe ORA-04091 error:
"Here isa problemmanydevelopersruninto:ORA-04091 table owner.table_name ismutating,
trigger/functionmaynotsee it.In manycases,the cause of thiserror isdue to code withina triggerthat
looksat or touchesthe data withinthe table the trigger isbeingcalledorinvokedfrom.
8. The reasonOracle raisesthiserror isrelatedtoone of Oracle'sprimarystrengthsasa relational
database managementsystem.The particularstrengthinquestionhere isthatof havinga read
consistentview of data.
It isworthwhile tonote thatthisORA-04091 error occurs notonlyin the "pure"database development
environment,butalsointhe Oracle toolstype of developmentenvironmentsuchasOracle SQL*Forms.
AnothersolutionreliesonusinganINSTEAD-OFtriggerinsteadof the triggeryoumeanttouse when
youreceivedthe error.Anothersolutionisactuallymore of apreventative measure,namely,usingthe
righttype of triggerforthe taskat hand.
Perhapsthe greateststrengthorutilityof anINSTEAD-OFtriggerisitsabilitytoupdate whatwould
normallyappeartobe non-updateableviews.Simpleviews(prettymuchbasedonasingle base table)
generallyare inherentlyupdateableviaDML statementsissuedagainstthe view.
However,whenaviewbecomesmore complex (multiple tablesorviewsusedinvariousjoinconditions
to create the newsingle view),there isagoodchance that many columns,asreferencedbythe view,
lose their"updateable-ness."
So,beingthe data dictionaryview/tablename triviawizardthat youare,youknow to querythe
XXX_UPDATABLE_COLUMNSviews,substitutingUSER,ALL or DBA for XXXas applicable.
There are exceptionstothisrule aboutviewsbeinginherentlyupdateable.The exceptions(or
restrictions) include viewsthatuse aggregate functions;groupfunctions;use of the DISTINCTkeyword;
use of GROUP BY, CONNECTBY or STARTWITH clauses;anduse of some joins.Inmanycases,use of the
INSTEAD-OFtriggerfeature allowsyoutoworkaroundthese restrictions.
INSTEAD-OFtriggersare alsouseful forFormsdevelopersbecause formsare commonlybasedonviews.
The INSTEAD-OFtrigger,beinga"real"trigger,andnot a true form trigger,isstoredonthe server."