How To Hide Ora-06512 And Ora-04088 Error Messages
Contents |
#42560] Thu, 10 April 2003 02:05 Amit Gawde Messages: 1Registered: April 2003 Junior Member i have created following trigger. create or replace trigger amit_123_trig before insert on amit_123 ora-20111 error for each row begin if :new.col2 > 50 then raise_application_error(-20001, 'Value exceeds 50',
Raise_application_error
FALSE); end if; end; After executing this statement "insert into amit_123 (col1, col2) values (sysdate, 80)" it gives error ERROR at line 1: ORA-20001: Value exceeds 50 ORA-06512: at "DEMO1.AMIT_123_TRIG", line 11 ORA-04088: error during execution of trigger 'DEMO1.AMIT_123_TRIG' which is correct. I want to hide display of "ORA-06512: at "DEMO1.AMIT_123_TRIG", line 11 ORA-04088: error during execution of trigger 'DEMO1.AMIT_123_TRIG'" error message to user. Is it possible ? and if yes how ? Report message to a moderator Re: Hide oracle trigger error message [message #43459 is a reply to message #42560] Wed, 23 July 2003 03:52 Anand Messages: 161Registered: August 1999 Senior Member Hi Through exception hadelling u can hide error messages Eg, CREATE OR REPLACE PROCEDURE P1 (A NUMBER) as BEGIN If A < 10 THEN raise_application_error(-20000,'error value'); end if; exception when others then if sqlcode = -20000 then dbms_output.put_line(sqlerrm); end if; END; Report message to a moderator Previous Topic: Updation of Oracle database to another system?? Next Topic: WHT'S WRONG WITH QUERY Goto Forum: - SQL & PL/SQLSQL & PL/SQLClient Tools- RDBMS ServerServer AdministrationBackup & RecoveryPerformance TuningSecurityNetworking and GatewaysEnterprise ManagerServer Utilities- Server OptionsRAC & FailsafeData GuardReplicationStreams & AQSpatialText & interMedia- Developer & ProgrammerApplication Express, ORDS & MOD_PLSQLFormsReports & DiscovererDesignerJDeveloper, Java & XMLWarehouse BuilderPrecompilers, OCI & OCCI- Fusion Middleware & Colab SuiteWeblogic & Application ServerBusiness IntelligenceWebCenter Suite & PortalCollaboration & Content ManagementSOA Suite, BPEL and OWSM- ApplicationsOracle Fusion Apps & E-Business SuitePeopleSoft, JD Edwards & SiebelPrimaveraOther Application Suites- InfrastructureHardwareUnixLinuxWindowsOther Operating Systems- Open SourceProgramming InterfacesMySQL- OtherGeneralTraining & CertificationMarketplaceCommunity HangoutSuggestions & FeedbackTest- Non-English ForumsArabicDutchFrenchGermanJapanesePortugueseRussianSpanish -=] Back to Top [=- [ Syndicate this forum (XML) ] [ ] Current Time: Mon Oct 17 13:24:58 CDT 2016 Total time taken to generate the page: 0.44801 seconds .:: Forum Home :: Blogger Home :: Wiki Home :: Contact :: Privacy ::.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Exclude Extra Error Information from RAISE_APPLICATION_ERROR up vote 1 down vote favorite I have raised an error http://www.orafaq.com/forum/t/15028/ message in a PL/SQL trigger and it works fine except that it returns more than the error I specify to the application. In addition to the custom error I get information about the line that the error happened on and the trigger. For example it will get ORA-20111: There is a custom error here ORA-06512: at "{schema_name}.{trigger_name}", LINE 2 ORA-04088: error during execution of trigger {schema_name}.{trigger_name}
.Operation canceled. What I actually want http://stackoverflow.com/questions/30390529/exclude-extra-error-information-from-raise-application-error is: ORA-20111: There is a custom error here How do I remove the extra information from the error message before it is returned to my application? My testing code below... CREATE OR REPLACE TRIGGER CUSTOM_ERROR BEFORE INSERT OR UPDATE ON {SCHEMA_NAME}.{TABLE_NAME} FOR EACH ROW BEGIN RAISE_APPLICATION_ERROR(-20111, 'There is a custom error here'); END; oracle plsql error-handling exception-handling oracle11g share|improve this question edited May 22 '15 at 7:29 Lalit Kumar B 26.9k82547 asked May 22 '15 at 7:14 user1567453 404415 And your code looks like? i don't see any code you posted. How are you handling the exceptions? –Lalit Kumar B May 22 '15 at 7:16 @LalitKumarB There is no handling. Adjusted the code for you. I want the user to see this error from the application. It just shows the error it receives from Oracle. I want the error to be EXACTLY what I put in the RAISE_APPLICATION_ERROR and nothing more –user1567453 May 22 '15 at 7:23 But that is not going to be helpful by not raising already-defined exception and having ONLY user-defined exception. –Lalit Kumar B May 22 '15 at 7:27 @LalitKumarB The important thing to address is my question and not if what I need is useful from other points of view. –us
05 Member No.: 2,783 Hi Everybody,This looked to me very simple but I don't know what wrong am I doing.I need to write a trigger on a table that would restrict insert on that table.Here is the code I wrotecreate or replace trigger trigg_inspect After insert or update how to or delete on inspectfor each rowbeginIF INSERTING thenraise_application_error(-20100,'Insert not allowed');End if;Now when I try to insert for eginsert into inspect values('GHI');ERROR at line 1:ORA-20100: Insert not allowedORA-06512: at "KM.TRIGG_INSPECT", line 4ORA-04088: error during execution of trigger 'KM.TRIGG_INSPECT'Insert Not allowed is being show with correct error message.But the rest of the how to hide errors I am not getting them. Looked into ora error messagesHow can hide that other oracle error i.e ORA-06512 and ORA-04088. i can trace error in my application but when user insert on SQL prompt then all messeges show whereas i want to display only my own error mesg.Is there any way to handle this in trigger or any other way to hide last two errorsThanks « Next Oldest · Oracle Forum · Next Newest » 2 User(s) are reading this topic (2 Guests and 0 Anonymous Users) 0 Members: Forum Home Search Help Oracle |-- Oracle Forum Display Mode: Standard · Switch to: Linear+ · Switch to: Outline Track this topic · Email this topic · Print this topic · Subscribe to this forum Lo-Fi Version Time is now: 17th October 2016 - 01:23 PM Powered By Invision IPB © 2016 IPS, Inc.