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
Scoping Within the similar scope, all the declared identifiers should be unique. So, even if their datatypes differ, the variables and parameters cannot share the similar name.

Example of Foreign Key Constraint Example: Alternative formulation for 6.3 as a foreign key constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Must_be_enrolled_to_take_exam

Need for Dynamic SQL: You need dynamic SQL in the situations as follows: 1) You would like to execute a SQL data definition statement (like CREATE), a data control statemen

What is Cursors how to use it in Real time application ?

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 s

Many of the reports generated from the system calculate the total dollars in a shopper''s purchases. Follow these steps to create a function named TOT_PURCH_SF that accepts a shopp

EXIT The EXIT statement forces a loop to done unconditionally. Whenever an EXIT statement is encountered, the loop is done immediately and controls the passes to the next statem

%ROWCOUNT The %ROWCOUNT yields the number of rows affected by the INSERT, UPDATE, or DELETE statement, or returned by a SELECT INTO statement. The %ROWCOUNT yields zero when a

Interesting properties of CROSS JOIN - SQL Compare these with the "interesting properties of JOIN", CROSS JOIN is associative but not commutative. Unlike JOIN and NATURAL JOI

Oracle 11 G new features associated with this release:- Enhanced ILM  - Information Lifecycle Management (ILM) has been around for the almost 10 years, but Oracle has made