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
Example of COALESCE operator Example: Give the total of marks for each exam (simplified solution) SELECT CourseId, COALESCE ((SELECT SUM (Mark) FROM EXAM_MARK AS EM

WHILE-LOOP The WHILE-LOOP statement relates a condition with the series of statements enclosed by the keywords LOOP and END LOOP, as shown: WHILE condition LOOP sequence_of_sta

Based on the EMPLOYEE table created in Assignment #1, write a PL/SQL anonymous block that accepts an employee ID from the user input and finds whether the employee ID is in the EMP

Use the MASCOT tables CREDITRS, PORDS and PAYMENTS to write SQL queries to solve the following business problems. These tables / data are available to you via the USQ Oracle server

THEO R Y OF CATASTROPHISM OR CATALYSM (CUVIER 1769-1832) - The world has passed thorugh several stages and at the end of each stage there was a catastrophe killing all the

Block Structure The PL/SQL is a block-structured language. That is, the fundamental units (procedures, anonymous blocks, and functions) that make up a PL/SQL program are logi

I have a Pascal Source file that needs to be compiled into a Service. In addition, there are various functions (Pascal Procedures I guess) that need to be created to Read and Write

EXCEPTION_INIT Pragma The pragma EXCEPTION_INIT relates an exception name with an Oracle error number. Which allow you to refer to any internal exception by the name and to wri

Functions The function is a subprogram which can take parameters and be invoked. Normally, you can use a function to calculate a value. The function has 2 sections: the specifi