Solved

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

Posted on 2009-07-01
4
356 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
[X]
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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

749 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