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…
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…
In this article, I am giving an example to export data into JSON file in Oracle 11g using PL Follow These Steps to Export Data into JSON File in Oracle 11g Now you can generate the JSON file from Oracle…
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…
In this tutorial, I am giving an example to return resultset from a stored procedure in Oracle using sys_refcursor. Follow these steps to return resultset from a stored procedure in Oracle. 1. Create a Stored Procedure in Oracle The following…
In this tutorial, I am giving an Oracle FOR LOOP SELECT statement example. You can use SELECT statement inside FOR LOOP in Oracle to loop through SELECT results using PL FOR LOOP IN SELECT Syntax FOR cursor_variable IN (select_statement) LOOP…
In Oracle PL/SQL, IF condition is used to perform a logical check on certain values. If the condition is TRUE or FALSE then executes the statements followed by that condition. In this blog post, I am giving an Oracle IF…
In Oracle PL/SQL, WHILE LOOP statement executes the code written between WHILE LOOP and END LOOP until the condition is true. Below I am giving some examples for Oracle WHILE LOOP statement. Syntax WHILE logical_condition LOOP -- some PL/SQL code END…
In Oracle PL/SQL, FOR LOOP with REVERSE clause is used to repeat loop iteration in reverse order. The following are the syntax and examples for REVERSE FOR LOOP. Syntax FOR n IN REVERSE start_number .. end_number LOOP -- statement to execute…
Below is an example of PL/SQL program to compile all invalid package specifications and all invalid package bodies for the current user (SCHEMA) in Oracle. Also, if any of the invalid packages are not successfully compiled then it will print…
In this tutorial, you will learn how to delete the records from a table in Oracle using PL In Oracle PL/SQL, we can delete the records using DELETE DML Statement and be using TRUNCATE DDL command. I am giving below…
In this tutorial, you will learn how to print employee details using PL/SQL program. PL/SQL Program to Print Employee Details In the following example, it will print the employee details for the employee number 7839, set in the declare section…
In Oracle PL/SQL, UTL_FILE.FREMOVE procedure is used to delete a file from the disk. This tutorial explains how to delete a file in Oracle PL/SQL using UTL_FILE.FREMOVE procedure with syntax and example. Syntax UTL_FILE.FREMOVE ( location IN VARCHAR2, filename IN…
In Oracle PL/SQL, UTL_FILE.FCOPY procedure is used to copy a file. This article explains how to copy a file in PL/SQL using UTL_FILE.FCOPY procedure with syntax and examples. Syntax UTL_FILE.FCOPY ( src_location IN VARCHAR2, src_filename IN VARCHAR2, dest_location IN VARCHAR2, dest_filename…
You can raise an error in PL/SQL using user-defined exception. Steps to Raise An Exception in PL/SQL Declare user-defined exception in the declare section of PL/SQL program unit. Raise it between the program upon some condition. Handle it in the…
In Oracle PL/SQL, the For Loop offers one of the simplest ways to work with cursors. The key benefit when using a cursor in this format is that Oracle automatically manages the lifecycle of the cursor—that is, opening, fetching records,…
The utl_file.fopen function in Oracle is an essential tool for file handling on the server. It allows Oracle database code, such as PL/SQL procedures or functions, to open and access files stored in specific, predefined directories on the database server.…
If you are working with Oracle, you will often need to execute PL/SQL blocks to test logic, fetch data, or print results. Running a PL/SQL block is easy, and you can do it in different ways depending on which tool…
In PL/SQL, you can use the raise_application_error procedure to throw custom error messages when a specific condition is not met in your code. This is especially helpful when you want to enforce business rules or validation checks within your stored…