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 I create table without primary key?
Can we commit in trigger?
What are the two characteristics of a primary key?
how to get help information from the server? : Sql dba
What is meant by truncate in sql?
What version is sql?
How can I make sql query run faster?
How to rename a table?
What is pl/sql language case sensitive?
What is difference between sql function and stored procedure?
Is left join same as inner join?
What are the advantages of pl sql over sql?
What does 0 mean in sql?
What is serial sql?
What is the function that is used to transfer a pl/sql table log to a database table?