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 cascade in sql?

544


What is the difference between syntax error and runtime error?

602


What is difference between inner join and self join?

582


What is coalesce sql?

504


Can a primary key be a foreign key?

564






Does user triggers have entry for trigger with compilation errors?

580


How to Execute a Package in PL/SQL.?

570


Does truncate require commit?

527


What is a nested table in word?

525


What do you mean by rowid?

528


how to add a new column to an existing table in mysql? : Sql dba

573


When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?

613


What is java sql package?

522


What are the types of optimization?

510


What is a relationship and what are they?

568