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
heap sort program in pl/sql

ROWID and UROWID Internally, every database table has a ROWID pseudo column that stores binary values known as rowids. Each rowid shows the storage address of a row. A physical

An analyst in the quality assurance office reviews the time lapse between receiving an order and shipping an order. Any orders that have not been shipped within a day of the order

Procedures   The procedure is a subprogram which performs a specific action. You write procedures using the syntax as shown below: PROCEDURE name [(parameter[, parameter, .

Updating by replacement Syntax: UPDATE ENROLMENT SET Name = 'Ann' WHERE StudentId = SID ('S1'); Note the use of SET, as already noted in connection with direct a

UNION and OR - SQL SQL supports UNION explicitly but differently from the way it supports JOIN explicitly. As we have seen, JOIN is used exclusively within the FROM clause, su

DBMS_PIPE: The Package DBMS_PIPE allows various sessions to communicate over the named pipes. (A pipe is a region of memory used by one of the process to pass information to

Use of COUNT in SQL It describes and discusses various general methods of expressing constraints, eventually noting that support for "=" with relation operands is sufficient f

LONG and LONG RAW You use the LONG datatype to store the variable-length character strings. The LONG datatype is such as the VARCHAR2 datatype, except that the maximum length o

Database Values You can use the SELECT statement to have the Oracle assign values to a variable. For Each and every item in the select list, there must be a matching, type-compa