Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Working with oracle  input parameters

Posted on 2003-10-29
3
Medium Priority
?
1,283 Views
Last Modified: 2008-03-06
I am new to oracle
I have a package that has a begindate and enddate and I want to use the begindate to get the value of the enddate eg in mssql enddate = begindate + 1 how do I go about it in oracle? Proc below

CREATE OR REPLACE PACKAGE Del_Times_Reports AS
  -- Author  : GMAYAKA.
  -- Created : 10/22/2003
  -- Purpose : To store procs to access common delivery times reports.

       -- Public type declarations
        TYPE results_cursor IS REF CURSOR;

            -- Public procedure declarations
       
            Procedure DelTimesWeekbyDay (BeginDate IN date,Plant IN number := Null, io_cursor IN OUT results_cursor);



END Del_Times_Reports;
/
CREATE OR REPLACE PACKAGE BODY Del_Times_Reports AS
Procedure DelTimesWeekbyDay (BeginDate IN date,Plant IN number := Null, io_cursor IN OUT results_cursor)
   IS
   -- Returns a list of Delivery Data by Date for an intranet report on delivery confirmation data.
   -- Returns 7 days worth of data, can return for 1 SmartCenter or all.
        v_cursor results_cursor;

   BEGIN
               OPEN v_cursor FOR
            SELECT TO_CHAR(bn_filetime,'MM/DD/YYYY') AS BNManifestDate
        ,count(dcn) as BNManifested
        ,COUNT(dtDSEScanDate) AS DSEScanned
        --,(CASE WHEN count(dtDSEScandate) = 0 THEN null
            --       ELSE cast(COUNT(dtDaysToDeliver)  / COUNT(dtDSEScanDate) * 100 as number(9,2))
            --  END) DeliveryRate
            , DECODE(count(dtDSEScanDate), 0, NULL,
               cast(COUNT(dtDaysToDeliver)  / COUNT(dtDSEScanDate) * 100 as number)) DeliveryRate
             , cast(AVG(dtDaystoDeliver) as number) AvgDaystoDeliver
   FROM Delivery_Time
   WHERE bn_filetime between beginDate AND endDate = begindate  + 1
   AND plantID = NVL(plant, plantID)
GROUP BY TO_CHAR(bn_filetime,'MM/DD/YYYY')
ORDER BY BNManifestDate;

        io_cursor := v_cursor;
   END DelTimesWeekbyDay;


END Del_Times_Reports;
/

setting the enddate in mssql is pretty simple but I don't know a work around in oracle

Thanks in advance
0
Comment
Question by:mwanchi
[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 Comments
 
LVL 7

Accepted Solution

by:
Bigfam5 earned 480 total points
ID: 9643980

You can add numbers to any date column,  So if you what endDate to = beginDate +1 in the where clause

WHERE bnfiletime between  beginDate and (beginDate+1)
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 9643991
Same in Oracle. you should be able to use enddate= begindate +1 too.
0
 
LVL 8

Expert Comment

by:Danielzt
ID: 9644029
In Oracle, if you only care about the day (ignore the hours,minutes and seoncds)
you can do like this:

trunc(endDate) = trunc(begindate)  + 1
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

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 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
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…

722 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