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
How do I install sql?
Can I call a procedure inside a function?
What is the difference between drop and truncate commands?
Does a join table need a primary key?
What are crud methods?
What are the rules to be applied to nulls whilst doing comparisons?
How to pronounce postgresql?
How to return multiple rows from the stored procedure?
Can we use two order by clause in query?
Mention what are different methods to trace the pl/sql code?
Does sql backup shrink transaction log?
What is inner join in sql?
how many values can the set function of mysql take? : Sql dba
how to use like conditions? : Sql dba
how to escape special characters in sql statements? : Sql dba