Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
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.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now