Order of evaluation-pl/sql expressions , PL-SQL Programming

Order of Evaluation

When you do not use the parentheses to specify the order of evaluation, the operator precedence determine the order. Now compare the expressions below:

NOT (valid AND done)         |       NOT valid AND done


When the Boolean variables valid and complete the value FALSE, the first expression yields TRUE. Though, the second expression yields FALSE as NOT has a higher precedence than AND. So, the second expression is equivalent to:

(NOT valid) AND done
In the example below, notice that if valid has the value FALSE, the entire expression yields FALSE regardless of the value of done:

valid AND done

Similarly, in the next illustration, when valid has the value TRUE, the entire expression yields TRUE regardless of the value of done:

valid OR done

Posted Date: 10/3/2012 5:17:40 AM | Location : United States







Related Discussions:- Order of evaluation-pl/sql expressions , Assignment Help, Ask Question on Order of evaluation-pl/sql expressions , Get Answer, Expert's Help, Order of evaluation-pl/sql expressions Discussions

Write discussion on Order of evaluation-pl/sql expressions
Your posts are moderated
Related Questions
#quesWrite a cursor to open an employee database and fetch the employee record whose age is greater than 45.tion..

Table Literals - SQL One might expect SQL to support table literals in the manner illustrated in Example 2.2, but in fact that is not a legal SQL expression. Example: Not a

ALTER TABLE bb_basketitem ADD CONSTRAINT bitems_qty_ck CHECK (quantity BEGIN INSERT INTO bb_basketitem VALUES (88,8,10.8,21,16,2,3); END; Brewbean’s wants to add a check

Using Host Arrays The Client-side programs can use anonymous PL/SQL blocks to bulk-bind input and output host arrays. However, this is the well-organized way to pass the colle

SQL Cursor   The Oracle implicitly opens a cursor to process each SQL statement not related with an explicit cursor. The PL/SQL refers to the most current implicit cursor as t

%ROWCOUNT When its cursor or cursor variable is opened, the %ROWCOUNT is zeroed. Before the first fetch, the %ROWCOUNT yields 0. Afterward, it yields the number of rows fetche

Semidifference via EXCEPT and JOIN - SQL SELECT * FROM (SELECT StudentId FROM IS_CALLED WHERE Name = 'Devinder' EXCEPT DISTINCT CORRESPONDING SELECT StudentId

Structure of an Object Type: Similar to package, an object type has 2 parts: the specification and the body. The specification is the interface to your applications; it declar

which operation is used if we are interested in only certain columns of a table?

Using Aliases The Select-list items fetched from a cursor related with the %ROWTYPE should have simple names or, if they are expressions, should have aliases. In the example bel