GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 99 of 155    Print  
How can we print the error code in exception handling section?

  
Total Answers and Comments: 2 Last Update: September 25, 2007     Asked by: madhug56 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 20, 2007 00:33:01   #1  
jayachandra_jc Member Since: June 2007   Contribution: 1    

RE: How can we print the error code in exception handl...
EXCEPTION
WHEN No_privilages THEN
htp.p( '<H1> Access denied</H1>');
WHEN Rec_expired THEN
htp.p('Other user has changed this record,Query the record and
Update');
WHEN OTHERS THEN
Htp.p(SQLERRM);


 
Is this answer useful? Yes | No
September 25, 2007 10:53:07   #2  
devi        

RE: How can we print the error code in exception handl...
You can print the 'sqlcode' as follows

Exception 
When others then
dbms_output.put_line('error code is'||sqlcode)
end; 

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : After compiling procedures,functions and triggers(in new versions only),Those will be stored in the form of p-code(after parsing) in SGA(System Global Area).The advantage of p-code is Since it was there in SGA which can be shared by all,Whenever ...
Read Answers (1) | Asked by : richa

Hi all,Could anyone let me know the equivalent code in pl/sql for this java code? I really appreciate that.for (int i = 0; i < 10; i++) {if (i == 5){continue;}} thanks,kamalnayan.M
Read Answers (8) | Asked by : kamalnayan.M

Hi How do I call procedures which have ref cursors as parameters and print the elements in the ref cursor in PL/SQL Developer ?I executed the following code in PL/SQL Developer : CREATE OR REPLACE PACKAGE EMP_PACK ASTYPE EMPCURTYP IS REF CURSOR RETURN EMP%ROWTYPE;PROCEDURE EMP_PROC( EMP_CUR IN OUT EMPCURTYP);END EMP_PACK;CREATE OR REPLACE PACKAGE BODY EMP_PACK ASPROCEDURE EMP_PROC(EMP_CUR IN OUT EMPCURTYP) ISBEGINOPEN EMP_CUR FOR SELECT * FROM EMP;END EMP_PROC;END EMP_PACK;/When I executed the following
View Question | Asked by : Divya

What is mutating trigger? How do you resolve it?If a trigger body is trying to update dependent tables, will it get a mutating error?
Read Answers (6) | Asked by : be17be

Latest Answer : use execute immediate to write DDL statements.but you should have create  system previlege on the schema. ...
Read Answers (1) | Asked by : vasudev

Hi all if i can assign any value to the out parameter in procedures .... like i had created this procedure ...CREATE ORE REPLACE PROCEDURE MODETEST ( PARAMETER OUT NUMBER)ISJUSTTEST NUMBER :=20;BEGINPARAMETER :=JUSTTEST ; *HERE I ASSIGN VALUE TO OUT PARAMETER *JUSTTEST := PARAMETER;dBMS_OUTPUT.PUT_LINE(JUSTTEST);END; AND THE PROCEDURE IS CREATED WITHOUT ANY ERROR BUT I THAUGHT THE OUT PARAMETERS ARE WRITE ONLY AND WE CANT ASSIGN ANY VALUE TO IT ....
Read Answers (1) | Asked by : GANESH

Hi all I wrote a procedure to send email via plsql procedure, It was compiled sucessfully but not working ....here is the code (actuly i added the dbms output like step1 ,step 2 to see in which step the control is going on )create or replace PROCEDURE send_test_messageIS mailhost VARCHAR2(64) := 'mail.cmcltd.com'; sender VARCHAR2(64) := 'akash.sharma@cmcltd.com'; recipient VARCHAR2(64) := 'lalit.mohan@cmcltd.com'; mail_conn utl_smtp.connection;BEGIN
Tags : DBMS

Hi,1. Iam looking for sample program for ref cursor. ref cursor can be associated with many select statements and we can use the ref cursor to return the multiple value from the procedure or function. 
Latest Answer : Hi,Let me answer your second questin first. Why ref cursor instead of %ROWTYPE.%ROWTYPE is used for fetches record/row of a single table.OR in case of columns of different tables then you have to create a RECORD and then used %ROWTYPE.But ...

What happens if we don't write any thing between BEGIN and END in a procedure? If it show error than how can we execute this code error free?
Read Answers (1) | Asked by : vardan

Latest Answer : You can print the 'sqlcode' as followsException When others thendbms_output.put_line('error code is'||sqlcode)end;  ...
Read Answers (2) | Asked by : madhug56


 Sponsored Links

 
Related Articles

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

ODP.NET - Handling Nulls when Working with OracleDataReader

ODP NET Handling Nulls when Working with OracleDataReader When we work with OracleDataReader or for that matter even with data rows in a data table we may come across nulls The following is the efficient way to deal in with such scenarios mosgoogle geshibot language VB NET&quot; create connect
 

ODP.NET - Handling Nulls when Executing with ExecuteScalar

ODP NET Handling Nulls when Executing with ExecuteScalar The most important issue to remember is that ExecuteScalar simply returns an object type of data The object refers to any data type within NET If the data type of your variable matches with the type of object returned by ExecuteScalar an impli
 

Print Servers

Print Servers Print server is a server or advice that is used to connect many printers of a network to it Using the print server any computer on the network can give a print command to the server and the print server will get the job done accordingly Usually a print server is configured on a compute
 

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php&quot; document ready function var highlighted
 

jQuery Interacting with Other Code

jQuery Interacting with Other Code We learned with our sorting and paging code that we can t treat the various features we write as islands The behaviors we build can interact in sometimes surprising ways; for this reason it is worth revisiting our earlier efforts to examine how they coexist with t
 

jQuery Completed sorting and paging code

Learning jQuery The Finished Code The completed sorting and paging code in its entirety follows mosgoogle geshibot lang php&quot; fn alternateRowColors function tbody tr odd this removeClass even addClass odd ; tbody tr even this removeClass odd addClass even ; return this; ; document
 

code

geshibot lang javascript&quot; head This is a JS snippet from Geshi Bot&quot; Replaces the geshi default classes with mambo joomla classes function replaceGeshiWithMamboClasses if document document getElementsByTagName Category
 

C++ String Representation and Handling

C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing
 

String handling functions

What is the string handling functions present in header file &lt;string.h&gt;? There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as #include &lt;string.h&am
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape