Effects of null operator, PL-SQL Programming

Assignment Help:

Effects of NULL Operator

As a general rule-but not a universal one-if NULL is an argument to an invocation of a system-defined read-only operator, then NULL is the result of that invocation. As you can see, the code for HIGHER_OF includes A > B, an invocation of the system-defined read-only operator ">", which does follow the general rule. Hence, if NULL is substituted for either or both of the parameters A and B, then NULL- which in this case we can also call UNKNOWN because ">" is a Boolean operator-is the result of the invocation. You are perhaps now wondering how SQL handles the IF statement when the specified condition yields UNKNOWN: is the THEN clause evaluated, or is it the ELSE clause?

As you know, other programming languages are normally based on classical logic. In keeping with the existence of just two truth values, TRUE and FALSE, the syntax for IF statements (and IF expressions) in such languages has just the two forks, THEN for when the condition is TRUE, ELSE for when it is not (i.e., is FALSE). You might therefore reasonably expect a language that embraces n truth values to support a variety of IF that has n forks-under a language design principle that Fred Brooks referred to as conceptual integrity, which means adhering rigorously to the language's adopted concepts. Instead, SQL retains just the two forks, keeping the normal treatment of THEN as being the one for when the condition is TRUE and arbitrarily lumping UNKNOWN in with FALSE for the ELSE fork. You should now be able to see that the general rule ("NULL in, NULL out") for system-defined operators cannot be said to apply to user-defined ones. If A > B evaluates to UNKNOWN, then the result of the HIGHER_OF invocation is the argument substituted for B, which might or might not be NULL.


Related Discussions:- Effects of null operator

Group and having query, Using a join on 2 tables, select all columns and 10...

Using a join on 2 tables, select all columns and 10 rows from the 2 tables without the use of a Cartesian product. Query: SELECT * FROM EMPLOYEE1 E JOIN STAFF S ON E.EMP_

Collections in pl sql, Collections:   The collection is an ordered gr...

Collections:   The collection is an ordered group of elements, all of similar type (for illustration, the grades for a class of students). Each element has an exclusive subsc

Write sql queries, Write SQL queries to solve the following specifications....

Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT.  A screen dump of the output is acceptable. Show as many rows as you can. A screen dump i

Procedure, 1. Create a procedure called TAX_COST_SP to accomplish the tax c...

1. Create a procedure called TAX_COST_SP to accomplish the tax calculation task. Keep in mind that the state and subtotal values are inputs into the procedure and the procedure is

Example of table literal - sql, Example of Table Literal - SQL Exampl...

Example of Table Literal - SQL Example: A Table Literal (correct version) VALUES ('S1', 'C1', 'Anne'), ('S1', 'C2', 'Anne'), ('S2', 'C1', 'Boris'), ('S3', 'C3'

Translate the given er schema into sql, Consider the schema for FreeCheckin...

Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign

Union all - sql, UNION ALL - SQL Further varieties of UNION arise when...

UNION ALL - SQL Further varieties of UNION arise when we replace the key word DISTINCT by ALL in any of the foregoing examples, as in Example. ALL specifies that if row r appe

Calling constructors in pl sql, Calling Constructors: The Calls to a c...

Calling Constructors: The Calls to a constructor are allowed wherever the function calls are allowed. Similarly to the functions, a constructor is called as a section of an ex

Exceptions - syntax, Exceptions An exception is the runtime error or wa...

Exceptions An exception is the runtime error or warning condition that can be predefined or user-defined. The Predefined exceptions are raised implicitly through runtime system

Example of shorthand for a row constraint - sql, Example of Shorthand for a...

Example of Shorthand for a row constraint Example: Shorthand for a row constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Mark_in_range CHECK (Mark BETWEEN 0 AND 100);

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd