write a pl/sql function if enter a value=0 then output
value=1 and vise verse with out using if and case statements.
Answer Posted / rajesh venati
Hi all this will work for that one with out using if and
case statement.
create or replace function fun(a in number) return number
is
n number;
begin
n:=mod(1,a);
return n;
end;
SQL> select fun(1) from dual;
FUN(1)
----------
0
SQL> select fun(0) from dual;
FUN(0)
----------
1
Is This Answer Correct ? | 18 Yes | 0 No |
Post New Answer View All Answers
What are the three forms of normalization?
What is a join query?
what is recursive stored procedure? : Sql dba
what is error ora-03113: end-of-file on communication channel?
Cite the differences between execution of triggers and stored procedures?
What is a dynamic query?
What are the different operators available in sql?
When are we going to use truncate and delete?
How do rank () and dense_rank () differ?
Can we use views in stored procedure?
How is a PL/SQL code compiled?
what is the bond code in materialized view?
Explain foreign key in sql?
What is data control language (dcl)?
What is insert command in sql?