logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What is a PL/SQL package? what are its Advantages ?


  • Correct Answer
  • A package is a collection of related PL/SQL objects The package contains a body and a specification The package specification has the declaration which is public and can be used in the PL/SQL sub programs inside the package The package body holds the implementation of all the PL/SQL objects declared in the specification Example of a PL/SQL Package CREATE OR REPLACE PACKAGE emp_data AS PROCEDURE add_employee ( ename VARCHAR2, job VARCHAR2, mgr NUMBER, sal NUMBER, deptno NUMBER); END emp_actions; CREATE OR REPLACE PACKAGE BODY emp_data AS PROCEDURE add_employee ( ename VARCHAR2, job VARCHAR2, mgr NUMBER, sal NUMBER, deptno NUMBER) IS BEGIN INSERT INTO emp VALUES (empno_seqNEXTVAL, ename, job, mgr, SYSDATE, comm, deptno); END add_employee; END emp_data; Advantages of PL/SQL packages : Packages are easier for application designing, encapsulating data, additional functionality and better performance An application has various modules which can be placed in packages and handled easier 


  • Technology problems


    Search Results


    • 1. Explain how PL/SQL exceptions are raised.
    • Discuss
    • 2. Explain some of the commonly used Predefined PL/SQL Exceptions.
    • Discuss
    • 3. Define cursor attributes: %FOUND, %NOTFOUND, %ROWCOUNT, and %ISOPEN
    • Discuss
    • 4. What is a PL/SQL Record data type?
    • Discuss
    • 5. What is a Collection? Explain collection types.
    • Discuss
    • 6. Define PL/SQL sequences and write syntax for a sequence
    • Discuss
    • 7. What does cache and no cache options mean while creating a sequence?
    • Discuss
    • 8. What is an Index? Explain how to create an Index.
    • Discuss
    • 9. Explain how to create users through SQL PLUS.
    • Discuss
    • 10. Could you explain the areas where tuning of database is required?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment