Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews DB Oracle Interviews:Concepts and ArchitectureData AccessDatabase ArchitectureDatabase ManagementDatabase Security OracleDistributed ProcessingFlexfieldForms ReportsGeneral OracleMemory ManagementMTO-SAP Financial AccountingOCIOracle AOLOracle AROracle Backup RecoveryOracle D2KOracle DatabaseOracle Database DeveloperOracle DB OptimizationOracle DBAOracle DeveloperOracle ETLOracle Forms 3.0Oracle Forms 4.0Oracle GLOracle PL-SQLOracle RMANOracle ScenariosOracle SecurityOracle SQLOracle System ArchitectureOracle Technology Network (OTN)Programmatic ConstructsRAC (Real Application Clusters)SQL Plus
Copyright © 2018. All Rights Reserved
Oracle Database Interview Question:
How To Test NULL Values?
Submitted by: AdministratorThere ate two special comparison operators you can use on NULL values:
► "variable IS NULL" - Returns TRUE if the variable value is NULL.
► "variable IS NOT NULL" - Return TRUE if the variable value is not NULL.
The following sample script shows you examples of comparing NULL values:
DECLARE
next_task CHAR(80);
BEGIN
next_task := NULL;
IF next_task IS NOT NULL THEN
DBMS_OUTPUT.PUT_LINE('I am busy.');
ELSE
DBMS_OUTPUT.PUT_LINE('I am free.');
END IF;
IF next_task IS NULL THEN
NULL;
ELSE
DBMS_OUTPUT.PUT_LINE('... working on ' || next_task);
END IF;
END;
Note that "variable = NULL" is not a valid operation. This script should print this:
I am free.
Submitted by: Administrator
► "variable IS NULL" - Returns TRUE if the variable value is NULL.
► "variable IS NOT NULL" - Return TRUE if the variable value is not NULL.
The following sample script shows you examples of comparing NULL values:
DECLARE
next_task CHAR(80);
BEGIN
next_task := NULL;
IF next_task IS NOT NULL THEN
DBMS_OUTPUT.PUT_LINE('I am busy.');
ELSE
DBMS_OUTPUT.PUT_LINE('I am free.');
END IF;
IF next_task IS NULL THEN
NULL;
ELSE
DBMS_OUTPUT.PUT_LINE('... working on ' || next_task);
END IF;
END;
Note that "variable = NULL" is not a valid operation. This script should print this:
I am free.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.