Crystal Reports 2008
Oracle 10g
Toad 9.6.1
SAP BO 3.1
My SP runs successfully in Toad, Crystal, and BO Infoview.
I am now addressing the Parameters and need some help, please. See SP w/dummy detail and Package examples below.
(This is a weakly bound package, yes? Do I need to use a strongly bound, and how do I correctly do this?)
STORED PROCEDURE:
Note: I've created a look-up table 'QTR_LOOKUP'
for fiscal Quarters for performance purposes. I will also probably create a look-up table for Divisions, same reason.
CREATE OR REPLACE PROCEDURE HISTDBA.WKMAIN
/**********************************************
NAME: WK
PURPOSE:
REVISIONS:
Ver Date Author Description
----- --------- --------- -------------------
1.0 2/9/11 HMS SP for Main Query
*****************************************************/
/*Add Input/Output Variables here. Since this is returning a result set I included a cursor type that was set up in a Package. */
(
p_opdiv in varchar2,
p_year in varchar2,
p_qtr in varchar2,
p_ResultSet out WKCursor.CursorWKType
)
AS
BEGIN
open p_ResultSet for
SELECT
TABLEA.AS_OF_DATE,
TABLEA.LAST_NAME,
TABLEA.CODE,
TABLEA.PERSON_ID,
TABLEA.PAYPLAN_CODE,
TABLEA.TENURE_CODE,
TABLEA.EMP_CODE,
TABLEB.ORG_CODE,
TABLEB.ORG_TITLE,
TABLEB.DIVISION
FROM
DBSCHEMA.TABLEB TABLEB INNER JOIN
DBSCHAMA.TABLEA TABLEA ON
TABLEB.ORG_CODE=TABLEA.ORG_CD
WHERE
(TABLEA.AS_OF_DATE >=(select START_DATE from QTR_LOOKUP where year = p_year and QUARTER = p_qtr)
AND TABLEA.AS_OF_DATE <= (select END_DATE from QTR_LOOKUP where year = p_year and QUARTER = p_qtr))
--AND TABLEB.DIVISION='ABC'
AND (TABLEA.PAYPLAN_CODE IN ('AA', 'BB') OR
TABLEA.TENURE_CODE IN ('1', '2'))
AND (TABLEA.EMP_CODE IN ('1', '2', '3', '4'));
END WKMAIN;
/
PACKAGE:
CREATE OR REPLACE PACKAGE DBSCHEMA.WKCursor AS
/*********************************************************
NAME: WK Cursor Type
PURPOSE:
REVISIONS:
Ver Date Author Description
---------------------------------------------
1.0 2/9/11 HMS 1. Set up a WK Cursor Type.
*********************************************************************/
type CursorWKType is ref cursor;
END WKCursor;
/
What adjustments do I need to make to the above SP and Package in order to enable the Parameters in Crystal?
Also, I'd like to be able to provide the audience with drop-down parameters, so they can choose rather than have to guess their input. Not sure how to do this with Oracle Parameters.
Thanks for your suggestions!!!
-Helen
Oracle 10g
Toad 9.6.1
SAP BO 3.1
My SP runs successfully in Toad, Crystal, and BO Infoview.
I am now addressing the Parameters and need some help, please. See SP w/dummy detail and Package examples below.
(This is a weakly bound package, yes? Do I need to use a strongly bound, and how do I correctly do this?)
STORED PROCEDURE:
Note: I've created a look-up table 'QTR_LOOKUP'
for fiscal Quarters for performance purposes. I will also probably create a look-up table for Divisions, same reason.
CREATE OR REPLACE PROCEDURE HISTDBA.WKMAIN
/**********************************************
NAME: WK
PURPOSE:
REVISIONS:
Ver Date Author Description
----- --------- --------- -------------------
1.0 2/9/11 HMS SP for Main Query
*****************************************************/
/*Add Input/Output Variables here. Since this is returning a result set I included a cursor type that was set up in a Package. */
(
p_opdiv in varchar2,
p_year in varchar2,
p_qtr in varchar2,
p_ResultSet out WKCursor.CursorWKType
)
AS
BEGIN
open p_ResultSet for
SELECT
TABLEA.AS_OF_DATE,
TABLEA.LAST_NAME,
TABLEA.CODE,
TABLEA.PERSON_ID,
TABLEA.PAYPLAN_CODE,
TABLEA.TENURE_CODE,
TABLEA.EMP_CODE,
TABLEB.ORG_CODE,
TABLEB.ORG_TITLE,
TABLEB.DIVISION
FROM
DBSCHEMA.TABLEB TABLEB INNER JOIN
DBSCHAMA.TABLEA TABLEA ON
TABLEB.ORG_CODE=TABLEA.ORG_CD
WHERE
(TABLEA.AS_OF_DATE >=(select START_DATE from QTR_LOOKUP where year = p_year and QUARTER = p_qtr)
AND TABLEA.AS_OF_DATE <= (select END_DATE from QTR_LOOKUP where year = p_year and QUARTER = p_qtr))
--AND TABLEB.DIVISION='ABC'
AND (TABLEA.PAYPLAN_CODE IN ('AA', 'BB') OR
TABLEA.TENURE_CODE IN ('1', '2'))
AND (TABLEA.EMP_CODE IN ('1', '2', '3', '4'));
END WKMAIN;
/
PACKAGE:
CREATE OR REPLACE PACKAGE DBSCHEMA.WKCursor AS
/*********************************************************
NAME: WK Cursor Type
PURPOSE:
REVISIONS:
Ver Date Author Description
---------------------------------------------
1.0 2/9/11 HMS 1. Set up a WK Cursor Type.
*********************************************************************/
type CursorWKType is ref cursor;
END WKCursor;
/
What adjustments do I need to make to the above SP and Package in order to enable the Parameters in Crystal?
Also, I'd like to be able to provide the audience with drop-down parameters, so they can choose rather than have to guess their input. Not sure how to do this with Oracle Parameters.
Thanks for your suggestions!!!
-Helen