How to create a function that checks dates using a boolean value

Posted on 2009-07-01
Medium Priority
Last Modified: 2013-12-07
I need to create a function that will:
  1) return a Boolean true/false.
  2) the function should receive a slip_num, arrive_date, depart_date as parameters.
  3) if the slip is available during the duration of the arrive date to depart date, the function  
       should return true. Otherwise it should return false.
Question by:curiousperson
  • 3
LVL 21

Accepted Solution

flow01 earned 1000 total points
ID: 24757241
create or replace function slip_available(slip_num number, arrive_date date, depart_date) return boolean
  v_return boolean := false;
    if  ,,,  then
      v_return := true;
    end if;
   return v_return;

note :
you can use this function in pl/sql but not in sql
in sql-statements booleans can't be used


Author Closing Comment

ID: 31598893
What does the v stand for in v_return?
LVL 21

Expert Comment

ID: 24757834
in our company we use it the recognize variables in the source
LVL 21

Expert Comment

ID: 24757849
i keep the habit (partially) on expert_exchange
otherwise a shoud have defined also
create or replace function slip_available(p_slip_num number, p_arrive_date date, p_depart_date) return

where p_ refers to parameters (= arguments)

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question