PL/SQL Block structure
|
|
- Dana Lawrence
- 5 years ago
- Views:
Transcription
1 PL/SQL
2 Introduction Disadvantage of SQL: 1. SQL does t have any procedural capabilities. SQL does t provide the programming technique of conditional checking, looping and branching that is vital for data testing before storage. 2. SQL statements are passed to oracle engine one at time. Each time an SQL statements is executed, a call is made to the engine s resources. This adds to the traffic on the network, thereby decreasing the speed of data processing, especially in a multi-user environment. 3. While processing an SQL sentence if an error occurs, the oracle engine displays its own error messages. SQL has no facility for programmed handling of errors that arise during manipulation of data.
3 SQL is a very powerful tool but it is t a fully structured programming language, but oracle provides a fully structured programming language with the help of PL/SQL. PL/SQL is super set of SQL. PL/SQL is a fully structured language that enable developers to combine the power of SQL with the procedural statements. Advantages of PL/SQL: 1. PL/SQL is development tool that not only supports SQL data manipulation but also provides facilities of conditional, branching and looping. 2. PL/SQL sends an entire block of statements to the oracle engine at one time. This is in turn reduces network traffic. 3. PL/SQL also permits dealing with errors as required and facilities displaying user-friendly messages, when errors are encountered. 4. PL/SQL allows declaration and use of variables in blocks of code.
4 5. Via PL/SQL, all sorts of calculation can be done quickly and efficiently without the use of the oracle engine. This improves transaction performance. 6. Applications written in PL/SQL are portable to any computer hardware and operating system, where oracle is operational. PL/SQL Block structure DECLARE Declaration of memory variables, constants, cursors, etc. in PL/SQL BEGIN SQL executable statements PL/SQL executable statements EXCEPTION SQL or PL/SQL code to handle errors that may arise during the execution of the code block END;
5 The PL/SQL Execution Environment Oracle Engine DECLARE Procedural Statement BEGIN Procedural Statement SQL statement EXCEPTION SQL statement END; PL/SQL Engine SQL Statement Executor
6 Displaying user messages on the screen Programming tools require a method through which messages can be displayed to the user on the VDU screen. DBMS_OUTPUT is a package that includes a number of procedure and functions that accumulate information in a buffer so that it can be retrieved later. These functions can also be used to display messages to the user. PUT_LINE put a piece of information in the package buffer followed by an end-of-line marker. It can also be used to display message to the user. put_line expects a single parameter of character data type. To display message to the user the SERVEROUTPUT should be set to ON. SERVEROUTPT is a SQL*PLUS environment parameter that displays the information passed as a parameter to the PUT_LINE function. Syntax: SET SERVEROUTPUT [ON/OFF]
7 Comments: 1. double hypen (--) 2. /* */ Conditional control in PL/SQL: Syntax: IF <condition> THEN <action> ELSIF <condition> THEN <action> ELSE <action> END IF;
8 While Loop: For Loop: Syntax: WHILE <condition> LOOP <action> END LOOP; Syntax: FOR variable IN [REVERSE] start.end LOOP <action> END LOOP;
9 The GOTO Statement: change the flow of control within a PL/SQL block. Syntax: GOTO <codeblock name>;
10 Transaction: A series of one or more SQL statements that are logically related or a series of operation performed on oracle table data is termed as a Transaction. Oracle treat this unit as a single entity. Oracle treats changes to table data as a two-step process. First, the changes requested are done. Second, To make this changes permanent a COMMIT statements has to be given at the SQL prompt, or, A ROLLBACK statement given at the SQL prompt can be used to undo a part of or the entire transaction. A transaction can be closed by using either a commit or a rollback statement. By using these statements, table data can be changed or all the changes made to the table data undo
11 COMMIT: A commit end the current transaction and makes permanent any changes made during the transaction. All transaction lock acquired on tables are released. Syntax: ROLLBACK: COMMIT; A rollback does exactly the opposite of commit. It ends the transaction but undoes any changes made during the transaction. All transaction lock acquired on tables are released. Syntax: Where, Work: ROLLBACK [WORK] [TO [SAVEPOINT] savepoint] Is optional and is provided for ANSI compatibility.
12 SAVEPOINT: Is optional and is used to rollback a partial transaction, as far as the specified savepoint. savepoint: Creating Savepoint: is a savepoint created during the current transaction. Savepoint marks and saves the current point in the processing of transaction. When savepoint is used with rollback statement, parts of transaction can be undone. An active savepoint is one that is specified since the las COMMIT or ROLLBACK. Syntax: SAVEPOINT savepointname;
13 Rollback can be fired from the SQL prompt with or without the SAVEPOINT clause. Rollback Operation performed without the SAVEPOINT clause: Ends the transaction. Undoes all the changes in the current transaction. Erase all the savepoint in that transaction. Release the transaction locks. Rollback Operation performed with the SAVEPOINT clause: A predetermine portion of the transaction is rolled back. Retains the savepoint roll back to, but loses those created after the named savepoint. Release all transaction lock that were acquired since the savepoint was taken.
14 Concurrency Control In Oracle: Oracle work on a multi-user platform, it is more than likely that several people will access data either for viewing or for manipulating from the same tables at the same time via different SQL statements. Tables contain valuable data on which business decisions are based. Therefore, we need to ensure the integrity of data in a table is maintained each time that its data is accessed. The oracle engine has allow simultaneous access to table data without causing damage to the data. The technique employed by oracle engine to protect table data when several people are accessing it is called concurrency control. Oracle uses method called locking to implement concurrency control when multiple users access a table to manipulate its data at the same time.
15 LOCKS: Locks are mechanism used to ensure data integrity while allowing maximum concurrent access to data. Oracle engine automatically locks table data while executing SQL statement. This type of locking is called Implicit Locking. Implicit Locking: The oracle engine has fully automatic locking strategy, it has to decide on two issue: - Type of lock to be applied - Level of lock to be applied --Type of Locks: Type of lock to be placed on a resource depends on the operation being performed on that resource. Operation on tables can be distinctly grouped into two categories: Read Operation: SELECT statements Write Operation: INSERT, UPDATE, DELETE statements
16 Read operation make no changes to data in a table and are meant only for viewing purposes, simultaneous read operation can be performed on a table without any danger to the table s data. Hence, oracle engine places a shared lock on a table when its data is being used. On the other hand write operation can cause the change in a table data. E.g insert, update, delete statement affect table data directly and data integrity. Hence Oracle engine place an Exclusive lock on a table or a specific section of table resources when data is being written to a table.
17 Two types of locks supported by oracle are: Shared locks: Shared locks are placed on resource whenever a read operation is performed. Multiple shred locks can be simultaneously set on a resource. Exclusive locks: Exclusive locks are placed on resources whenever a write operation is performed. Only on exclusive lock can be placed on a resource at a time, e.g the first user who acquires an exclusive lock will continue to have the sole ownership of the resource, and no other user can acquire an exclusive lock on that resource. Data being changed can not read.
18 -- Levels of locks: Oracle provides the following three levels of locking: Row Level Page Level Table Level The oracle engine decides on the level to be used by the presence or absence of a where condition in the SQL sentence. -- If the where clause evaluates to only one row in the table, a row level lock is used. -- If the where clause evaluates to a set of data, a page level lock is used. -- If there is no WHERE clause, a table level lock is used.
19 Explicit Locking: The technique of lock taken on a table or its resources by a user is called explicit locking. User can lock tables they own or any tables on which they have been granted table privileges ( such as select, insert, update, delete) Oracle provides facilities by which the default locking strategy can be overridden. Table(s) or Row(s) can be explicitly locked by using either the select..for update statement, or lock table statement. The Select.For Update statement: It is used for acquiring exclusive row level locks in anticipating of performing updates on records. This clause is generally used to signal the oracle engine that data currently being used needs to be updated. It is often followed by one or more update statements with a where clause.
20 Example: Client A fires the following select statement Client A> SELECT * FROM sale_order WHERE order_no= O00001 FOR UPDATE When the above select statement is fired, the oracle engine locks the record O This lock is released when a commit or rollbacl is fired by client A. If Client B fires a select statement which points to record O00001, which has already been locked by Client A. Client B> SELECT * FROM sale_order WHERE order_no= O00001 FOR UPDATE The oracle engine will ensure that client B s SQL statement wits for the lock to be released on sales_order by a commit or rollback statement fired by Client A forever. In Order to avoid unnecessary waiting time, a NOWAIT optin can be used to inform the oracle engine to terminate the SQL statement if the record has already been locked. If this happen the oracle engine terminates the running DML and comes up with a message indicating that the resource is busy.
21 Client B> SELECT * FROM sale_order WHERE order_no= O00001 FOR UPDATE NOWAIT; Since Client A has already locked the record O00001 when client B tries to acquire a shared lock on the same record the oracle engine displays the following message: SQL>00054: resource busy and acquire with nowait specified. The select.. For update cannot be used with the following: Distinct and the group by clause Set operators and group functions.
22 Using Lock table statement: To manually override oracle s default locking strategy by creating a data lock in a specific mode. Syntax: where, LOCK TABLE tablename [,tablename]. IN {ROW SHARE ROW EXCLUSIVE SHARE UPDATE SHARE SHARE ROW EXCLUSIVE EXCLUSIVE} {NOWAIT} tablename: indicates the name of tables, views to be locked. In case of views, the lock is placed on underlying tables. IN :decide what other locks on the same resource can exist simultaneously. For example, if there is exclusive lock on the table no user can update rows in the table. It can have any of the following values:
23 Exclusive: They allow query on the locked resource but prohibit any other activity. Share: It allows queries but prohibits updates to a table. Row Exclusive: Row exclusive locks are the same as row share locks, also prohibit locking in shared mode. These locks are acquired when updating, inserting, or deleting. Share Row Exclusive: They are used to look at a whole table, to selective updates and to allow other users to look at rows in the table but not lock the table in share mode or to update rows. NOWAIT: Indicates that the oracle engine should immediately return to the user with a message, if the resources are busy. If omitted, the oracle engine will wait till resources are available forever. For Example, LOCK TABLE emp IN exclusive mode NOWAIT;
24 Processing A PL/SQL Block Whenever an SQL statements is executed, oracle engine performs the following tasks: Reserves a private SQL area in memory Populates this area with the data requested in the SQL sentence. Processes the data in this memory area as required. Frees the memory area when the processing of data is completed. A PL/SQL block can be run in one of he following modes: Batch processing wherein records are gathered in a table and at regular intervals manipulated. Real Time processing wherein records are manipulated as they are created. Batch Processing is a PL/SQL block run at the SQL prompt at regular interval to process table data. A technique that oracle provides for manipulating table data in batch processing mode is the use of cursors.
25 Cursor: The oracle engine uses a work area for its internal processing in order to execute an SQL statement. This work area is private to SQL s operations and is called a cursor. The data store in the cursor is called as Active Data Set. The size of the cursor in memory is the size required to hold the number of rows in the active data set. The actual size is determined by the oracle engine s built in memory management capabilities and the amount of RAM available. When the cursor is loaded with multiple rows via query the oracle engine opens and maintains a row pointer. Depending on user requests to view data the row pointer will be relocated within the cursor s active data set. Additionally oracle also maintain multiple cursor variables. The values held in these variables indicate the status of the processing being done by the cursor.
26 Types Of Cursor: Cursors are classified depending on which they are opened. If the oracle engine for its internal processing has opened a cursor they are known as Implicit Cursors. A user can also open a cursor for processing data as required, such a user-defined cursors are known as Explicit Cursor. When oracle engine creates an implicit or explicit cursor, cursor control variables are also created to control the execution of the cursor. Whenever cursor is opened and used, the oracle engine creates a set of four system variables which keep track of the current status of a cursor These cursor variables can be accessed and used in a PL/SQL code block. Both Implicit and Explicit cursors have four attributes and they are:
27 Attribute Name %ISOPEN %FOUND %NOTFOUND %ROWCOUNT Description Return TRUE if cursor is open. FALSE otherwise. SQL%ISOPEN attribute of an implicit cursor cannot be referenced outside of its SQL statement. As a result, SQL%ISOPEN always evaluates to FALSE. Return TRUE if records fetched successfully otherwise FALSE. Syntax: SQL%FOUND Return TRUE if record was not fetched successfully. otherwise FALSE. Syntax: SQL%NOTFOUND Returns number of records processed from the cursor. Syntax: SQL%ROWCOUNT
28 Explicit Cursor: When individual records in a table have to be processed inside a PL/SQL code block a cursor is used. This cursor will be declared and mapped to a SQL query in the declared section of the PL/SQL block and used within the executable section. Thus, a cursor is created and used is know as a Explicit Cursor. Explicit Cursor Management: The step involved in using an explicit cursor and manipulating data in its active set are: Declared a cursor mapped to a SQL select statement that retrieves data for processing. Open the cursor Fetch data from the cursor one row at a time into memory variables. Process the data held in memory variables as required using a loop. Exit from the loop after processing is complete. Close The cursor
29 Cursor Declaration: A cursor is defined in the declarative part of a PL/SQL block. Syntax: CURSOR cursorname IS SQL Select statement; When a cursor is declared, the oracle engine is informed that a cursor of the said name needs to be opened. The declaration is only an intimation. There is no memory allocation at this point in time. The three command used to control the cursor subsequently are open, fetch and close. The Functionality of Open, Fetch, and Close: Initialization of a cursor takes place via the open statement, This define a private SQL area named after the cursor name, and execute the query and create a active data set that contain all the rows, which meet the query search criteria.
30 Syntax: OPEN cursorname A fetch statement then moves the data held in the active data set into memory variable data held in the memory variables can be processed as desired. The fetch statement is placed inside the loop..end loop construct, which cause the data to be fetch one row at a time and processed until all the rows in the active data set are processed. Syntax: FECTH cursorname INTO varable1, variable2..; Note: There must be memory variable for each column value of the active data set. Data types must match. These variable will be declared in the DECLARED section of the PL/SQL block.
31 After the fetch loop exist, the cursor must be closed with the close statement. This will release the memory occupied by the cursor and its active data set. Syntax: CLOSE cursorname; Explicit Cursor Attributes: Similar to the cursor attribute in case of implicit cursors, for attributes are associated with explicit cursor.
32 Cursor For Loops: Another technique commonly used to control the LOOP End Loop within a PL/SQL block is the FOR variable IN value construct. Syntax: FOR memory variable IN cursorname Here, the verb FOR automatically creates the memory variable of the %rowtype. Each record in the opened cursor becomes a value for the memory variable of the %rowtype. The FOR verb ensures that a row from the cursor is loaded in the declared memory variable and the loop execute once. This goes on until all the rows of the cursor have been loaded into memory variable. After this the loop stop. A cursor for loop automatically does the following : Implicitly declares its loop index as a %rowtype record. Open a cursor Fetch a row from the cursor for each loop iteration. Closes the cursor when all rows have been processed.
33 Parameterized Cursors: Till now all the cursor that have been declared and used fetch a predetermine set of records. Records which satisfy condition of the select statement mapped to the cursor, means the criteria on which the active data set is determined is hard coded and never changes. commercial application require that the query, which, defines the cursor, be generic and the data that is retrieved from the table be allowed to change according to the need. oracle recognized this and permits the creation of a parameterized cursor, hence the contents of the opened cursor will constantly change depending upon a value passed. since the cursor accepts values or parameters it is called as a parameterized cursor. The parameters can be either a constant or a variable.
34 Declaring a Parameterized Cursor: Syntax: CURSOR cursor_name(variable_name datatpe) IS <SELECT statement..> Opening a Parameterized Cursor: Syntax: OPEN cursor_name(value/variable/expression)
35 Exception Handling: While executing the SQL sentence anything can go wrong and the SQL sentence fail the oracle engine is the first to recognize this as an Exception Condition. The Oracle engine immediately tries to handle the exception condition and resolve it. This is done by raising a built-in Exception Handler. Exception handler is nothing but a code of block in memory that will attempt to resolve the current exception condition. These exception handler are identified not by names but by four integer preceded by hyphen e.g These exception handler names are actually a set of negative signed integers. Each exception handler, irrespective of how it is identified (by name or number) has code attached that will attempt to resolve an exception condition. By this way oracle s default exception-handling work.
36 We can handle our exception in our block with the help of defining explicit exception in block, at that time oracle s default exception handling code will be override and oracle s default exception handling code is not executed but the code block that takes care of the exception condition in the exception section of the block is executed. Oracle engine s exception handler must establish whether to execute its own exception handling code or whether it has to execute user defined exception handling code. How oracle engine handle exception As soon as the oracle engine invokes an exception handler the exception handler goes back to the PL/SQL block from which the exception condition was raised. The exception handler scans the PL//SQL block for the existence of an exception section within the PL/SQL block. If an exception section within the PL/SQL block exists the exception handler scan the first word, after the action word when, within the exception section.
37 If the first word after the action word when is the exception handler s name then the exception handler executes the code contained in the then section of the construct as follows: Exception When {Exception Name} Then {User defined action to be carried out} Oracle s Named Exception Handlers The oracle engine has a set of pre-defined oracle error handlers called Named Exceptions. These error handlers are referenced by their name. The following are some of the pre-defined oracle named exception handlers: 1. DUP_VAL_ON_INDEX: Raised when an insert or update attempts to create two rows with duplicate values in columns constrained by a unique index. 2. LOGIN_DENIED: Raised when an invalid username/password was used to log onto oracle.
38 3.NO_DATA_FOUND: 4.NOT_LOGGED_ON: Raised when a select statement returns zero rows. Raised when PL/SQL issues an oracle call without being logged onto oracle. 5.PROGRAM_ERROR: Raised when PL/SQL has an internal problem. 6.TIMEOUT_ON_RESOURCE: Raised when oracle has been waiting to access a resource beyond the user defined timeout limit. 7.TOO_MANY_ROWS: 8.VALUE_ERROR: 9.OTHERS: Raised when a select statement returns more than one row. Raised when the data type or data size is invalid. Stands for all other exception not explicitly named.
39 User-Named Exception Handlers: The technique that is used is to bind a numbered exception handler to a name using Pragma Exception_init(), This binding is done in Declare Section. All object declare section of a PL/SQL block are not created until actually required within the PL/SQL block. However, the binding of a numbered exception handler to a name must be done exactly when declared not when the exception handler is invoked due to an exception condition. Syntax: DECLARE exception_name EXCEPTION; PRAGMA EXCEPTION_INIT(excepion_name, error_code_no);
40 The Pragma action word is a call to a pre-compiler, which immediately binds the numbered exception handler to a name when encountered. The function Exception_init() takes two parameters the first is the user defined exception name the second is the oracle engine s exception number. User Defined Exception Handling For Business Rule Validation: To trap business rules being violated the technique of raising userdefined exception and then handling them is used. All the business rule exception are completely transparent to the oracle engine and hence the skill of translating a business rule into appropriate PL/SQL user-defined exception handling code is vital to a programmer. User-defined error condition must be declared in the declarative part of any PL/SQL block. In the executable part, a check for the condition that needs special attention is made. If that exists, the call to the user defined exception is made using a RAISE statement. The exception once raised is then handled in the exception handling section of the PL/SQL code block.
41 Syntax: DECLARE <Exceptionname> Exception BEGIN SQL sentence; IF <condition> THEN RAISE <Exceptionname>; END IF; EXCEPTION WHEN <Exceptionname> THEN {User defined action to be taken}; END;
42
ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.
1 PL/SQL INTRODUCTION SQL does not have procedural capabilities. SQL does not provide the programming techniques of condition checking, looping and branching that is required for data before permanent
More informationRDBMS - PL SQL - Topic 5 - MSBTE QUESTIONS AND ANSWERS
RDBMS - PL SQL - Topic 5 - MSBTE QUESTIONS AND ANSWERS SUMMER 2017 Q. Describe Exception handling. Explain with example. 4 Marks Exception Handling: Exception is nothing but an error. Exception can be
More informationQuestion: Which statement would you use to invoke a stored procedure in isql*plus?
What are the two types of subprograms? procedure and function Which statement would you use to invoke a stored procedure in isql*plus? EXECUTE Which SQL statement allows a privileged user to assign privileges
More informationUNIT II PL / SQL AND TRIGGERS
UNIT II PL / SQL AND 1 TRIGGERS TOPIC TO BE COVERED.. 2.1 Basics of PL / SQL 2.2 Datatypes 2.3 Advantages 2.4 Control Structures : Conditional, Iterative, Sequential 2.5 Exceptions: Predefined Exceptions,User
More informationIntroduction to Computer Science and Business
Introduction to Computer Science and Business The Database Programming with PL/SQL course introduces students to the procedural language used to extend SQL in a programatic manner. This course outline
More informationPLSQL 9i Index. Section Title Page
One PLSQL Introduction 2 Procedural Language for SQL 3 Two PLSQL Structure 5 Basic Structure of PLSQL 6 The Declaration Section in PLSQL 7 Local Variables in PLSQL 8 Naming Local Variables in PLSQL 10
More informationINDEX. 1 Introduction. 2 Types of Cursors 2.1 Explicit cursor 2.2 Attributes 2.3 Implicit cursor 2.4 Attributes. 3 Parameterized cursor
INDEX 1 Introduction 2 Types of Cursors 2.1 Explicit cursor 2.2 Attributes 2.3 Implicit cursor 2.4 Attributes 3 Parameterized cursor INTRODUCTION what is cursor? we have seen how oracle executes an SQL
More informationPL/SQL is a combination of SQL along with the procedural features of programming languages.
(24 Marks) 5.1 What is PLSQL? PLSQL stands for Procedural Language extension of SQL. PLSQL is a combination of SQL along with the procedural features of programming languages. It was developed by Oracle
More informationPLSQL Interview Questions :
PLSQL Interview Questions : In my previous articles I have explained the SQL interview questions,bi Interview questions which will give the best idea about the question that may ask in interview.in this
More information1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL
CertBus.com 1Z0-144 Q&As Oracle Database 11g: Program with PL/ SQL Pass Oracle 1Z0-144 Exam with 100% Guarantee Free Download Real Questions & Answers PDF and VCE file from: 100% Passing Guarantee 100%
More information5. Single-row function
1. 2. Introduction Oracle 11g Oracle 11g Application Server Oracle database Relational and Object Relational Database Management system Oracle internet platform System Development Life cycle 3. Writing
More informationSlides by: Ms. Shree Jaswal
Slides by: Ms. Shree Jaswal A trigger is a statement that is executed automatically by the system as a side effect of a modification to the database. To design a trigger mechanism, we must: Specify the
More informationSisteme Informatice şi Standarde Deschise (SISD) Curs 7 Standarde pentru programarea bazelor de date (1)
Administrarea Bazelor de Date Managementul în Tehnologia Informaţiei Sisteme Informatice şi Standarde Deschise (SISD) 2009-2010 Curs 7 Standarde pentru programarea bazelor de date (1) 23.11.2009 Sisteme
More informationORACLE: PL/SQL Programming
%ROWTYPE Attribute... 4:23 %ROWTYPE... 2:6 %TYPE... 2:6 %TYPE Attribute... 4:22 A Actual Parameters... 9:7 Actual versus Formal Parameters... 9:7 Aliases... 8:10 Anonymous Blocks... 3:1 Assigning Collection
More informationOracle Database 11g: Program with PL/SQL Release 2
Oracle University Contact Us: +41- (0) 56 483 31 31 Oracle Database 11g: Program with PL/SQL Release 2 Duration: 5 Days What you will learn This course introduces students to PL/SQL and helps them understand
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL Trapping Oracle Server Exceptions 1 Copyright 2013, Oracle and/or its affiliates. All rights Objectives This lesson covers the following objectives: Describe and provide
More informationQuestion Bank PL/SQL Fundamentals-I
Question Bank PL/SQL Fundamentals-I UNIT-I Fundamentals of PL SQL Introduction to SQL Developer, Introduction to PL/SQL, PL/SQL Overview, Benefits of PL/SQL, Subprograms, Overview of the Types of PL/SQL
More informationOracle Database 11g: SQL and PL/SQL Fundamentals
Oracle University Contact Us: +33 (0) 1 57 60 20 81 Oracle Database 11g: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn In this course, students learn the fundamentals of SQL and PL/SQL
More informationContents I Introduction 1 Introduction to PL/SQL iii
Contents I Introduction Lesson Objectives I-2 Course Objectives I-3 Human Resources (HR) Schema for This Course I-4 Course Agenda I-5 Class Account Information I-6 Appendixes Used in This Course I-7 PL/SQL
More informationTable of Contents. PDF created with FinePrint pdffactory Pro trial version
Table of Contents Course Description The SQL Course covers relational database principles and Oracle concepts, writing basic SQL statements, restricting and sorting data, and using single-row functions.
More informationSQL Interview Questions
SQL Interview Questions SQL stands for Structured Query Language. It is used as a programming language for querying Relational Database Management Systems. In this tutorial, we shall go through the basic
More informationUNIT 2 Set Operators
Course Title: Database Systems ( M.C.A 1 st Semester ) (Evening Batch) UNIT 2 Set Operators Set operators are used to join the results of two (or more) SELECT statements.the SET operators available in
More informationTable of Contents. Oracle SQL PL/SQL Training Courses
Table of Contents Overview... 7 About DBA University, Inc.... 7 Eligibility... 8 Pricing... 8 Course Topics... 8 Relational database design... 8 1.1. Computer Database Concepts... 9 1.2. Relational Database
More informationUNIT-IV (Relational Database Language, PL/SQL)
UNIT-IV (Relational Database Language, PL/SQL) Section-A (2 Marks) Important questions 1. Define (i) Primary Key (ii) Foreign Key (iii) unique key. (i)primary key:a primary key can consist of one or more
More informationProcedural Language Structured Query Language (PL/SQL)
The Islamic University of Gaza Faculty of Engineering Dept. of Computer Engineering Database Lab (ECOM 4113) Lab 7 Procedural Language Structured Query Language (PL/SQL) Eng. Ibraheem Lubbad Structured
More informationProgramming in Oracle with PL/SQL. Procedural Language Extension to SQL
Programming in Oracle with PL/SQL Procedural Language Extension to SQL PL/SQL Allows using general programming tools with SQL, for example: loops, conditions, functions, etc. This allows a lot more freedom
More informationOracle Database: Program with PL/SQL
Oracle University Contact Us: + 420 2 2143 8459 Oracle Database: Program with PL/SQL Duration: 5 Days What you will learn This Oracle Database: Program with PL/SQL training starts with an introduction
More informationOracle Database 12c: Program with PL/SQL Duration: 5 Days Method: Instructor-Led
Oracle Database 12c: Program with PL/SQL Duration: 5 Days Method: Instructor-Led Course Description This training starts with an introduction to PL/SQL and then explores the benefits of this powerful programming
More informationOracle Database: Program with PL/SQL Ed 2
Oracle University Contact Us: +38 61 5888 820 Oracle Database: Program with PL/SQL Ed 2 Duration: 5 Days What you will learn This Oracle Database: Program with PL/SQL training starts with an introduction
More informationPL/SQL. Exception. When the PL/SQL engine cannot execute the PLSQL block it raise an error. Every Oracle error has an error number
PL/SQL Exception When the PL/SQL engine cannot execute the PLSQL block it raise an error. Every Oracle error has an error number Exceptions must be handled by name. PL/SQL predefines some common Oracle
More informationOracle Database 12c R2: Program with PL/SQL Ed 2 Duration: 5 Days
Oracle Database 12c R2: Program with PL/SQL Ed 2 Duration: 5 Days This Database Program with PL/SQL training shows you how to develop stored procedures, functions, packages and database triggers. You'll
More informationPROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)
Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 6 Database Programming PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) AGENDA 8. Using Declarative SQL in Procedural SQL
More informationOracle Database: Introduction to SQL/PLSQL Accelerated
Oracle University Contact Us: Landline: +91 80 67863899 Toll Free: 0008004401672 Oracle Database: Introduction to SQL/PLSQL Accelerated Duration: 5 Days What you will learn This Introduction to SQL/PLSQL
More informationConditionally control code flow (loops, control structures). Create stored procedures and functions.
TEMARIO Oracle Database: Program with PL/SQL Ed 2 Duration: 5 Days What you will learn This Oracle Database: Program with PL/SQL training starts with an introduction to PL/SQL and then explores the benefits
More informationUnit 1 - Advanced SQL
Unit 1 - Advanced SQL This chapter describes three important aspects of the relational database management system Transactional Control, Data Control and Locks (Concurrent Access). Transactional Control
More informationIntroduction to SQL/PLSQL Accelerated Ed 2
Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Introduction to SQL/PLSQL Accelerated Ed 2 Duration: 5 Days What you will learn This Introduction to SQL/PLSQL Accelerated course
More informationTopics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia
Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia 1. Creating a Database Alias 2. Introduction to SQL Relational Database Concept Definition of Relational Database
More informationLecture 08. Spring 2018 Borough of Manhattan Community College
Lecture 08 Spring 2018 Borough of Manhattan Community College 1 The SQL Programming Language Recent versions of the SQL standard allow SQL to be embedded in high-level programming languages to help develop
More informationOracle Database: SQL and PL/SQL Fundamentals NEW
Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the fundamentals of SQL and PL/SQL along with the
More informationOracle PLSQL Training Syllabus
Oracle PLSQL Training Syllabus Introduction Course Objectives Course Agenda Human Resources (HR) Schema Introduction to SQL Developer Introduction to PL/SQL PL/SQL Overview Benefits of PL/SQL Subprograms
More informationIZ0-144Oracle 11g PL/SQL Certification (OCA) training
IZ0-144Oracle 11g PL/SQL Certification (OCA) training Advanced topics covered in this course: Managing Dependencies of PL/SQL Objects Direct and Indirect Dependencies Using the PL/SQL Compiler Conditional
More information2. Programming written ( main theme is to test our data structure knowledge, proficiency
ORACLE Job Placement Paper Paper Type : General - other 1. Tech + Aptitude written 2. Programming written ( main theme is to test our data structure knowledge, proficiency sorting searching algorithms
More informationOracle - Oracle Database: Program with PL/SQL Ed 2
Oracle - Oracle Database: Program with PL/SQL Ed 2 Code: Lengt h: URL: DB-PLSQL 5 days View Online This Oracle Database: Program with PL/SQL training starts with an introduction to PL/SQL and then explores
More informationORACLE Job Placement Paper. Paper Type : General - other
ORACLE Job Placement Paper Paper Type : General - other 1. Tech + Aptitude written 2. Programming written ( main theme is to test our data structure knowledge, proficiency sorting searching algorithms
More informationOracle Database: SQL and PL/SQL Fundamentals Ed 2
Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Oracle Database: SQL and PL/SQL Fundamentals Ed 2 Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals
More informationORACLE TRAINING. ORACLE Training Course syllabus ORACLE SQL ORACLE PLSQL. Oracle SQL Training Syllabus
ORACLE TRAINING ORACLE Training Course syllabus ORACLE SQL ORACLE PLSQL Oracle SQL Training Syllabus Introduction to Oracle Database List the features of Oracle Database 11g Discuss the basic design, theoretical,
More informationINTRODUCTION TO DATABASE
1 INTRODUCTION TO DATABASE DATA: Data is a collection of raw facts and figures and is represented in alphabets, digits and special characters format. It is not significant to a business. Data are atomic
More informationLesson B Objectives IF/THEN. Chapter 4B: More Advanced PL/SQL Programming
Chapter 4B: More Advanced PL/SQL Programming Monday 2/23/2015 Abdou Illia MIS 4200 - Spring 2015 Lesson B Objectives After completing this lesson, you should be able to: Create PL/SQL decision control
More informationM.C.A. (CBCS) Sem.-III Examination November-2013 CCA-3004 : Database Concepts and Tools. Faculty Code: 003 Subject Code:
003-007304 M.C.A. (CBCS) Sem.-III Examination November-2013 CCA-3004 : Database Concepts and Tools Faculty Code: 003 Subject Code: 007304 Time: 21/2 Hours] [Total Marks: 70 I. Answer the following multiple
More informationOracle Database 11g & PL/SQL
Oracle Database 11g & PL/SQL 2 Day Developer's Guide Overview and Examples Marcelo Vinícius Cysneiros Aragão marcelovca90@inatel.br Topics 1. Topics 2. Connecting to Oracle Database and Exploring It 3.
More informationChapter 2. DB2 concepts
4960ch02qxd 10/6/2000 7:20 AM Page 37 DB2 concepts Chapter 2 Structured query language 38 DB2 data structures 40 Enforcing business rules 49 DB2 system structures 52 Application processes and transactions
More informationSection I : Section II : Question 1. Question 2. Question 3.
Computer Science, 60-415 Midterm Examiner: Ritu Chaturvedi Date: Oct. 27 th, 2011 Student Name: Student Number: INSTRUCTIONS (Please Read Carefully) Examination Period is 1 hour and 15 minutes Answer all
More informationOracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL]
Chapter Overview of PL/SQL Programs Control Statements Using Loops within PLSQL Oracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL] Table of Contents Describe a PL/SQL program construct List the
More informationDatabase Programming with SQL
Database Programming with SQL 18-1 Objectives In this lesson, you will learn to: Define the terms COMMIT, ROLLBACK, and SAVEPOINT as they relate to data transactions List three advantages of the COMMIT,
More informationOracle Database 11g: Program with PL/SQL
Oracle University Contact: +31 (0)30 669 9244 Oracle Database 11g: Program with PL/SQL Duration: 5 Dagen What you will learn This course introduces students to PL/SQL and helps them understand the benefits
More informationM.SC(IT) I YEAR( ) CORE: ADVANCED DBMS-163B Semester : I Multiple Choice Questions
M.SC(IT) I YEAR(2017-2019) CORE: ADVANCED DBMS-163B Semester : I Multiple Choice Questions 1) storage lose contents when power is switched off. a) Volatile storage. b) Nonvolatile storage. c) Disk storage.
More informationSQL IN PL/SQL. In this chapter, you will learn about: Making Use of DML in PL/SQL Page 68 Making Use of Savepoint Page 77
CHAPTER 4 SQL IN PL/SQL CHAPTER OBJECTIVES In this chapter, you will learn about: Making Use of DML in PL/SQL Page 68 Making Use of Savepoint Page 77 This chapter is a collection of some fundamental elements
More informationOracle12c Release 1 PL/SQL (3 Days)
Oracle12c Release 1 PL/SQL (3 Days) www.peaklearningllc.com Course Description This course provides a complete, hands-on, comprehensive introduction to PL/SQL including the use of both SQL Developer and
More informationWhen a database trigger routine does not have to take place before the triggering event, which timing should you assign to the trigger?
Page 1 of 80 Item: 1 (Ref:1z0-147e.9.2.4) When a database trigger routine does not have to take place before the triggering event, which timing should you assign to the trigger? nmlkj ON nmlkj OFF nmlkj
More informationIntroduction to Explicit Cursors. Copyright 2008, Oracle. All rights reserved.
Introduction to Explicit Cursors Introduction to Explicit Cursors 2 What Will I Learn? In this lesson, you will learn to: Distinguish between an implicit and an explicit cursor Describe why and when to
More informationSQL+PL/SQL. Introduction to SQL
SQL+PL/SQL CURRICULUM Introduction to SQL Introduction to Oracle Database List the features of Oracle Database 12c Discuss the basic design, theoretical, and physical aspects of a relational database Categorize
More informationOracle Developer Track Course Contents. Mr. Sandeep M Shinde. Oracle Application Techno-Functional Consultant
Oracle Developer Track Course Contents Sandeep M Shinde Oracle Application Techno-Functional Consultant 16 Years MNC Experience in India and USA Trainer Experience Summary:- Sandeep M Shinde is having
More informationActual4Test. Actual4test - actual test exam dumps-pass for IT exams
Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z0-144 Title : Oracle Database 11g: Program with PL/SQL Vendor : Oracle Version : DEMO Get Latest &
More informationOracle PLSQL. Course Summary. Duration. Objectives
Oracle PLSQL Course Summary Use conditional compilation to customize the functionality in a PL/SQL application without removing any source code Design PL/SQL packages to group related constructs Create
More informationQuestion No : 1 Which statement is true about triggers on data definition language (DDL) statements?
Volume: 103 Questions Question No : 1 Which statement is true about triggers on data definition language (DDL) statements? A. They can be used to track changes only to a table or index. B. They can be
More information1Z Oracle Database 11g - Program with PL/SQL Exam Summary Syllabus Questions
1Z0-144 Oracle Database 11g - Program with PL/SQL Exam Summary Syllabus Questions Table of Contents Introduction to 1Z0-144 Exam on Oracle Database 11g - Program with PL/SQL... 2 Oracle 1Z0-144 Certification
More informationCS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C
CS6312 DATABASE MANAGEMENT SYSTEMS LABORATORY L T P C 0 0 3 2 LIST OF EXPERIMENTS: 1. Creation of a database and writing SQL queries to retrieve information from the database. 2. Performing Insertion,
More informationSeminar 3. Transactions. Concurrency Management in MS SQL Server
Seminar 3 Transactions Concurrency Management in MS SQL Server Transactions in SQL Server SQL Server uses transactions to compose multiple operations in a single unit of work. Each user's work is processed
More informationPersistent Stored Modules (Stored Procedures) : PSM
1 Persistent Stored Modules (Stored Procedures) : PSM Stored Procedures What is stored procedure? SQL allows you to define procedures and functions and store them in the database server Executed by the
More informationOracle Database: SQL and PL/SQL Fundamentals
Oracle University Contact Us: 001-855-844-3881 & 001-800-514-06-9 7 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training
More informationMeet MariaDB Vicențiu Ciorbaru Software MariaDB Foundation * * 2017 MariaDB Foundation
Meet MariaDB 10.3 Vicențiu Ciorbaru Software Engineer @ MariaDB Foundation vicentiu@mariadb.org * * What is MariaDB? MariaDB 5.1 (Feb 2010) - Making builds free MariaDB 5.2 (Nov 2010) - Community features
More informationFull file at
ch02 True/False Indicate whether the statement is true or false. 1. The term anonymous blocks refers to blocks of code that are not stored for reuse and do not exist after being executed. 2. The only required
More informationWorking with DB2 Data Using SQL and XQuery Answers
Working with DB2 Data Using SQL and XQuery Answers 66. The correct answer is D. When a SELECT statement such as the one shown is executed, the result data set produced will contain all possible combinations
More informationSQL is an English like language consisting of commands to store, retrieve, maintain & regulate access to your database.
SQL SQL is an English like language consisting of commands to store, retrieve, maintain & regulate access to your database. SQL*Plus SQL*Plus is an application that recognizes & executes SQL commands &
More informationOverview. Data Integrity. Three basic types of data integrity. Integrity implementation and enforcement. Database constraints Transaction Trigger
Data Integrity IT 4153 Advanced Database J.G. Zheng Spring 2012 Overview Three basic types of data integrity Integrity implementation and enforcement Database constraints Transaction Trigger 2 1 Data Integrity
More informationOracle SQL & PL SQL Course
Oracle SQL & PL SQL Course Complete Practical & Real-time Training Job Support Complete Practical Real-Time Scenarios Resume Preparation Lab Access Training Highlights Placement Support Support Certification
More informationOracle 1Z Oracle Database 11g : SQL Fundamentals I. Download Full Version :
Oracle 1Z0-051 Oracle Database 11g : SQL Fundamentals I Download Full Version : http://killexams.com/pass4sure/exam-detail/1z0-051 Answer: D QUESTION: 183 View the Exhibits and examine the structures of
More informationPart VII Data Protection
Part VII Data Protection Part VII describes how Oracle protects the data in a database and explains what the database administrator can do to provide additional protection for data. Part VII contains the
More informationBusiness Analytics. SQL PL SQL [Oracle 10 g] P r i n c e S e t h i w w w. x l m a c r o. w e b s. c o m
Business Analytics Let s Learn SQL-PL SQL (Oracle 10g) SQL PL SQL [Oracle 10 g] RDBMS, DDL, DML, DCL, Clause, Join, Function, Queries, Views, Constraints, Blocks, Cursors, Exception Handling, Trapping,
More informationOracle Class VI. Exception Block Cursors For Loops
Oracle Class VI Exception Block Cursors For Loops Pl/sql some more basics Loop through records, manipulating them one at a time. Keep code secure by offering encryption, and storing code permanently on
More informationDatabase Systems Laboratory 5 Grouping, DCL & TCL
Database Systems Laboratory 5 School of Computer Engineering, KIIT University 5.1 1 2 3 4 5.2 GROUP BY clause GROUP BY clause is used for grouping data. The column appearing in SELECT statement must also
More informationData Manipulation Language
Manipulating Data Objectives After completing this lesson, you should be able to do the following: Describe each data manipulation language (DML) statement Insert rows into a table Update rows in a table
More informationII B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions.
Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Re-accredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated
More informationSample Test #1 Questions
Sample Test #1 Questions 1. Fibonacci numbers & Iteration Structures/using elsif a. Another program to generate Fibonacci numbers b. Makes use of the elsif selection structure c. It saves us of repeated
More informationDifficult I.Q on Databases, asked to SCTPL level 2 students 2015
Do you know the basic memory structures associated with any Oracle Database. (W.r.t 10g / 11g / 12c)? The basic memory structures associated with Oracle Database include: System Global Area (SGA) The SGA
More informationVendor: Oracle. Exam Code: 1Z Exam Name: Oracle Database 11g: Program with PL/ SQL. Version: Demo
Vendor: Oracle Exam Code: 1Z0-144 Exam Name: Oracle Database 11g: Program with PL/ SQL Version: Demo QUESTION NO: 1 View the Exhibit to examine the PL/SQL code: SREVROUPUT is on for the session. Which
More informationTRANSACTION PROCESSING PROPERTIES OF A TRANSACTION TRANSACTION PROCESSING PROPERTIES OF A TRANSACTION 4/3/2014
TRANSACTION PROCESSING SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL Def: A Transaction is a program unit ( deletion, creation, updating
More informationMore RDBMS(Relational Database Management System) Summary
Summary More RDBMS(Relational Database Management System) Till now we have studied about various SQL statements manipulating data stored in a MySQL database. We executed SQL statements without concern
More informationUNIT-IV TRANSACTION PROCESSING CONCEPTS
1 Transaction UNIT-IV TRANSACTION PROCESSING CONCEPTS A Transaction refers to a logical unit of work in DBMS, which comprises a set of DML statements that are to be executed atomically (indivisibly). Commit
More informationTRANSACTION PROCESSING CONCEPTS
1 Transaction CHAPTER 9 TRANSACTION PROCESSING CONCEPTS A Transaction refers to a logical unit of work in DBMS, which comprises a set of DML statements that are to be executed atomically (indivisibly).
More informationOracle Exam 1z0-144 Oracle Database 11g: Program with PL/SQL Version: 8.5 [ Total Questions: 103 ]
s@lm@n Oracle Exam 1z0-144 Oracle Database 11g: Program with PL/SQL Version: 8.5 [ Total Questions: 103 ] Question No : 1 What is the correct definition of the persistent state of a packaged variable?
More informationLECTURE11: TRANSACTION CONTROL LANGUAGE DATA CONTROL LANGUAGE
LECTURE11: TRANSACTION CONTROL LANGUAGE DATA CONTROL LANGUAGE Ref. Chapter6 From Database Systems: A Practical Approach to Design, Implementation and Management. Thomas Connolly, Carolyn Begg. 1 IS220
More informationConfiguring the Oracle Network Environment. Copyright 2009, Oracle. All rights reserved.
Configuring the Oracle Network Environment Objectives After completing this lesson, you should be able to: Use Enterprise Manager to: Create additional listeners Create Oracle Net Service aliases Configure
More informationRNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague
course: Database Applications (NDBI026) WS2015/16 RNDr. Michal Kopecký, Ph.D. Department of Software Engineering, Faculty of Mathematics and Physics, Charles University in Prague Transactions Transactional
More informationWeak Levels of Consistency
Weak Levels of Consistency - Some applications are willing to live with weak levels of consistency, allowing schedules that are not serialisable E.g. a read-only transaction that wants to get an approximate
More informationDatabase Programming with PL/SQL
Database Programming with PL/SQL 3-3 Objectives This lesson covers the following objectives: Construct and execute PL/SQL statements that manipulate data with DML statements Describe when to use implicit
More informationRelational Database Management System 2014
Unit-1: Procedural SQL data types Fill in the blank: 1. are used to defining a fully relational database. 2. Data can be presented to the user in different logical combinations, called. 3. Changes to the
More informationOverview of PL/SQL. About PL/SQL. PL/SQL Environment. Benefits of PL/SQL. Integration
About PL/ Overview of PL/ PL/ is an extension to with design features of programming languages. Data manipulation and query statements of are included within procedural units of code. PL/ Environment Benefits
More informationThe Oracle Interview consists of two parts. One for Written test Interview and Another one for HR interview.
Oracle Interview Procedure The Oracle Interview consists of two parts. One for Written test Interview and Another one for HR interview. Written test paper consists of 30 questions. There is No Negative
More informationOracle Database: Introduction to SQL
Oracle University Contact Us: +27 (0)11 319-4111 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn This Oracle Database: Introduction to SQL training helps you write subqueries,
More information