Wednesday, January 19, 2011

Amount to Words by Rupees


Order of Trigger Firing

  • Before Statement trigger (If present)
  • Each row affected by the statement
    (a) Execute row level trigger (If present)
    (b) Execute the statement itself
    (c) Execute the after row level trigger (If Present)
  • After statement trigger (If Present)

Predefined Exceptions



An internal exception is raised automatically if your PL/SQL program violates an Oracle rule or exceeds a system-dependent limit. PL/SQL predefines some common Oracle errors as exceptions. For example, PL/SQL raises the predefined exception NO_DATA_FOUND if a SELECT INTO statement returns no rows.You can use the pragma EXCEPTION_INIT to associate exception names with other Oracle error codes that you can anticipate. To handle unexpected Oracle errors, you can use the OTHERS handler. Within this handler, you can call the functions SQLCODE and SQLERRM to return the Oracle error code and message text. Once you know the error code, you can use it with pragma EXCEPTION_INIT and write a handler specifically for that error.PL/SQL declares predefined exceptions globally in package STANDARD. You need not declare them yourself. Can wirte handlers for predefined exceptions by using the SQLCODE.
ZERO_DIVIDE -A program attempts to divide a number by zero.
VALUE_ERROR- An arithmetic, conversion, truncation, or size-constraint error occurs. For example, when your program selects a column value into a character variable, if the value is longer than the declared length of the variable, PL/SQL aborts the assignment and raises VALUE_ERROR. In procedural statements, VALUE_ERROR is raised if the conversion of a character string into a number fails. (In SQL statements, INVALID_NUMBER is raised.)