Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2009-07-01
4
355 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
"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.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to take different types of Oracle backups using RMAN.

860 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