declare
l1 number := null;
l2 number :=null;
begin
if l1=l2 then message('equal');
else
if l1<>l2 then message('not equal');
else
message('else');
end if;
end if;
end;
What will be the output ?

Answer Posted / roopesh kumar

In term of oracle block should be like as........

SQL> declare
2 l1 number := null;
3 l2 number :=null;
4 begin
5 if l1=l2 then
6 dbms_output.put_line ('equal');
7 elsif l1<>l2 then
8 dbms_output.put_line ('not equal');
9 else
10 dbms_output.put_line ('else');
11 end if;
12 end;
13 /
else

PL/SQL procedure successfully completed.

Answer is as shown at end of block ELSE.
because u can't compare a null value to other null.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a unique key?

588


What is a pl/sql block?

595


What are pl sql procedures?

522


what is the difference between a local and a global temporary table? : Sql dba

556


Explain the uses of control file.

617






Can you rollback after commit?

532


how to calculate the difference between two dates? : Sql dba

550


What problem one might face while writing log information to a data-base table in pl/sql?

559


Mention what plvcmt and plvrb does in pl/sql?

643


What is the syntax to add a record to a table?

577


What is the current version of postgresql?

560


What is microsoft t sql?

490


Why sql query is slow?

583


What is an inner join sql?

549


What are the limitations of sql express?

530