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 many columns should be in an index?
How does left join work in sql?
What is the use of stored procedures?
Why is sql better than hql?
How run sql*plus commands that are stored in a local file?
Can primary key be changed?
How to place comments in pl/sql?
what is clause? : Sql dba
Does postgresql run on the cloud?
Is not equal in sql?
what is top in tsql? : Transact sql
What are the types of join and explain each?
How delete all records from table in sql?
What is 19 null in sql?
write an sql query to find names of employee start with 'a'? : Sql dba