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 are the basic sql commands?
What is sql and how does it work?
How to return multiple rows from the stored procedure?
How can a function retun more than one value in oracle with proper example?
How would you pass hints to the sql processor?
Is pl sql and postgresql same?
What is java sql drivermanager?
What is crud diagram?
What is a loop in sql?
What do you know by pl/sql cursors?
what is the functionality of the function htmlentities? : Sql dba
What are the advantages of stored procedure?
How do I find duplicates in sql?
What is the maximum size of sqlite database?
how is exception handling handled in mysql? : Sql dba