Viva Question and Answes
Viva Question and Answes
Viva Question and Answes
A.) Stored procedures are a pieces of the code in written in PL/SQL to do some specific task. ...
On the other hand, trigger is a stored procedure that runs automatically when various events
happen (eg update, insert, delete).
In this lesson, you will learn PL/SQL Data Types. PL/SQL variables and constants must have a valid
data type. Which specifies storage format. There are six built-in PL/SQL data types
Parameterized reports
Linked reports
Cached reports
Subreports
Parameterized Reports
A parameterized report uses input values to complete report or data processing. With a
parameterized report, you can vary the output of a report based on values that are set
when the report runs. Parameterized reports are frequently used for drillthrough reports,
linked reports, and subreports, connecting and filtering reports with related data.
Linked Reports
A linked report is a report server item that provides an access point to an existing report.
Conceptually, it is similar to a program shortcut that you use to run a program or open a
file.
VIVA QUESTION AND ANSWES
A linked report is derived from an existing report and retains the original's report
definition. A linked report always inherits report layout and data source properties of the
original report. All other properties and settings can be different from those of the original
report, including security, parameters, location, subscriptions, and schedules.
Cached Reports
A cached report is a saved copy of a processed report. Cached reports are used to improve
performance by reducing the number of processing requests to the report processor and
by reducing the time required to retrieve large reports. They have a mandatory expiration
period, usually in minutes.
Subreports
A subreport is a report that displays another report inside the body of a main report.
Conceptually, a subreport is similar to a frame in a Web page. It is used to embed a report
within a report. Any report can be used as a subreport. The subreport can use different
data sources than the main report. The report that the subreport displays is stored on a
report server, usually in the same folder as the parent report. You can set up the parent
report to pass parameters to the subreport.
Before Parameter form Fires before the Runtime Parameter Form is displayed.
After Parameter form Fires after the Runtime Parameter Form is displayed.
Before Report Fires before the report runs but after query is parsed.
Fires before each page of the report is formatted, except the very first
Between Pages page.
After Report Fires after you exit the Paper Design view.
1. DDL Trigger
2. DML Trigger
3. Logon Trigger
DDL Trigger
DDL trigger runs when DDL events occur in the database. DDL events are CREATE, ALTER and
DROP statements.
DML triggers
DML triggers is a special type of stored procedure that automatically takes effect when a
data manipulation language (DML) event takes place that affects the table or view defined
in the trigger. DML events include INSERT, UPDATE, or DELETE statements.
Logon triggers in SQL Server
Triggers is a database code that gets executed in case of a precisely defined event. We can use
logon triggers to control the SQL login security. SQL Server automatically executes the logon
triggers once a logon event occurs. It gets executed before a user session is established and
authentication is successful.
records in a detail block and the master record in a master block. Unless developing custom block-
coordination schemes, you do not need to define these triggers.
On-Check-Delete-Master Fires when Oracle Forms attempts to delete a record in
a block that is a master block in a master/detail relation.
Message-Handling Triggers:
Oracle Forms automatically issues appropriate error and informational messages in response to
runtime events. Message handling triggers fire in response to these default messaging events.
On-Error Replace a default error message with a custom error message, or to trap
and recover from an error.
Validation Triggers:
Validation triggers fire when Oracle Forms validates data in an item or record. Oracle Forms
performs validation checks during navigation that occurs in response to operator input,
programmatic control, or default processing, such as a Commit operation.
When-Validate-Item
When-Validate-Record
Navigational Triggers:
Navigational triggers fire in response to navigational events. Navigational triggers can be further
sub-divided into two categories: Pre- and Post- triggers, and When-New-Instance triggers.
Pre- and Post- Triggers fire as Oracle Forms navigates internally through different levels of the
object hierarchy. When-New-Instance-Triggers fire at the end of a navigational sequence that
places the input focus on a different item.
Pre-Form Perform an action just before Oracle Forms navigates to the form from
“outside” the form, such as at form startup.
5.) What are SQL Subqueries?
SQL subqueries or nested queries are SQL statements where we need the results from our
database after using multiple filters.
A subquery is put to restrict the data pool for the main query i.e., the inner query gives us the
data which is the pool for the main query.
Subqueries are compatible with almost all SQL statements, for example,
INSERT
UPDATE
DELETE
SELECT
Types of SQL Subqueries
4. Correlated Subqueries
Returns one or more columns according to the main or the outer query, thus called a correlated
subquery.
5. Nested Subqueries
We have queries within a query(inner and outer query).
The DELETE command is used to While this command is used to delete all the
1. delete specified rows(one or more). rows from a table.
In the DELETE command, a tuple is While in this command, the data page is
4. locked before removing it. locked before removing the table data.
DELETE command is slower than While the TRUNCATE command is faster than
6. TRUNCATE command. the DELETE command.
A.) In Oracle Forms, a property class is a named object that contains a list of properties and their
settings. An object based on a property class can inherit the settings of any property in that class.
A.) A trigger is called as an autonomous transaction at insert time, and this can be problematic.
... Instead of a before trigger, Instead, explore using regex to validate data inputs. Use check
constraint to validate data values.
A.) Procedures doesn't return any values their just get parameters and do something with them,
functions does the same by their also can return you a value based on their work. Triggers are
kind of event handlers that react on any action you want and start procedure when this action
happens.
13.) Difference between package specification and package body in oracle.?
A.)A PL/SQL package consists of two parts: package specification and package body. If the
package specification has cursors or subprograms, then the package body is mandatory.
Otherwise, it is optional. Both the package body and package specification must be in the same
schema.
A.) A validation is an edit check. Validations specific to a single item are page item validations.
Validations that apply to an entire page are page validations. ... You enter the actual validation
edit check in the Validation Messages field.
The Format Trigger property allows you to code your own PL/SQL functions to perform
conditional formatting. Because you write the code yourself, you have more flexibility and
complete control when compared to using the Conditional Formatting and Format Exception
dialog boxes alone.
1. Predefined Exceptions
2. User-defined Exception
Predefined Exceptions
Oracle has predefined some common exception. These exceptions have a unique exception name
and error number. These exceptions are already defined in the ‘STANDARD’ package in Oracle.
In code, we can directly use these predefined exception name to handle them.
CASE_NOT_FOUND ORA-06592 None of the ‘WHEN’ clause in CASE statement satisfied and no ‘ELSE’ clause is specified
ORA-
DUP_VAL_ON_INDEX Storing a duplicate value in a database column that is a constrained by unique index
00001
ORA-
INVALID_CURSOR Illegal cursor operations like closing an unopened cursor
01001
ORA-
ROW_MISMATCH When cursor variable data type is incompatible with the actual cursor return type
06504
ORA- Arithmetic or size constraint error (eg: assigning a value to a variable that is larger than
VALUE_ERROR
06502 the variable size)
ORA-
SUBSCRIPT_OUTSIDE_LIMIT Referring collection by an index number that is outside the legal range (eg: -1)
06532
Content
Stacked
Tab
Toolbar
VIVA QUESTION AND ANSWES
A tab canvas—made up of one or more tab pages—allows you to group and display a large
amount of related information on a single dynamic Oracle Forms canvas object. Like stacked
canvases, tab canvases are displayed on top of a content canvas, partly obscuring it.
A.) 2 datablocks with different names and direct each datablock to its own canvas . Also, in this
way, you can also redirect each datablock to a tab in the same canvas .
A.) The 'Cursor' is the PL/SQL construct that allows the user to name the work area and access
the stored information in it. The major function of a cursor is to retrieve data, one row at a time,
from a result set, unlike the SQL commands which operate on all the rows in the result set at one
time.
A.) From this trigger, you can access parameters and check their values. This trigger can also be
used to change parameter values or, if an error occurs, return to the Runtime Parameter Form.
Columns from the data model are not accessible from this trigger.
A.) The INSTEAD OF clause is used for creating trigger on a view. {INSERT [OR] | UPDATE [OR] |
DELETE} − This specifies the DML operation. [OF col_name] − This specifies the column name that
will be updated. [ON table_name] − This specifies the name of the table associated with the
trigger.
A.) A sequence is a set of integers 1, 2, 3, ... that are generated in order on demand. Sequences
are frequently used in databases because many applications require each row in a table to
contain a unique value and sequences provide an easy way to generate them.
A.) Trigger is collection of SQL , PL/SQL and Form coding statements executed based on the event.
Triggers are executed automatically at run time based on an event.
VIVA QUESTION AND ANSWES
A.) When-New-Instance-Triggers fire at the end of a navigational sequence that places the input
focus on a different item. Pre-Form Perform an action just before Oracle Forms navigates to the
form from “outside” the form, such as at form startup
A.) The difference is- A function must return a value (of any type) by default definition of it,
whereas in case of a procedure you need to use parameters like OUT or IN OUT parameters to
get the results. You can use a function in a normal SQL where as you cannot use a procedure in
SQL statements.
A.) Open_form opens the indicated form. Call_form not just opens the indicated form, but also
keeps the parent form alive.
A.) LOV (List of Values) in Oracle Forms are used to display the associated values while inserting
values in forms. It makes the user easier to enter data on the forms. You can assign values in LOV
statically or dynamically and can be displayed on the form manually or automatically.
34.) What is varray in oracle with example
A VARRAY is single-dimensional collections of elements with the same data type. Unlike
an associative array and nested table, a VARRAY always has a fixed number of
elements(bounded) and never has gaps between the elements (not sparse).
A.) SQL GRANT is a command used to provide access or privileges on the database objects to the
users. ... user_name is the name of the user to whom an access right is being granted. user_name
is the name of the user to whom an access right is being granted. PUBLIC is used to grant access
rights to all users.
Whenever Oracle executes an SQL statement such as SELECT INTO, INSERT, UPDATE,
and DELETE, it automatically creates an implicit cursor.
The implicit cursor is not elegant when the query returns zero or multiple rows which
cause NO_DATA_FOUND or TOO_MANY_ROWS exception respectively.
Explicit cursors
An explicit cursor is an SELECT statement declared explicitly in the declaration section of the
current block or a package specification.
For an explicit cursor, you have control over its execution cycle from OPEN, FETCH, and CLOSE.
Oracle defines an execution cycle that executes an SQL statement and associates a cursor with
it.
A.) A REF CURSOR is a PL/SQL data type whose value is the memory address of a query work area
on the database. In essence, a REF CURSOR is a pointer or a handle to a result set on the database.
REF CURSOR s are represented through the OracleRefCursor ODP.NET class.
A.) PL/SQL objects are precompiled. As DML (Data Manipulation Language) statements do not
change the dependency, they can run directly in PL/SQL objects.
A.) A REF CURSOR is a PL/SQL data type whose value is the memory address of a query work area
on the database. In essence, a REF CURSOR is a pointer or a handle to a result set on the database.
REF CURSOR s are represented through the OracleRefCursor ODP.NET class.
A static cursor is a cursor whose associated query is fixed at compile time. Declaring a cursor is a
prerequisite to using it. Declarations of static cursors using PL/SQL syntax within PL/SQL contexts
are supported by the data server.
A.) One of the main forms in this application is intended to enable HR clerks to maintain
department and employee information. You have decided to implement this as a master-detail
form that displays one department with all employees in the department. Prerequisites.
VIVA QUESTION AND ANSWES
A.) A Collection is an ordered group of elements of particular data types. It can be a collection of
simple data type or complex data type (like user-defined or record types). In the collection, each
element is identified by a term called “subscript.” Each item in the collection is assigned with a
unique subscript.
A.) A VIEW in Oracle is created by joining one or more tables. When you update record(s) in a
VIEW, it updates the records in the underlying tables that make up the View. So, yes, you can
update the data in an Oracle VIEW providing you have the proper privileges to the underlying
Oracle tables.
a view does not form part of the physical schema: as a result set, it is a virtual table computed.
Views can hide the complexity of data.
2.FUNCTION VS TIGGERS?
Difference between Stored Procedure, SQL Function, and Trigger. Store procedure: We can
execute the stored procedures when required. Function: We can call a function whenever
required. ... Trigger: Trigger can be executed automatically on specified action on a table like,
update, delete, or update
3.TYPES OF FORMS?
After Report Fires after you exit the Paper Design view.
6.PLSQL TIGGERS?
Triggers are stored programs, which are automatically executed or fired when some events
occur. Triggers are executed in response to any of the following events –A database manipulation
(DML) statement (DELETE, INSERT, or UPDATE) A database definition (DDL) statement (CREATE,
ALTER, or DROP).
7.SMART TRIGGER WITH Ex?
8.WHAT IS VIEWS?
Views in SQL are kind of virtual tables. A view also has rows and columns as they are in a real
table in the database.
9.FUN VS PROD?
A procedure is a block of code that is called to perform a task. A function is a block of code that
is called to perform a task and will return one or more values. However, parameters can be
passed to both procedures and functions.
10.types of triggers in Oracle reports?
12.GRANT?
SQL Grant command is specifically used to provide privileges to database objects for a user.
This command also allows users to grant permissions to other users too.
13.DIFF CHAR VS VARCHAR?
The short answer is: VARCHAR is variable length, while CHAR is fixed length. CHAR is a fixed length
string data type, so any remaining space in the field is padded with blanks. CHAR takes up 1 byte
per character. ... VARCHAR is a variable length string data type, so it holds only the characters
you assign to it.
14.REPLACE() VS TRANSLATE()?
VIVA QUESTION AND ANSWES
Report can be called in the activity using the method" call Rule-Obj-Report-
Definition. pxRetrieveReportData" and the details of the report can be passed in the step
parameters.
24.NVL FUN?
This function is used to replace NULL value with another value
25.PRIMARY KEY?
the column or columns that contain values that uniquely identify each row in a table
26.CAN PK ALLOW NULL VALUES?
they must not permit NULL values. ... NULL values are not allowed.
27.CAN CALLED FORM BE EDITABLE?
28.FUNCTION VS TIGGERS?
A trigger is also a set of SQL statements in the database which automatically execute whenever
any special event occurs in the database, like insert, delete, update, etc.
A function is a database object in SQL Server. Basically, it is also a set of SQL statements that
accept only input parameters and produce output in a single value form or tabular form.
29.COMMIT N ROLLBACK?
A COMMIT statement is used to save the changes on the current transaction is permanent. A
Rollback statement is used to undo all the changes made on the current transaction
31.CURSOR ATTRIBUTES?
These attributes are %ISOPEN, %FOUND, %NOTFOUND, and %ROWCOUNT. This attribute is used
to determine whether a cursor contains rows after the execution of a FETCH statement
32.EXTENTION OF REPORTS?