About 549,000 results
Open links in new tab
  1. PL/SQL IF Statement - Oracle Tutorial

    IF condition THEN statements; END IF; Code language: PostgreSQL SQL dialect and PL/pgSQL (pgsql) The condition is a Boolean expression that always evaluates to TRUE, FALSE, or NULL. If the condition evaluates to TRUE, the statements after the THEN execute.

  2. SQL "IF", "BEGIN", "END", "END IF"? - Stack Overflow

    Jan 10, 2012 · END construct is separate from the IF. It binds multiple statements together as a block that can be treated as if they were a single statement. Hence BEGIN ... END can be used directly after an IF and thus the whole block of code in the BEGIN ....

  3. If...End - docs.oracle.com

    If...End. An IF statement is executed based on the occurrence of a certain condition. IF statements must begin with the keyword IF and terminate with the keyword END. Components within IF statements can be connected with the keywords AND or OR.

  4. IF-THEN logic in SELECT and WHERE with CASE expressions in Oracle SQL

    Dec 7, 2023 · There’s no if keyword in SQL. If you want to do if-else-then logic in select, where or anywhere else in a statement, you need a case expression. This is a series of when clauses that the database runs in order: For example, if you want to map exam correct percentages to grade letters according to these rules:

  5. IF Statement - Oracle

    There are three forms of IF statements: IF-THEN, IF-THEN-ELSE, and IF-THEN-ELSIF. The simplest form of IF statement associates a Boolean expression with a sequence of statements enclosed by the keywords THEN and END IF. The sequence of statements is executed only if the expression returns TRUE.

  6. Oracle PL/SQL - Exit begin end block if condition is not met

    Nov 21, 2020 · Is it possible to exit/skip from a begin end block if a condition is not met? Example: DECLARE my_var BOOLEAN := TRUE; BEGIN IF my_var THEN EXIT_BEGIN_END_HERE; -- Exits the block but continue execution after it!

  7. 14.38 IF Statement - Oracle Help Center

    The IF statement either runs or skips a sequence of one or more statements, depending on the value of a BOOLEAN expression. ( boolean_expression ::= , statement ::= ) Expression whose value is TRUE, FALSE, or NULL. The first boolean_expression is always evaluated.

  8. Oracle / PLSQL: IF-THEN-ELSE Statement - TechOnTheNet

    This Oracle tutorial explains how to use the IF-THEN-ELSE statement in Oracle with syntax and examples. In Oracle, the IF-THEN-ELSE statement is used to execute code when a condition is TRUE, or execute different code if the condition evaluates to FALSE.

  9. IF THEN ENDIF in SQL - Ask TOM - Oracle Ask TOM

    Aug 18, 2016 · You can emulate IF THEN END in SQL using CASE: select case when exists (select null from dual) then 1 else 2 end case1, case when dummy = 'X' then 'dummy' else 'smart' end case2 from dual; CASE1 CASE2 1 dummy

  10. Oracle PL/SQL IF THEN ELSE Statement: ELSIF, NESTED-IF - Guru99

    Jun 28, 2024 · In this Oracle PL/SQL tutorial, we will learn Decision-Making Statements like If-Then, If-Then-Else, If-Then-Elsif, Nested-If.

  11. Some results have been removed
Refresh