Rephrase conditional control statements, PL-SQL Programming

Rephrase Conditional Control Statements

When computing a logical expression, the PL/SQL uses short-circuit evaluation. That is, the PL/SQL stops evaluating the expression as soon as the result can be determined. For illustration, in the OR expression below, when the value of sal is less than 1500, the left operand yields TRUE, Therefore PL/SQL need not evaluate the right operand (as OR returns TRUE if either of its operands is true):

IF (sal < 1500) OR (comm IS NULL) THEN



Now, consider the AND expression shown below:


IF credit_ok(cust_id) AND (loan < 5000) THEN



The Boolean function credit_ok is forever called. Though, if you switch the operands of AND as shown:


IF (loan < 5000) AND credit_ok(cust_id) THEN



The function is called only if the expression loan < 5000 is true (as AND returns TRUE only if both its operands are true). The similar idea applies to the EXIT-WHEN statements.

Posted Date: 10/5/2012 5:01:48 AM | Location : United States

Related Discussions:- Rephrase conditional control statements, Assignment Help, Ask Question on Rephrase conditional control statements, Get Answer, Expert's Help, Rephrase conditional control statements Discussions

Write discussion on Rephrase conditional control statements
Your posts are moderated
Related Questions
Data Types in SQL - Timestamp TIMESTAMP for values representing points in time on a specified uniform scale. DATE is used for timestamps on a scale of one day, such as DATE '2

Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign

Natural Join - SQL In the absence of NATURAL JOIN Example has to be replaced by something rather more longwinded, as shown in Example. Example: Joining IS_CALLED and IS_EN

DELETE Command - SQL Loosely speaking, DELETE removes some existing rows from its target table. Suppose the university decides that course C3 is to be withdrawn. Example shows

Parameter and Keyword Description: select_item: This select_item is a value returned by the SELECT statement, and then assigned to the equivalent variable or field in the

Project Description: I am looking to change FullCalendar to add/delete sql server data when events are removed or dropped from Calendar. Events should only be included by dra

Restriction in SQL Syntax: SELECT DISTINCT StudentId FROM IS_CALLED WHERE Name = 'Boris' The WHERE clause operates on the result of the FROM clause in analogo

NULL Statement The NULL statement clearly specifies in action; it does nothing other than to pass control to the next statement. It can, though, improve the readability. In a

SQL Operators The PL/SQL uses all the SQL set, comparison, and row operators in the SQL statements. This part briefly describes some of these operators.  1. Comparison Opera

If two relations R and S are joined, then the non matching tuples of both R and S are ignored in __________________.