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 / sachin sapkal
create or replace function myfun(a in number) return number
is
n number;
begin
if (n = 1)
return 0;
else if(n = 0)
return 1;
else
dbms_output.put_line('enter 0 or 1 only...');
end if;
end;
SQL> select myfun(1) from dual;
Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
How do you rename a table in sql?
What is use of package in pl sql?
What packages are available to pl/sql developers?
What version is sql?
What is the difference between a procedure and a function?
Enlist some predefined exceptions?
Do foreign keys improve performance?
discuss about myisam key cache. : Sql dba
Is foreign key mandatory?
What is substitution variable in pl sql?
What is pl sql variable?
What is sql exception?
What is difference between hql and sql?
What is parameter substitution in sql?
Is join and inner join the same?