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
Can you load data into multiple tables at once? : aql loader
How do I write a cron which will run a sql query and mail the results to agroup?
What does dml mean?
What is primary key and foreign key with example?
What is nested table in pl sql?
What is synchronized subquery?
Is left join faster than join?
What is audit logout in sql profiler?
What is indexing in sql and its types?
What is sap sql anywhere?
What does the sign mean in sql?
What is $$ in sql?
What is parallel hint?
How do I partition in sql?
how to include character strings in sql statements? : Sql dba