Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:06:39+00:00 2026-06-16T03:06:39+00:00

In my application oracle procedure is currently called through unix script, when there is

  • 0

In my application oracle procedure is currently called through unix script, when there is error in exception block we are handling something like this :-

PROC_LOGS('<PROC_NAME>', <TABLE_NAME>, 'Exception','Exception occured - '||SQLERRM);

PROC_LOG does nothing but inserts entry into log table but we need now to catch that error in unix also (return some value except 0) from where is it called so remaining process can be terminated best on that, what is the best way to do this?

CREATE OR REPLACE....
...
DECLARE
....
BEGIN
..
...
EXCEPTION
WHEN OTHERS THEN
PROC_LOGS('<PROC_NAME>', <TABLE_NAME>, 'EXCEPTION','EXCEPTION OCCURED - '||SQLERRM);
END;

Unix script part from where I m calling procedure

sqlplus <<-!
$US/$P@$I
set serveroutput on
@$SQL/execute_proc.sql $1 $2

execue_proc contains something like this :-

 define IN_1 = '&1';
  define IN_2 = '&2';

spool $SQL/test_&&IN
declare
 P_IN_TABLE_NAME varchar2(250) := '&&IN_TABLE_NAME';
 P_IN_REGION varchar2(250) := '&&IN_REGION';
begin
PROC_UPDATE_CHARGE_FACT(P_IN_TABLE_NAME,P_IN_REGION);
    end;

/
spool off
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:06:40+00:00Added an answer on June 16, 2026 at 3:06 am

    You need to raise the exception, like this:

    EXCEPTION
      WHEN OTHERS THEN
        PROC_LOGS('<PROC_NAME>', <TABLE_NAME>, 'EXCEPTION','EXCEPTION OCCURED - '||SQLERRM);
        RAISE;
    END;
    

    or use RAISE_APPLICATION_ERROR:

    EXCEPTION
      WHEN OTHERS THEN
        PROC_LOGS('<PROC_NAME>', <TABLE_NAME>, 'EXCEPTION','EXCEPTION OCCURED - '||SQLERRM);
        RAISE_APPLICATION_ERROR (-20002, 'An unexpected exception occurred.');
    END;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using an Oracle database(10g) which contains a stored procedure called Foo. Foo takes
My ASP.NET C# application is connection to an Oracle database, running a stored procedure,
I'm attempting to create a procedure in Oracle Express Server (Application Express 2.1.0.00.39) using
Actually I am calling oracle procedure from java file present at application server. I
I need to pass an array from C#.net application to oracle stored procedure. Can
So I'm trying to call an Oracle stored procedure from my C# .NET application.
Is there some function/procedure/package that validates a username and password in Oracle (from a
Oracle Application server 10g I need to run the long running reports in the
We are developing a Visual Studio.NET 2008 application with Oracle 9i as backend. Is
What is the best library/driver to connect C# (.NET) application to Oracle 10g and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.