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 is the difference difference between procedure and packages
What is error ora-01000: maximum open cursors exceeded
How many joins in sql?
Is coalesce faster than isnull?
- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?
what are integrity rules?
How to check if a column is nullable before setting to nullable?
Explain foreign key in sql?
Is sql sequential or random?
What is function and procedure?
can sql servers linked to other servers like oracle? : Sql dba
how to shut down the server with 'mysqladmin'? : Sql dba
what is the bond code in materialized view?
What does count (*) mean?
Is left join and outer join same?