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
Is and as keyword in pl sql?
What is a temporal data type?
Which table is left in left join?
Does inner join return duplicate rows?
Is nosql relational?
what is bcp? When is it used?
Explain select statements in sql?
what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba
What does a pl/sql package consist of?
How much ram can sql express use?
How do I create a sql database?
What does where 1 1 mean in sql?
Difference between truncate, delete and drop commands?
What is an exception in PL/SQL? What are the two types of exceptions?
Name some usages of database trigger?