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 nvarchar in sql?
Can sql function call stored procedure?
Is it possible to update views?
Explain cursor types?
What are packages in pl sql and also explain its advantages?
How do you select unique values in sql?
What is a column in a table?
What is the purpose of design view?
How many sql are there?
How would you convert date into julian date format?
What is raid? How does it help storage of databases?
What is the usage of when clause in trigger?
What do you understand by pl/sql records?
What are the query optimization techniques?
What is before and after trigger?