Operator precedence-pl/sql expressions , PL-SQL Programming

Operator Precedence

The operations within an expression are completed in a particular order depending on their precedence (priority). The table shows the default order of the operations from first to last (from top to bottom).

1559_Operator Precedence.jpg

 

Table: Order of Operations


The Operators with higher precedence are applied first. In the illustration below, both the expressions yield 8 as the division has a higher precedence than addition. The Operators with similar precedence are applied in no particular order.


5 + 12 / 4
12 / 4 + 5

You can use the parentheses to control the order of the evaluation. For illustration, the expression below yields 7, not 11, as the parentheses override the default operator precedence:

(8 + 6) / 2


In the later example, the subtraction is completed before the division as the most deeply nested sub expression is always checked first:

100 + (20 / 5 + (7 - 3))

Posted Date: 10/3/2012 5:12:18 AM | Location : United States







Related Discussions:- Operator precedence-pl/sql expressions , Assignment Help, Ask Question on Operator precedence-pl/sql expressions , Get Answer, Expert's Help, Operator precedence-pl/sql expressions Discussions

Write discussion on Operator precedence-pl/sql expressions
Your posts are moderated
Related Questions
What Is a Package? The package is a schema object that group logically related PL/SQL items, types, and subprograms. The Packages usually have 2 parts, a specification & a bo

Inner Join We have learned how to retrieve data from one table by using SELECT statement. But, as we have learned, normalized relational databases mean the data is spread betw

Data Types in SQL - Decimal DECIMAL, NUMERIC, REAL, FLOAT and various other terms for various sets of rational numbers. When these key words are specified for the declared typ

Using the BULK COLLECT Clause The keywords BULK COLLECT specify the SQL engine to bulk-bind output collections before returning them to the PL/SQL engine. You can use these ke

FORALL Statement The FORALL statements instruct the PL/SQL engine to bulk-bind the input collections before sending them to the SQL engine. Though the FORALL statement consists

FETCH Statement The FETCH statement retrieve rows of data one at a time from the result set of the multi-row query. The data is stored in fields or variables which correspond t

Manipulating Individual Elements Faraway you have manipulated an entire collection. Within the SQL, to manipulate the individual elements of the collection, and then use the ope

Iteration Schemes The bounds of a loop range can be variables, literals, variables, or expressions but must compute to integers. Below are some of the examples. As you can see t

Assignment of Variable - Updating a Variable Syntax: SET SN = SID ('S2'); This can obviously be read as "set the variable SN to be equal in value to SID ( 'S2' )".

Challenge 1 You are required to do the project and write a test plan for it. Demo 4 is a check writer program for employees. In it, the user enters all information about the