What is a package ?
A PACKAGE is a PL/SQL object that groups PL/SQL types, variables, SQL cursors,
exceptions,procedures, and functions.Each package has a specification and a body. The specification shows the object you can access when you use the package. The body fully defines all the objects and can contain additional objects used only for the internal workings. You can change the body (for example, by adding procedures to the packages) without invalidating any object that uses the package. What is Schema ? A SCHEMA is a collection of objects. SCHEMA objects are logical structures that directly refer to the database's data. SCHEMA objects include structures such as tables, views, synonyms, sequences, indexes, clusters, stored procedures and data links. 1. What is a View ? Why is it required to define a View ?
A View is a database object that is a logical representation of a table. It is derived from a
table but has no storage space of its own and often may be used in the same manner as a table. Advantage:
1. Security
2. Complex query can be replaced.
2. Can we create a View without a table ?
Yes, Using the FORCE option in the CREATE VIEW syntax.
Ex: CREATE FORCE VIEW view_name as SELECT column name, columnname.. FROM table_name; 3. What is the difference between a SYNONYM and a VIEW ?
A SYNONYM is a name assigned to a table or view that may thereafter be used to refer it.
If you access to another user's table, you may create a synonym for it and refer to it by the synonym alone, without entering the user's name as a qualifier.
Difference: A View can be based on MULTIPLE Tables whereas a SYNONYM is based on a single object only. 4. What is SNAPSHOT ? What is a SNAPSHOT LOG ?
A SNAPSHOT is a means of creating a local copy of remote data. A snapshot can be
used to replicate all or part of a single table, or to replicate the result of a query against multiple tables. The refreshes of the replicated data can be done automatically by the database ( at time intervals you specify ) or manually.Snapshot Log is the table associated with the Master Table of the Snap shot. 5. What is a DATABASE trigger ? What is a DATABASE Procedure ?
A DATABASE TRIGGER is a stored procedure associated with a table that ORACLE7
automatically executes on one or more specified events (BEFORE or AFTER an INSERT,UPDATE or DELETE) affecting the table. Triggers can execute for the table as a whole or for each affected row in the table.
A PACKAGED PROCEDURE is a built-in PL/SQL procedure that is available in all
forms. Each packaged procedure executes a SQL*FORMS function, such as moving to a field or executing a query. 8. What is a CURSOR ?
A work area in memory where ORACLE stores the current SQL statement. For a query ,
the area in memory also includes column headings and one row retrieved by the SELECT statement.
|
|