PLSQL

PL/SQL (Procedural Language for SQL) is Oracle's proprietary extension to standard SQL. It combines the data manipulation power of SQL with the procedural capabilities of a programming language. PL/SQL allows developers to write complex database-centric applications by incorporating variables, conditions, loops, error handling, and modular programming constructs like procedures and functions. This language is tightly integrated with Oracle databases, enabling efficient data processing and transaction management.

How to Check If File Exists in PL/SQL?

How to Check If File Exists in PL/SQL?

The following is a stored function example to check if a file exists in PL PL/SQL Function Example To Check If a File Exists The below function takes two parameters, one is for Oracle directory object name and the second…

How to Get File From BLOB in Oracle?

How to Get File From BLOB in Oracle?

In this tutorial, you will learn how to get a file from BLOB column in Oracle. To give an example, I have created a table EXT_FILES in Oracle and following is the structure of the table. CREATE TABLE EXT_FILES ( FILE_NAME…

Oracle Before Insert OR Update Trigger Example

The following is an Oracle BEFORE INSERT OR UPDATE Trigger example to perform validations while inserting or updating the records in EMP table. Oracle BEFORE INSERT OR UPDATE Trigger Example The below trigger will do the following two checks on…

Oracle Trigger WHEN Clause Example

In this article, you will learn how to use WHEN clause in Oracle trigger to make the trigger fire on the specified condition. Below is an example. You can test this trigger example by creating the following table and trigger…

Table Type in Oracle Stored Procedure Example

The following is an example of Oracle stored procedure, in which table type collection is used to process the data. Process Data Using Table Type in Oracle Stored Procedure Example Create the following tables and insert the data to test…

How to Compare Two Database Objects in Oracle?

In this tutorial, I am giving an example to compare two database table objects of different schemas using the DBMS_COMPARISON utility package in Oracle. Steps to Compare Two Table Objects in Oracle Using DBMS_COMPARISON Step-1 Create the comparison using DBMS_COMPARISON. In…

How to Get Current Date in PL/SQL?

The following are the examples to get the current date in PL Examples To Get The Current Date in PL/SQL 1. Using Sysdate Function SET SERVEROUTPUT ON; DECLARE d_current_date DATE; BEGIN d_current_date := SYSDATE; DBMS_OUTPUT.put_line ('The Date today is: '…

Resolve PLS-00323 Error in Oracle

The reason for the PLS-00323 error in Oracle is a mismatch in procedure or function declaration in the package specification and the package body. To resolve this take the following actions. Resolve PLS-00323 Error in Oracle Check the package specification…

How to Create Function in PL/SQL?

To create a function in PL/SQL, use CREATE OR REPLACE FUNCTION statement. Below are the syntax details and an example. Syntax CREATE [OR REPLACE] FUNCTION function_name [(parameters)]  Return data_type is /* declare variables here */ Begin /* write program logic…

How to Split a String in PL/SQL?

In this article, I am giving an example of a function which I mostly use to split a string in PL Especially, when I am writing a program to import a delimited file. Here are that function and an example…

Java in Oracle Database Example

In this tutorial, I am giving an example to implement Java code in Oracle Database using the stored function. We can create Java programs in the Oracle database by using CREATE OR REPLACE AND COMPILE JAVA SOURCE statement. After that, we can…