PL/SQL issue with invalid results

From: JAW <jwilliam_at_aglresources.com>
Date: Wed, 9 Jul 2008 09:43:56 -0700 (PDT)
Message-ID: <54f2f5b8-4903-4a7b-8fea-ff4802e0d3b9@t54g2000hsg.googlegroups.com>


I can run a query in SQPLUS and get results I need.

Select col1

               From tab1 sch, tab2 cmn

               where
                 and cmn.joinid = sch.joinid

                 AND completion_dttm > TO_DATE('06/30/2008', 'MM/DD/
YYYY')
                 AND completion_dttm < TO_DATE('06/30/2008', 'MM/DD/
YYYY') + 1
                 and crew = 'ZZZ'

               ORDER BY  completion_dttm;


I have the same query in a procedure that I pass parmss and I get no rows (It has a REF CUROSR).

var x refcursor
exec proc1('ZZZ','06/30/2008',:x);
print x

Below are the changes for the PL/SQL including the parameter

When executed no rows are found.

proc1(engineer IN VARCHAR2, whichday IN VARCHAR2, cur_out OUT oracle_pkg.listCursor)

AND completion_dttm > TO_DATE(whichday, 'MM/DD/YYYY')

                 AND completion_dttm < TO_DATE(whichday, 'MM/DD/YYYY')
+ 1
                 AND crew = engineer
Received on Wed Jul 09 2008 - 11:43:56 CDT

Original text of this message