Exception Handilings?



Exception Handilings?..

Answer / saleem

Is a mechanism provided by pl/sql to detect runtime
errors and process them with out halting the program abnormally
1) pre-defined
2) user-defined.
PRE-DEFINED:
1) cursor_already_open--------attempted to open an already
open cursor.
2) Dup_val_on_index --------attempted to insert a
duplicate values.
3) Invalid_cursor -------- illegal cursor operation
occurred.
4) Invalid_number -------- conversion of character
string to number fails.
5) Login_denied ---------loging on to oracle with
an invalid user name
and password.
6) program_error -------- pl/sql has an internal
problem.
7) storage_error -------- pl/sql ran out of
memory or memory is
corrupted.
8) to_many_row ---------single row select
returned more than one row.
9) value_error --------
arithmetic,conversion,truncation or size

constraint error occurred.
10) zero_devided -------- attempted to divided by
zero.


USER-DEFINED:
Declare : name the exception
Raise : explicitly raise the exception by
using the raise statements
Reference: exception handing section.

The Raise_Application_Error_Procedure:
 You can use this procedure to issue user-defined error
messages from stored sub programs.
 You can report errors to your applications and avoid
returning unhandled exceptions.

Raise_Application_Error(error_number,message[,{true/false}]
Error number  between -20000 to -20999

pragma exception_init?
It tells the compiler to associate an exception with
an oracle error. To get an error message of a specific
oracle error.
Ex: pragma exception_init(exception name, oracle
error number)

Example for Exceptions?
1) Check the record is exist or not?
Declare
E emp% rowtype
Begin
e.empno := &empno;
select * into e from emp where empno
=e.empno;
Dbms_output.putline(?empno? || e.empno);
Exception
When no_data_found then
Dbms_output.putline(e.empno ||?doest
exist?);
End;

2) User defined exceptions?
Define p_dept_desc =?gvreddy?
Define p_dept_number =1236
Declare
E_invalid_dept exception;
Begin
Update departments
Set dept_name=?&p_dept_desc?
Where dept_id =?&p_dept_number?;
If sql% not found then
Raise e_invalid_departments;
End if;
Commit;
Exception
When e_invalid_departments then
Dbms_output.putline(?no such dept?);
End;

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Oracle Apps Technical Interview Questions

what are the mandatory parameters in suppler Conversion?

1 Answers   Tech Mahindra,


LOCKS?

1 Answers  


P_CONC_REQUEST_ID mandatory in oracle reports to run in oracle applications or not ( I am not talking about running in report builder or D2k ) or not ?

9 Answers   CSC, IBM, KPIT, Oracle,


How to print multi currency,multi language in xml?

1 Answers  


how to change the logo in template dynamically?

2 Answers   Sierra Atlantica,






In oracle application how do you debug or trace errors?

0 Answers  


Hi Experts How to Create a purchase order without a requisition ?

6 Answers   Amdocs, KPMG, Oracle,


What is SRW Package? (Sql Report Writer)

1 Answers  


what are the error tables in OM

2 Answers   Fujitsu,


What will happen If I am not giveing the Suspense accout while defineing the Set of Books in GL?

2 Answers   TCS,


1—how we can create multi reports in xml publishers Ans: 2—how to print multi currency,multi language in xml 3—what are the validations in sql*loader 4—where u can get data file 5—where u r putting control file and where the bad file discard file generated 6—how to print external date in xmlp 7—in data file fields terminated by different sybals how you can write code in ctrl file 8—how to use date function in sql*loader 9—which path u have used in sql*loader 10—what are utl file triggers 11—where u can find errorbuf ret code 12 how we can know weather procedure is successfully executed from backend 13—data file contains how many levels 14—what kind of errors u got in discard file 15—how you can skip the records in thr middle of data file and end of data file 16—invoice created and send to the gl but we don’t know the invoice number how we can know 17—where u devlop interface program local syst or server system 18—how we can know how many receipts are created for a po 19—after completion of po interface into base table how we can see etair line header info in single table. 20—how to save a workflow in database in short cut? Can we delete workflow how 21—what are the common errors in workflow 22—strong cursor and weak cursor 23—what is external table where we will use 24—we have 50 record while printing in rdf report we have print 10 records per page how u can do 25—what is the difference between workflow and oracle alert 26—hot to implement muli org in interface approach 27—while loading records if the records no>=10 then all the records should be discarder,then error message populated how you can achieve 28—while picking the sales aorder qty is there in shipping there is no qty then what u will you will do 29—what is the next step after back order 30—if we do any modification in po_headers_v is it effects the base tables 31—what is tca architecture 32—where we can see the invoice payment 33—when selection existing customer in om what you will do 34—how to pass the values for the variables in api. 35—can we use look up values instead of profile options. 35—how to create ldt lct files? 36—how to tranfor on file from one instance to another instance?

1 Answers   IBM,


Hoe to skip middle of the record by using SQL*Loader?

5 Answers  


Categories
  • Oracle Apps Technical Interview Questions Oracle Apps Technical (547)
  • Oracle Apps Financial Interview Questions Oracle Apps Financial (793)
  • Oracle Apps Manufacturing Interview Questions Oracle Apps Manufacturing (53)
  • Oracle Apps HRMS Interview Questions Oracle Apps HRMS (169)
  • Oracle Apps CRM Interview Questions Oracle Apps CRM (9)
  • Oracle Apps SCM Interview Questions Oracle Apps SCM (141)
  • Oracle Install Base Interview Questions Oracle Install Base (62)
  • Oracle Service Contracts Interview Questions Oracle Service Contracts (101)
  • Oracle Apps AllOther Interview Questions Oracle Apps AllOther (114)