Question:- Which Cursor Attributes are the Result of a Saved DML Statement, when it is Executed?
Answer:- The statement’s result is saved in four cursor attributes. The four attributes are: • SQL% FOUND • SQL% NOTFOUND • SQL% ROWCOUNT • SQL% ISOPEN
Question:- What is a Cursor? Why is it Required?
Answer:- A cursor is a temporary work area that is created in system memory when an SQL statement is executed. A cursor contains information on a select statement and the row of data accessed by it. This temporary work area stores the data, which is retrieved from the database, to manipulate it. A cursor can hold more than one row but can process only one row at a time. A cursor is required to process rows individually for queries.
Question:- What are the Types of Cursors?
Answer:- There are two types of cursors: • Implicit Cursor: When PL/SQL executes an SQL statement, it automatically constructs a cursor without specifying one; these cursors are known as implicit PL/SQL uses implicit cursors for the following statements: • INSERT • UPDATE • DELETE • SELECT • Explicit Cursor: A programmer declares and names an explicit cursor for the queries that return more than one row. An explicit cursor is a SELECT statement that is declared explicitly in the current block’s declaration section or in a package definition. The following are the commands that are used for explicit cursors in PL/SQL: • OPEN • FETCH • CLOSE
Question:- What is the Open Cursor Command Function?
Answer:- When the OPEN cursor command is used to open a cursor, it performs the following operations: • Set aside a processing memory region • Paese the statement SELECT • Use the memory addresses to assign values to input variables • Recognize the active set of rows that meet the selection criteria • Place the pointer exactly before the active set’s first row
Question:- How to Delete a Trigger?
Answer:- To delete a trigger, you need to use the command DROP TRIGGER.
Question:- What are the Advantages of Stored Procedures?
Answer:- Stored procedures have various advantages to help you design sophisticated database systems. Some of the advantages of stored procedures as listed below: • Better performance • Higher productivity • Ease of use • Increased scalability • Interoperability • Advance security • Replication
Question:- What are the Various Types of Schema Objects that can be Created by PL/SQL?
Answer:- There are various types of schema objects that are created by PL/SQL. Some of them are mentioned below: • Stored procedures, packages, and functions • Object tables, object types, and object views • Database triggers • Database links • Cursors • Table • View
Question:- What is the Advantage of Implicit Records?
Answer:- Implicit records are handy since they do not require hard-coded descriptions. Because implicit records are based on database table records, any changes to the database table records will be reflected in the implicit records automatically.
Question:- What are the Ways of Commenting in PL/SQL?
Answer:- In PL/SQL, comments help readability by describing the purpose and function of code portions. Two types of comments are available in PL/SQL. They are as follows: • Single-line Comments: Single-line comments start with a double hyphen (- -) at the beginning of a line and go all the way to the conclusion. • Multi-line Comments: Multi-line comments start with a slash-asterisk (/*) and terminate with an asterisk-slash (*/), and they can span across several lines.
Question:- What is %TYPE?
Answer:- The %TYPE property is used to declare a column in a table that includes the value of that column. The variable’s data type is the same as the table’s column.
Question:- What is %ROWTYPE?
Answer:- The %ROWTYPE property is used to declare a variable that contains the structure of the records in a table. The variable’s data type is the same as the table’s columns.
Question:- Differentiate between a Temporary Tablespace and a Permanent Tablespace
Answer:- A temporary tablespace is used to store temporary items such as sort structures, while a permanent tablespace is used to store things that will be used as the database’s genuine objects.
Question:- How Many Triggers can be Applied to a Table?
Answer:- A maximum of 12 triggers can be added to a table.
Question:- What is a Mutating Table Error?
Answer:- A mutating table error occurs when a trigger tries to update a row that is currently in use. It can be fixed by using views or temporary tables so that the database selects one and updates the other.
