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.

Oracle PL/SQL: Check If BLOB or CLOB is Empty

Oracle PL/SQL: Check If BLOB or CLOB is Empty

In Oracle PL/SQL, to check if BLOB or CLOB is empty or not, use the dbms_lob.getlength() function or dbms_lob.compare() function. Here are the examples: 1. Using dbms_lob.getlength() Function declare vblob blob; Cursor c_blob is select content into vblob from employee_docs…

How to Convert Number to String in Oracle?

How to Convert Number to String in Oracle?

In Oracle, you can convert a number to string using the TO_CHAR() function; however, you can simply assign a numeric value to a string variable without using any function in Oracle. Below are the examples. 1. Convert Number to String…

Oracle Autonomous Transaction Example

Oracle Autonomous Transaction Example

In Oracle, an autonomous transaction can commit or rollback the data in the same session without committing or rolling back in the main transaction. PRAGMA (compiler directive) statement is used to define autonomous transaction in Oracle. The following is an…

How to Encrypt Password in Oracle?

How to Encrypt Password in Oracle?

Here I am giving an example to encrypt the password in Oracle using the DBMS_CRYPTO package. To demonstrate this, I have created the following table to store user ID (USER_ID) varchar2 data type and to store the encrypted password (ENC_PSW)…

How To Truncate Table In Oracle Procedure?

How To Truncate Table In Oracle Procedure?

In Oracle, TRUNCATE command is a DDL statement, so you can not execute it directly in Oracle Procedure. To execute DDL commands in Oracle procedure, use EXECUTE IMMEDIATE statement. The below is an example of truncating a table in Oracle procedure…