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
Nested Tables versus Index-by Tables The Index-by tables and nested tables are just similar. For e.g.  They have similar structure and their individual elements are accessed in

THEO R Y OF SPECIAL CREATION - Life originated on the earth due to natural events by the super natural power. The biblical story of creation of world within six days was p

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

Difference between 9i & 10G When Oracle releases any new databases then it are having some discrepancy with them. But 10G is having much difference than oracle 9i has. Oracle

Multiple Assignment- SQL SQL supports multiple assignment to local variables and also applies multiple assignment semantics in SET clauses of UPDATE statements, but does not

Bulk Binds advantages In the Embedded Oracle RDBMS, the PL/SQL engines accept any valid PL/SQL subprogram or block. As the figure shows, the PL/SQL engine executes all procedur

Parameter and Keyword Description: cursor_variable_name: This identifies a cursor variable or the parameter formerly declared within the present scope. host_cursor_va

Create a procedure named STATUS_SHIP_SP that allows a company to employee in the Shipping Department to update the status of an order to add shipping information. The BB_BASKETSTAT

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

Third Step at defining type SID in SQL CREATE DOMAIN SID AS VARCHAR(5) CHECK ( VALUE IS NOT NULL AND SUBSTRING(VALUE FROM 1 FOR 1) = 'S' AND CAST('+'||SUBSTRING(VALUE