Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Amount conversion function

User_JOHIROct 23 2017 — edited Oct 25 2017

Hi,

Need your suggestion on modifying the below written currency conversion function. O am using Oracle 11g.

Please find the below table structure and function. Here I Gave USD as by defaullt.

CREATE TABLE CRNCY_CONVR_TBL

(

Accno     VARCHAR2(30),

Amt       NUMBER(12,2),

Crncy_id    VARCHAR2(15),

CRNCY_CD  VARCHAR2(15),

CONVER_RATE NUMBER(15,2),

PRC_DT        DATE

);

But my requirement is to convert any currency to USD and then need to catch the errors by using exceptions ( as per forums I realized and observed WHEN OTHERS is ignoring errors).So would like to add exception which will catch the errors and  then o store those errors in ERROR LOG table  ( need to add that logic within the function). Can you please advise the logic/changes to modify the above Function..

Thanks,

Vasu.

This post has been answered by Paulzip on Oct 24 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2017
Added on Oct 23 2017
27 comments
5,861 views