473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to implement log file concept in oracle

Dear All,
I need to implement log file concept in oracle.
For example i have written a procedure.
If any exception come it should display in log file.How will i do it?
Please assist me for the needful.

Expand|Select|Wrap|Line Numbers
  1.  
  2. CREATE OR REPLACE PROCEDURE PR_ITS_CUSTOMER_AUTH(
  3. PI_USER_NAME IN VARCHAR2,
  4. PI_DATE_OF_BIRTH IN VARCHAR2,
  5. PO_RET_CODE OUT VARCHAR2,
  6. PO_RETSTR OUT VARCHAR2
  7. )
  8. AS
  9. -- Authentication of customer on login name and date of birth
  10. L_ENTITY_ID ENTITY_MASTER.EM_ENTITY_ID%TYPE;
  11. L_STATUS ENTITY_MASTER.EM_STATUS%TYPE;
  12. BEGIN
  13. PO_RET_CODE:='S';
  14. PO_RETSTR:='SUCCESS';
  15. BEGIN
  16. SELECT UM.UM_EM_ENTITY_ID 
  17. INTO L_ENTITY_ID 
  18. FROM USER_MASTER UM 
  19. WHERE UM.UM_LOGIN_ID=PI_USER_NAME;
  20. EXCEPTION
  21. WHEN NO_DATA_FOUND THEN
  22. PO_RET_CODE:='E';
  23. PO_RETSTR:='ERROR::LOGIN ID IS NOT AVAILABLE';
  24. RETURN;
  25. END; 
  26. BEGIN
  27. SELECT EM.EM_STATUS
  28. INTO L_STATUS 
  29. FROM ENTITY_MASTER EM WHERE EM.EM_ENTITY_ID=L_ENTITY_ID
  30. AND EM.EM_DOB=TO_DATE(PI_DATE_OF_BIRTH,'DD MON YYYY');
  31. EXCEPTION
  32. WHEN NO_DATA_FOUND THEN
  33. PO_RET_CODE:='E';
  34. PO_RETSTR:='ERROR::DOB IS NOT AVAILABLE';
  35. END;
  36. END;
  37.  
Thanks in adavance.
Regards
Sumanta Panda
Jan 20 '09 #1
6 2806
debasisdas
8,127 Expert 4TB
That can be added to the EXCEPTION block of the code.
Jan 20 '09 #2
Dear Debashish Bhai,
I agreed your advise.Could You please suggest me how to write else please chage one line in my code.

Thanks in advance.
Regards
Sumanta Panda
Jan 20 '09 #3
debasisdas
8,127 Expert 4TB
thy the following code.

Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE PROCEDURE PR_ITS_CUSTOMER_AUTH(
  2. PI_USER_NAME IN VARCHAR2,
  3. PI_DATE_OF_BIRTH IN VARCHAR2,
  4. PO_RET_CODE OUT VARCHAR2,
  5. PO_RETSTR OUT VARCHAR2
  6. )
  7. AS
  8. -- Authentication of customer on login name and date of birth
  9. L_ENTITY_ID ENTITY_MASTER.EM_ENTITY_ID%TYPE;
  10. L_STATUS ENTITY_MASTER.EM_STATUS%TYPE;
  11. BEGIN
  12. PO_RET_CODE:='S';
  13. PO_RETSTR:='SUCCESS';
  14. BEGIN
  15. SELECT UM.UM_EM_ENTITY_ID 
  16. INTO L_ENTITY_ID 
  17. FROM USER_MASTER UM 
  18. WHERE UM.UM_LOGIN_ID=PI_USER_NAME;
  19. EXCEPTION
  20. WHEN NO_DATA_FOUND THEN
  21. PO_RET_CODE:='E';
  22. PO_RETSTR:='ERROR::LOGIN ID IS NOT AVAILABLE';
  23. RETURN;
  24. END; 
  25. BEGIN
  26. SELECT EM.EM_STATUS
  27. INTO L_STATUS 
  28. FROM ENTITY_MASTER EM WHERE EM.EM_ENTITY_ID=L_ENTITY_ID
  29. AND EM.EM_DOB=TO_DATE(PI_DATE_OF_BIRTH,'DD MON YYYY');
  30. EXCEPTION
  31. WHEN NO_DATA_FOUND THEN
  32. PO_RET_CODE:='E';
  33. PO_RETSTR:='ERROR::DOB IS NOT AVAILABLE';
  34. INSERT INTO SYSTEM_LOG(E_CODE,E_MSG) VALUES(PO_RET_CODE,PO_RETSTR);
  35. COMMIT;
  36. END;
  37. END;
  38.  
  39.  
  40.  
Jan 21 '09 #4
Dear Debashish Bhai,
Thanks a lot.Let me confirm one doubt SYSTEM_LOG table is oracle system table or we need to create a table for it.

Thanks in advance.
Regards
Sumanta Pnada
Jan 21 '09 #5
Thanks a lot Debashish Bhai......Its working....
Jan 21 '09 #6
amitpatel66
2,367 Expert 2GB
Hi Sumanta,

Please use CODE tags when ever you paste any source code. That makes the code more readable and that would help others to suggest a solution by having a look at your sample code.

Moderator
Jan 21 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: KULJEET | last post by:
control file not created at time of installtion of oracle database now how we can create it see alert file Dump file e:\ORacle\admin\new\bdump\newALRT.LOG Tue Sep 09 10:45:53 2003 ORACLE...
11
by: Gent | last post by:
I have a table named Holding_Value that has several fields in it among which are UID, fkHolding, EffDate, Units, MarketValue, AssetPrice. UID is an identity field and fkHolding is a foreign key to...
2
by: Cherrish Vaidiyan | last post by:
sir, I am working on Oracle 9i on Linux. I have a simple clarifications to be made.. Is there a concept of replication in MS ACCESS ? If yes, Any GUI Tool available for it ? Thanking in...
3
by: Pir8 | last post by:
I have a complex xml file, which contains stories within a magazine. The structure of the xml file is as follows: <?xml version="1.0" encoding="ISO-8859-1" ?> <magazine> <story>...
7
by: srinivas | last post by:
Hi, I am a asp programmer.I am displaying the db records in the html pages in a web page.I have 500 columns and 1000 rows in that html table.Here i am planning to implement the "MS-Excel Freeze...
3
by: gmax2006 | last post by:
Hi, I am using RedHat Linux 4. and I developed an oracle 10g based application by using cx_Oracle (cx_Oracle-4.1-10g-py23-1.i386.rpm) and Python 2.3.4. When I run the application through...
0
by: greenMark | last post by:
Hi All I need to develope a data warehouse in oracle. I was able to develope a small one using oracle enterprise manager. But my main idea is to develope the necessary GUIs using Oracle Forms 6i....
4
by: kwartz | last post by:
I have several .sql file that I am runing from the dos prompt using echo. I want to spool the log files of each of the .sql files into one. The way I have it now, the current log file overwrites the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.