![]() |
Working with Null Values![]() ![]() ![]() ![]() ![]()
A data field without a value in it is said to contain a null value. A null value is appropriate in two 10
situations:
Nulls in SQL Functions All scalar functions (except NVL and TRANSLATE) return null when given a null argument. The NVL function can be used to return a value when a null occurs. For example, the expression NVL(COMM,O) returns 0 if COMM is null or the value of COMM if it is not null. Most group functions ignore nulls. For example, consider a query that average the five values 1000, null,null,null and 2000. Such a query ignores the nulls and calculates the averages to be (1000+2000)/ 2 = 1500. Nulls with Comparison Operators To test for nulls, only use the comparison operators IS NULL and IS NOT NULL. If you use any other operator with nulls and the result depends on the value of the null, the result is unknown. Because null represents a lack of data, a null cannot be equal or unequal to any value or to another nun. However, note that ORACLE considers two nulls to be equal when evaluating a DECODE expression. Nulls in Conditions ORACLE treats conditions evaluating to unknown values as FALSE. For example, since the condition COMM= NULL is always unknown, a SELECT statement with this condition in it's WHERE clause returns no rows. Note that ORACLE returns no error message in this case . CONVERSION FUNCTIONS CHARTOROWID - CHARacter TO ROW Identifier. Changes a character string to act like an internal ORACLE row identifier, or RowID. CONVERT - CONVERTs character string from one national languages set to another. DECODE - DECODE's a CHAR, VARCHAR, or a NUMBER into any of several different character strings or NUMBER based on value. HEXTORAW - HEXadecimal TO RAW. Changes a character string of hex numbers into binary. RAWTOHEX - RAW TO HEXadecimal. Changes a string of binary numbers to a character string of hex numbers. ROWIDTOCHAR - ROW Identifier TO CHARacter. Changes an internal Oracle row identifier, or RowID, to act like a character string. TO CHAR - TO CHARacter. Converts a NUMBER or DATE so that it acts like a character string.
TO_MULTI BYTE - Converts the single byte characters in a character string to multibyte. TO_NUMBER - Converts a CHAR or VARCHAR to act like a number TO_SINGLE BYTE - Converts the multi byte characters in a CHAR or VARCHAR to TRANSLATE - TRANSLATEs characters in a string into different characters.
|
|
Domain NamesSQL Database Management Systems Relational Database Management System Properties of RDBMS Client Server Computing Oracle Relational Database Database Structure and Space Management SQL Data Types How to Use Data Types? What is Operators and Conditions Character OperatorsOperator Precedence Data Retrieval Using SQL Plus SQL Data Definitions Data Retrieval Using Select SQL Operator Precedence Selecting Rows and Columns The Group by Clause
Having Clause Union, Union all, Intersact and Minus Commands Playing with Numbers Date Functions Example of Date Arithmetic Working with Null Values
Joining Tables and Subqueries Views Synonyms Indexes Clusters Sequences Formatting Query Results with SQL Plus Data Integrity The Optimizer How Oracle Optimizes SQL Statements Evaluating Expression and ConditionsOptimization Hints PL-SQL PL-SQL Architecture Error Reporting Functions Character Functions Composite Data Types PL-SQL Structures How to use PL-SQL Structures Normalization Operator Precedence Cursor Error Handling Database Triggers Types of Triggers Locking Sub Programs Packages New and Improved Data Types Improved Select Statement Advanced Quering Improved Scalability Improved Performance Via Partitioning Object Relational Features Heterogeneous Data Access Improved Security Administration New Data Types Improved Select Statement Changes to the Select Statement Improved Scalability Data Partitioning Oriented Toward Objects Character Functions Creating Object Types Created Nested Tables Oracle8 and Distributed Database Oracle8 Database Management and Security Distributed Database Invoking Export Invoking ImportWeb DesignWeb HostingE Commerce |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |