Professional Documents
Culture Documents
Oracle/Developer 2000
COMMIT: -
In oracle, whatever transactions we perform with a table are
Temporary in nature. To make them permanent commit must
be issued.
SAVEPOINT: -
The savepoint statement is used to give a name to a
Transaction and then the rollback statement uses these name
To release a transaction.
ANS:
LOCK TABLE: -
Locks are metarism used to prevent the interactive destruction
between the users using same resource. Locks determine what will happen when
the two users attempt to modify the same row at the same time.
• Shared locks -
=> Shared locks are placed on resources whenever a Read operation (SELECT)
is performed.
=> Multiple shared locks can be simultaneously set on a resource.
• Exclusive locks: -
Varchar/Varchar2:-
This data type is used to store alphanumeric data. The
maximum length of this data type is 2000 characters.
Number:-
It is used to store numbers either fixed or floating.
Date:-
This data type is used to represent date and time.
Long:- Cells defined as long can store variable length character strings
containing up to 65,535 characters.
Equi Joins: -
When matching records are only displayed from both the tables.
Tables are joined columns, which have same data type and rows. When
two or more tables are joins on the basis of equality of values in one or
more table they make equi join.
E.g.: - Let’s create two tables Player and Match. In both the tables one field is
same i.e. Roll no. When we retrieve data from the tables we have to join the
roll no of both the tables. Match is considered as foreign key and roll no,
player is considered as primary key.
Select player.rollno, name, match date opponent
From player, match
Where player.rollno=match.rollno;
Outer joins:-
If there is any value in one table which have the corresponding
value(s) in
other table then Equi join rows are not selected. The rows can be selected by
using outer join symbol (+). The corresponding for the column is null. The data
that is not presented in the second file will be presented as null values.
E.g.: - Select player.rollno, name, match date opponent
From player, match
Where player.rollno=match.rollno;
=> It is not possible to join the same table to one or more tables with single
select statement.
=> The outer join may not be used with one or more operator.
SYNTAX:-
LOOP
<COMMAND>
EXIT
<COMMAND>
END LOOP;
Whenever the commands are executed inside a loop the cycle restarts in
the command following that loop when exit is executed, the execution control
passes to the row following the end loop command.
SYNTAX:-
FOR <COUNTER>IN [REVERSE] <INITIAL-VALUES>
<FINAL-VALUES> LOOP
<COMMANDS>
END LOOP;
SYNTAX:-
WHILE<CONDITION>
LOOP
<COMMAND>
ANS: -
A sub query is a form of an SQL statement that appears inside
another SQL statement. It is also treated as nested query. The statement containing
a sub query is called parent statement.
Uses: -
ANS: -
There are three types of Procedural objects. They are as follow:-
Procedures: -
Functions: -
Packages: -
PROCEDURES:
Procedures are sub programs, which receives parameters and
performs a specified action. In order to create procedures we use <create
procedure> statement. It has the following form: -
DROPPING A PROCEDURE: -
DROP PROCEDURE <PROCEDURE NAME>;
VALIDATE (:NEW.BASIC);
PRAMETERS TO PROCEDURES:-
Communication is passed In or Out through procedures with the
help of a parameter. The parameters passed also known as actual
parameters which can be positional or named notation.
FUNCTIONS:
SYNTAX OF FUNCTION: -
CREATE [OR REPALACE] FUNCATION <FUNCTION NAME>
(ARGUMENT (IN/OUT/INOUT) DATATYPE) RETURN <RETURN
TYPE>
[IS/AS] <DECLARATION>
BEGIN
<FUNCTION BODY>
END [FUNCTION NAME];
PACKAGES:-
(B) A Package Body fully contains PL/SQL block for all the
objects listed in the Package specified. The name of the
Package Body should be the same as the name of the
Package Specification.
SYNTAX: -
CREATE [OR REPLACE] PACKAGE BODY <PACKAGE
NAME> [IS/AS] PL/SQL CODE BLOCK FOR ALL THE
LISTED OBJECTS
END [PACKAGE NAME];
TYPES OF CURSORS:-
Cursors are classified in two categories: -
(a) Explicit Cursor &
(b) Implicit Cursor. These cursors are user defined cursors which can be used to
process DML statement such as Insert, Update, Delete or Select in multiple
rows at a time.
EXPLICIT CURSORS:-
When individual records in the table have to be processed inside a
PL/SQL
Block a cursor is used. This cursor will be declared and mapped to an SQL
query in the declarative section of the PL/SQL block and used within the
executable section. A cursor thus created and used is known as an EXPLICIT
CURSOR.
IMPLICIT CURSORS:-
The Implicit cursor is used to process single record in a table.
Implicit cursor is not needed to be declared by the user. It is
automatically declared by the cursor when PL/SQL block is executed.
Implicit cursor attributes can be used to access information about
the
status of last insert, update, delete or single-row select statement.
EXECUTION OF A TRIGGER:-
DROPPING A TRIGGER: -
SYNTAX: -
DROP TRIGGER <TRIGGER NAME>;
DISABLING A TRIGGER: -
SYNTAX: -
ALTER TRIGGER <TRIGGER NAME> DISABLE;
ENABLING A TRIGGER: -
SYNTAX: -
ALTER TRIGGER <TRIGGER NAME> ENABLE;
BT 10-02
ORACLE/DEVELOPER
Syntax:-
TYPE <NAME>IS TABLE OF <DATA TYPE>
INDEX BY BINARY_INTEGER;
NOTE: - After declaring PL/SQL table we must declare a variable of this table in
the declarative section of PL/SQL block by using the following syntax: -
Syntax: -
Delete from < table name>
[ where condition ];
TRUNCATE Command:-
It returns the number up to given decimal place.
Select trunk (26.648, 1) from dual =26.6
5: - WRITE QUERIES.
ANS: -
a) Select sum (empsal)”salary”
from employee;
DML: -
Data Manipulation Language . The SQL Sentences used to
Manipulate data within objects are called DML. Ex: - TNSERT, UPDATE,
SELECT, DELETE.
DCL: -
Data Control Language . The SQL Sentences which are used to
Control the behaviors of these objects are called DCL. Ex: - CREATE USER,
GRANT, and REVOKE.
7: - WHAT IS AN LOV? EXPLAIN ITS USE.
ANS: -
During data entry often a user has to enter that already exists in same or other
table. LOV stands for list of values it is used to retrieve data already existing in a
table using a select, opens up a separate window displaying value from one or
more table when the user presses an appropriate key sequence.
Radio Group:
A radio group is a group of two or more radio buttons, one
of which is always selected. Operator changes the value of a radio group item
by selecting different button in the group.
10: - EXPLAIN ANY FOUR TYPES OF ORACLE REPORTS?
ANS: -
INTRODUCTION:
Reports are useful feature compatible with ORACLE. Its main
function is to generate reports based on the query specified. Hence, the first step to
develop the report is to specify the query and the required data.
Following are the four types of Oracle Reports: