PL/SQL Decode

The Decode function compares one expression to one or more other expressions and, when the search term is found, returns the match result expression. Decode syntax DECODE (expression , search, result [, search , result]… [, default]) Decode example STUDENT_ID FIRST_NAME LAST_NAME CITY 1 Daniel SCOTT New York 2 Anthony SIMMONS Chicago 3 Sophia THOMPSON…(Continue Reading)

PL/SQL Instr

The INSTR function in Oracle PL/SQL is a function that returns the position of a specified substring within a string. The syntax for the function is as follows: INSTR(string, substring, [start_position], [nth_appearance]). The string parameter is the string to search in, the substring parameter is the string to search for, the start_position parameter is an…(Continue Reading)

PL/SQL Case

In Oracle PL/SQL, the CASE statement is used to perform different actions based on the value of an expression. The CASE statement can be used in two forms: simple and searched. The simple form of the CASE statement has the following syntax: CASE syntax CASE WHEN operator {content_operator THEN {statement;} … …} [ELSE {statement;}…] END…(Continue Reading)

PL/SQL For – Loop

In Oracle PL/SQL, a FOR loop is used to repeatedly execute a block of code a specified number of times. The basic syntax of a FOR loop is as follows: FOR … LOOP syntax FOR loop_variable IN [REVERSE] start_value..end_value LOOP –pl/sql statements END LOOP; The loop_variable is a variable that will take on the value…(Continue Reading)

PL/SQL While – Loop

A WHILE loop in Oracle PL/SQL is used to repeatedly execute a block of statements as long as a given condition is true. The syntax for a WHILE loop is as follows: The condition is a boolean expression that is evaluated before each iteration of the loop. If the condition is true, the statements inside…(Continue Reading)