Urgent.News

What's breaking now, across thousands of outlets.

Tech

Oracle PL/SQL Exception Handling

An Exception is a PL/SQL runtime error condition triggered during code execution. When an exception is raised, normal execution of the current PL/SQL block halts immediately, and control transfers to the EXCEPTION section. If an appropriate exception handler is present, final corrective actions are executed before the block exits; otherwise, the unhandled error propagates to the host environment.…

An Exception in PL/SQL is a runtime error that occurs during code execution. When an exception is raised, the current PL/SQL block stops immediately, and control moves to the EXCEPTION section. If an appropriate exception handler exists, any final corrective actions will be carried out before the block exits; otherwise, the unhandled error is passed to the host environment.

Exceptions in PL/SQL are categorized into three types: predefined Oracle server exceptions, non-predefined Oracle server exceptions, and user-defined exceptions.

Predefined Oracle Server Exceptions are common system errors with predefined names, such as NO_DATA_FOUND (ORA-01403) and TOO_MANY_ROWS (ORA-01422). These exceptions are automatically declared by Oracle and do not require explicit declaration in the code block. Non-Predefined Oracle Server Exceptions, on the other hand, handle standard Oracle server errors that lack explicit built-in names.

These exceptions need to be declared in the DECLARE section and associated with the specific Oracle server error number using PRAGMA EXCEPTION_INIT. User-Defined Exceptions are custom business logic violations defined by application developers and are declared in the DECLARE section using the RAISE or RAISE_APPLICATION_ERROR statements.

Only one exception handler can be executed per block execution, and a block can contain multiple exception handlers, but only one WHEN OTHERS clause is allowed. Exception handlers cannot be placed inside assignment statements or standard SQL statements. Oracle provides two key functions inside exception handlers to extract diagnostic data: SQLCODE, which returns the numeric error code, and SQLERRM, which returns the error message string corresponding to the SQLCODE.

These functions cannot be used directly inside SQL statements and must be assigned to local variables or used via standard PL/SQL wrapper statements.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The Automation Gap Is a Finance Workflow Problem, Not a Spreadsheet Problem

Recent fintech research has put a useful number on an old frustration: UK businesses are still losing several days a month to manual finance administration.

  • UK businesses lose days monthly to manual finance administration.
  • Finance workflow complexity, not spreadsheets, is primary problem.
  • Successful automation focuses on workflow, not just replacing tools.

The "DevRel Journey" Angle

Hello guy's I am Dilesh Zingare. And this is my first python code and also the first article ever written by me. So yeah I am excited and nervous to but as you know "Beyond fear lies victory." I just…

  • Dilesh Zingare shares debut Python code and first article on DEV Community
  • Introduces "Soul the Restro Waiter" project with bill, menu, and feedback features
  • Beginner Python developer seeks feedback on code and DevRel journey

I Built a Restaurant Website Using Only HTML – My First Frontend Project Series. Part-2

Hello and welcome to my 2nd part of My First Frontend Project Series. I am Dilesh Zingare and, If you didn't read the 1st part of the series believe me you have to read that you are missing something…

  • This is the second part of a series on building a restaurant website using only HTML.
  • The webpage includes clickable buttons and uses HTML structure like headings and div tags.

Plane vs Jira vs Linear (2026): The Open-Source Verdict

Verdict: In the Plane vs Jira vs Linear comparison for 2026, Plane is the strongest open-source Jira alternative and our pick for most small and mid-sized teams.

  • Plane is top open-source Jira alternative for small to mid-sized teams in 2026
  • Offers modern interface, self-hosted free with unlimited users
  • Less polished than Linear but provides data ownership control

More from Saturday 19 September →