Skip to main content
TopMiniSite

Back to all posts

What Is the Equivalent For @@Error In Oracle?

Published on
3 min read
What Is the Equivalent For @@Error In Oracle? image

Best Database Error Handling Solutions to Buy in November 2025

1 Cassida InstaCheck Small Footprint, Easy to Read Automatic Counterfeit Detector with Infrared, Magnetic and Ultraviolet Sensors, Compact and Lightweight Grey 11-3/4" x 9-1/2"

Cassida InstaCheck Small Footprint, Easy to Read Automatic Counterfeit Detector with Infrared, Magnetic and Ultraviolet Sensors, Compact and Lightweight Grey 11-3/4" x 9-1/2"

  • CONFIRM BILL AUTHENTICITY IN UNDER A SECOND-FAST AND RELIABLE!
  • ADVANCED TECH SCANS BILLS AGAINST A VAST DATABASE FOR ACCURACY.
  • COMPACT, AFFORDABLE SOLUTION FROM AMERICA'S TRUSTED CASH HANDLING BRAND!
BUY & SAVE
$120.99 $161.48
Save 25%
Cassida InstaCheck Small Footprint, Easy to Read Automatic Counterfeit Detector with Infrared, Magnetic and Ultraviolet Sensors, Compact and Lightweight Grey 11-3/4" x 9-1/2"
2 Flash drive, wellsenn USB Flash Drive 32 GB X 5 Bulk Memory Stick Jump Drive External Drives USB Stick USB Storage Portable Thumb Drive Pen Drive Pack 5 Mixed Coler (Red, Blue, Green, Purple and Orang

Flash drive, wellsenn USB Flash Drive 32 GB X 5 Bulk Memory Stick Jump Drive External Drives USB Stick USB Storage Portable Thumb Drive Pen Drive Pack 5 Mixed Coler (Red, Blue, Green, Purple and Orang

  • VERSATILE FORMATS: STORE AND SHARE MUSIC, PHOTOS, AND DOCUMENTS EFFORTLESSLY.

  • PLUG-AND-PLAY DESIGN: EASY TO USE WITH LAPTOPS, TVS, AND GAMING CONSOLES.

  • WIDE COMPATIBILITY: WORKS WITH ALL MAJOR OS AND DEVICES, NO DRIVERS NEEDED.

BUY & SAVE
$16.99
Flash drive, wellsenn USB Flash Drive 32 GB X 5 Bulk Memory Stick Jump Drive External Drives USB Stick USB Storage Portable Thumb Drive Pen Drive Pack 5 Mixed Coler (Red, Blue, Green, Purple and Orang
3 Cassida Omni-ID 2-in-1 Currency Counterfeit Detector with UV Identification Verification Lights – Bill Checker with Infrared, Magnetic and Ultraviolet Sensors - Easy to Read PASS/FAIL Display

Cassida Omni-ID 2-in-1 Currency Counterfeit Detector with UV Identification Verification Lights – Bill Checker with Infrared, Magnetic and Ultraviolet Sensors - Easy to Read PASS/FAIL Display

  • INSTANT VERIFICATION: CONFIRM BILLS' AUTHENTICITY IN UNDER A SECOND!

  • DUAL DETECTION TECHNOLOGY: INFRARED AND UV CHECKS FOR ULTIMATE SECURITY.

  • TRUSTED BRAND: CASSIDA - AMERICA'S #1 IN CURRENCY HANDLING SOLUTIONS!

BUY & SAVE
$159.99
Cassida Omni-ID 2-in-1 Currency Counterfeit Detector with UV Identification Verification Lights – Bill Checker with Infrared, Magnetic and Ultraviolet Sensors - Easy to Read PASS/FAIL Display
4 Flash Drive, wellsenn USB Flash Drive 1,2,4,8 GB X 10 Bulk Memory Stick Jump Drive External Drives USB Stick USB Storage Portable Thumb Drive Pen Drive Pack 10 Mixed Coler (32GB10COLOR)

Flash Drive, wellsenn USB Flash Drive 1,2,4,8 GB X 10 Bulk Memory Stick Jump Drive External Drives USB Stick USB Storage Portable Thumb Drive Pen Drive Pack 10 Mixed Coler (32GB10COLOR)

  • VERSATILE DATA STORAGE FOR MUSIC, PHOTOS, MOVIES, AND MORE!
  • COMPACT DESIGN FOR EASY PLUG-AND-PLAY USE ACROSS DEVICES.
  • COMPATIBLE WITH MULTIPLE OS AND COMES IN A 10-PACK FOR VALUE.
BUY & SAVE
$29.99
Flash Drive, wellsenn USB Flash Drive 1,2,4,8 GB X 10 Bulk Memory Stick Jump Drive External Drives USB Stick USB Storage Portable Thumb Drive Pen Drive Pack 10 Mixed Coler (32GB10COLOR)
5 Western Digital 4TB WD Red NAS Internal Hard Drive HDD - 5400 RPM, SATA 6 Gb/s, SMR, 256MB Cache, 3.5" - WD40EFAX

Western Digital 4TB WD Red NAS Internal Hard Drive HDD - 5400 RPM, SATA 6 Gb/s, SMR, 256MB Cache, 3.5" - WD40EFAX

  • HIGH CAPACITY OPTIONS: 2-6TB, PERFECT FOR STORAGE NEEDS.

  • RELIABLE PERFORMANCE: OPTIMIZED FOR NAS WITH 5400RPM SPEED.

  • 3-YEAR WARRANTY: PEACE OF MIND FOR YOUR DATA STORAGE INVESTMENT.

BUY & SAVE
$124.50 $140.07
Save 11%
Western Digital 4TB WD Red NAS Internal Hard Drive HDD - 5400 RPM, SATA 6 Gb/s, SMR, 256MB Cache, 3.5" - WD40EFAX
6 Kingston Digital 128GB Data Traveler SE9 G2 USB 3.0 (DTSE9G2/128GB)

Kingston Digital 128GB Data Traveler SE9 G2 USB 3.0 (DTSE9G2/128GB)

  • SLEEK CAPLESS DESIGN FOR EFFORTLESS PORTABILITY AND USE.
  • LIGHTNING-FAST USB 3.0 FOR QUICK AND EASY DATA TRANSFERS.
  • HUGE 128 GB CAPACITY TO STORE ALL YOUR IMPORTANT FILES ON-THE-GO.
BUY & SAVE
$26.99
Kingston Digital 128GB Data Traveler SE9 G2 USB 3.0 (DTSE9G2/128GB)
7 Samsung SSD 860 PRO 2TB 2.5 Inch SATA III Internal SSD (MZ-76P2T0BW)

Samsung SSD 860 PRO 2TB 2.5 Inch SATA III Internal SSD (MZ-76P2T0BW)

  • EXPERIENCE LIGHTNING-FAST SPEEDS: UP TO 560MB/S READ, 530MB/S WRITE!
  • SECURE YOUR DATA WITH AES 256-BIT HARDWARE-BASED ENCRYPTION.
  • VERSATILE COMPATIBILITY: SUPPORTS WINDOWS, MAC, AND LINUX SYSTEMS.
BUY & SAVE
$499.99
Samsung SSD 860 PRO 2TB 2.5 Inch SATA III Internal SSD (MZ-76P2T0BW)
8 Western Digital 1TB WD Gold Enterprise Class Internal Hard Drive - 7200 RPM Class, SATA 6 Gb/s, 128 MB Cache, 3.5" - WD1005FBYZ

Western Digital 1TB WD Gold Enterprise Class Internal Hard Drive - 7200 RPM Class, SATA 6 Gb/s, 128 MB Cache, 3.5" - WD1005FBYZ

  • MASSIVE CAPACITY OPTIONS: 1TB TO 20TB FOR ALL STORAGE NEEDS!

  • BUILT TO LAST: HANDLES UP TO 550TB OF DATA YEARLY!

  • INNOVATIVE TECH: VIBRATION PROTECTION & HELIOSEAL FOR EFFICIENCY!

BUY & SAVE
$101.49 $109.99
Save 8%
Western Digital 1TB WD Gold Enterprise Class Internal Hard Drive - 7200 RPM Class, SATA 6 Gb/s, 128 MB Cache, 3.5" - WD1005FBYZ
9 Western Digital 6TB WD Red NAS Internal Hard Drive HDD - 5400 RPM, SATA 6 Gb/s, SMR, 256MB Cache, 3.5" - WD60EFAX

Western Digital 6TB WD Red NAS Internal Hard Drive HDD - 5400 RPM, SATA 6 Gb/s, SMR, 256MB Cache, 3.5" - WD60EFAX

  • FLEXIBLE CAPACITY OPTIONS: 2-6TB, IDEAL FOR ANY NAS SETUP!
  • OPTIMIZED FOR DAILY TASKS WITH 5400RPM PERFORMANCE.
  • RELIABLE NASWARE FIRMWARE ENHANCES COMPATIBILITY AND EFFICIENCY.
BUY & SAVE
$179.00
Western Digital 6TB WD Red NAS Internal Hard Drive HDD - 5400 RPM, SATA 6 Gb/s, SMR, 256MB Cache, 3.5" - WD60EFAX
+
ONE MORE?

In Oracle, the equivalent for @@error in SQL Server is the SQLCODE function. SQLCODE returns the numeric error code for the last executed SQL statement. It is often used in conjunction with the SQLERRM function, which returns the error message associated with the error code. Together, SQLCODE and SQLERRM can be used to handle and display errors in Oracle PL/SQL code.

How to rollback transactions in case of errors in Oracle?

To rollback a transaction in Oracle in case of errors, you can use the ROLLBACK statement. Here is how you can rollback a transaction when an error occurs:

  1. Use a BEGIN...END block to start a transaction and catch any errors:

BEGIN -- Start transaction INSERT INTO table_name (column1, column2) VALUES (value1, value2); -- Commit the transaction COMMIT; EXCEPTION -- Rollback the transaction if an error occurs WHEN OTHERS THEN ROLLBACK; END;

  1. Alternatively, you can use the SAVEPOINT statement to create a savepoint in the transaction and rollback to that savepoint if an error occurs. Here is an example:

SAVEPOINT start_transaction; -- Start transaction INSERT INTO table_name (column1, column2) VALUES (value1, value2);

-- If an error occurs, rollback to the savepoint ROLLBACK TO start_transaction;

Remember to always rollback a transaction in case of errors to ensure data consistency and integrity.

How to raise custom errors in Oracle?

In Oracle PL/SQL, you can raise custom errors using the RAISE_APPLICATION_ERROR procedure. This procedure allows you to raise an error with a user-defined error code and message.

Here is an example of how to use the RAISE_APPLICATION_ERROR procedure to raise a custom error:

DECLARE custom_error EXCEPTION; BEGIN RAISE custom_error; END; /

In this example, we declare a custom error named custom_error and then use the RAISE statement to raise the error. You can also provide an error number and error message as arguments to the RAISE statement, like this:

DECLARE custom_error EXCEPTION; BEGIN RAISE_APPLICATION_ERROR(-20001, 'This is a custom error message.'); END; /

In this example, we are raising a custom error with an error code of -20001 and a custom error message.

You can then handle these custom errors in your PL/SQL blocks using exception handling techniques.

What is the difference between RAISE_APPLICATION_ERROR and @@error in Oracle?

RAISE_APPLICATION_ERROR is a built-in procedure in Oracle PL/SQL that allows you to raise a custom exception with a user-defined error code and message. This can be used to handle errors and communicate specific error messages to the user or application.

On the other hand, @@error is a system function in SQL Server that allows you to retrieve the error number generated by the last executed statement. It is used to check for errors in T-SQL code and take appropriate actions based on the error number.

In summary, RAISE_APPLICATION_ERROR is used to raise custom exceptions with specific error codes and messages in PL/SQL, while @@error is used to retrieve error numbers in SQL Server.