Oracle 9i
Crystal 10
I have found that Crystal Reports chokes on Oracle stored procedures that have date literals coded into SQL Where clauses. Here is an example of the problem:
First, I created this stored procedure on Oracle:
[tt]
CREATE OR REPLACE PROCEDURE todd_test_sp(rs IN OUT sys_refcursor)
AS
BEGIN
OPEN rs FOR
SELECT *
FROM todd_test;
END;
[/tt]
And then I created a crystal report with the procedure set as the datasource. The report returns two rows:
SOME_DATE
1/1/2006 12:00:00AM
1/31/2006 12:00:00AM
Then, if I add a where clause to the stored procudure that has a date literal:
[tt]
CREATE OR REPLACE PROCEDURE todd_test_sp(rs IN OUT sys_refcursor)
AS
BEGIN
OPEN rs FOR
SELECT *
FROM todd_test
WHERE some_date = '01-JAN-2006';
END;
[/tt]
The report should return one row, but no records are returned!
In order to prove that the query is valid, I copied the query out of the stored procedure and ran it using SQL*Plus. One row was properly returned:
[tt]
SQL> SELECT *
2 FROM todd_test
3 WHERE some_date = '01-JAN-2006';
SOME_DATE
---------
01-JAN-06
[/tt]
Does anyone have any idea why the stored procedure with a date literal fails on Crystal?!?
Crystal 10
I have found that Crystal Reports chokes on Oracle stored procedures that have date literals coded into SQL Where clauses. Here is an example of the problem:
First, I created this stored procedure on Oracle:
[tt]
CREATE OR REPLACE PROCEDURE todd_test_sp(rs IN OUT sys_refcursor)
AS
BEGIN
OPEN rs FOR
SELECT *
FROM todd_test;
END;
[/tt]
And then I created a crystal report with the procedure set as the datasource. The report returns two rows:
SOME_DATE
1/1/2006 12:00:00AM
1/31/2006 12:00:00AM
Then, if I add a where clause to the stored procudure that has a date literal:
[tt]
CREATE OR REPLACE PROCEDURE todd_test_sp(rs IN OUT sys_refcursor)
AS
BEGIN
OPEN rs FOR
SELECT *
FROM todd_test
WHERE some_date = '01-JAN-2006';
END;
[/tt]
The report should return one row, but no records are returned!
In order to prove that the query is valid, I copied the query out of the stored procedure and ran it using SQL*Plus. One row was properly returned:
[tt]
SQL> SELECT *
2 FROM todd_test
3 WHERE some_date = '01-JAN-2006';
SOME_DATE
---------
01-JAN-06
[/tt]
Does anyone have any idea why the stored procedure with a date literal fails on Crystal?!?