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 to use myisamchk to check or repair myisam tables? : Sql dba
What are sql objects?
How can we implement rollback or commit statement in a trigger?
What is pl sql architecture?
What are sql constraints?
What is union and union all keyword in sql?
Determine if oracle date is on a weekend?
What is compound trigger?
What is sql and db2?
Are stored procedures compiled?
What is a loop in sql?
How do sql triggers work?
what is a cursor? : Sql dba
What is triggering circuit?
Why do we create stored procedures & functions in pl/sql and how are they different?