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
What are the two different parts of the pl/sql packages?
What is mutating sql table?
Does google use sql?
What is normalization sql?
What is a mutating table and a constraining table?
Is primary key a clustered index?
how can we know the count/number of elements of an array? : Sql dba
How to assign sql query results to pl sql variables?
What is the primary key?
what are the 'mysql' command line options? : Sql dba
What are the types of optimization?
what is bcp? When is it used?
What is sorting in sql?
How do I start sql profiler?
What is where clause in sql?