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
Explain normalization and what are the advantages of it?
what is the difference between primary key and unique key? : Sql dba
Can we call dml statement in function?
What are the disadvantages of file system?
Enlist some predefined exceptions?
What is coalesce in sql?
Explain ddl statements in pl/sql?
What are different clauses used in sql?
Can we perform dml on view?
What is cursor in pl sql with examples?
How many sql databases can you have on one server?
what is bcp? When does it used? : Sql dba
How do I write a cron which will run a sql query and mail the results to agroup?
Which table is left in join?
Explain the the delete statements in sql?