Showing posts with label Sql/PlSql. Show all posts
Showing posts with label Sql/PlSql. Show all posts

Tuesday, February 11, 2014

Interview Questions - Sql/PlSql

Q. Can the NVL function return NULL Values?
Y
__________________________________________________________________________
Q. What happens to a Package Body when Package Specification is dropped?
Not possible
__________________________________________________________________________

Thursday, February 18, 2010

PL/SQL Errors

In PL/SQL, a warning or error condition is called an exception.

Some Predefined Exceptions
  • VALUE_ERROR Exception is raised whenever PL/SQL runtime engine tries to execute a numeric FOR loop and either the low or high expression in the loop’s header evaluates to NULL. Use the COUNT method to ensure that the FOR loop is executed only when there is something in the collection. Here is the sample code:
    IF names_in.COUNT > 0 THEN
    FOR indx IN names_in.FIRST .. names_in.LAST
  • ZERO_DIVIDE Exception - Program attempts to divide a number by zero.
  • DUP_VAL_ON_INDEX Exception - Program attempts to store duplicate values in a database column that is constrained by a unique index.

Thursday, November 12, 2009

SQL

Table within a table

A nested table is nothing more than a normal table that has a column whose datatype is another table.