Solved

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

Posted on 2009-07-01
4
354 Views
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.
0
Comment
Question by:curiousperson
  • 3
4 Comments
 
LVL 20

Accepted Solution

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

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

0
 

Author Closing Comment

by:curiousperson
ID: 31598893
What does the v stand for in v_return?
0
 
LVL 20

Expert Comment

by:flow01
ID: 24757834
in our company we use it the recognize variables in the source
0
 
LVL 20

Expert Comment

by:flow01
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)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
"Disruption" is the most feared word for C-level executives these days. They agonize over their industry being disturbed by another player - most likely by startups.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

777 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