OWB not considering the constant whil execution [message #595205] |
Mon, 09 September 2013 05:58 |
srinivas.k2005
Messages: 404 Registered: August 2006
|
Senior Member |
|
|
Hi,
In OWB i have assigned a constant variable as below
Constant : Expression : PACKG1.GET_DATE
and linked the constant to a target table column
When i generate code, i am getting as below:
CREATE OR REPLACE PACKAGE "M_TEST" AS
"CO_0_PR" DATE := PACKG1.GET_DATE;
END "M_TEST" ;
/
CREATE OR REPLACE PACKAGE BODY AS "M_TEST" AS
FUNCTION "F_FUN"
RETURN BOOLEAN IS
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION ENABLE PARALLEL DML';
BEGIN
INSERT
INTO
"TARGET_TAB"
(
ID,
DATE
)
(SELECT
ID,
PACKG1.GET_DATE
FROM "SOURCE_TAB"
);
END;
END "F_FUN";
END "M_TEST" ;
/
My question :
Why is it taking PACKG1.GET_DATE in select statement instead of the constant "CO_0_PR".
How to set in OWB to take constant value.
If i have 10million records the PACKG1.GET_DATE is executing 10 million times.
Please let me know the solution if any, to take the constant value
|
|
|
|
Re: OWB not considering the constant whil execution [message #595230 is a reply to message #595206] |
Mon, 09 September 2013 09:12 |
srinivas.k2005
Messages: 404 Registered: August 2006
|
Senior Member |
|
|
Hi,
Sorry if i had confused.
The package i sent was generated automatically by OWB internally.
OWB generated package:
CREATE OR REPLACE PACKAGE "M_TEST" AS
"CO_0_PR" DATE := PACKG1.GET_DATE;
END "M_TEST" ;
/
CREATE OR REPLACE PACKAGE BODY AS "M_TEST" AS
FUNCTION "F_FUN"
RETURN BOOLEAN IS
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION ENABLE PARALLEL DML';
BEGIN
INSERT
INTO
"TARGET_TAB"
(
ID,
DATE
)
(SELECT
ID,
PACKG1.GET_DATE
FROM "SOURCE_TAB"
);
END;
END "F_FUN";
END "M_TEST" ;
/
My Question is what setting should we do so that the OWB package generate code as below:
CREATE OR REPLACE PACKAGE "M_TEST" AS
"CO_0_PR" DATE := PACKG1.GET_DATE;
END "M_TEST" ;
/
CREATE OR REPLACE PACKAGE BODY AS "M_TEST" AS
FUNCTION "F_FUN"
RETURN BOOLEAN IS
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION ENABLE PARALLEL DML';
BEGIN
INSERT
INTO
"TARGET_TAB"
(
ID,
DATE
)
(SELECT
ID,
CO_0_PR
FROM "SOURCE_TAB"
);
END;
END "F_FUN";
END "M_TEST" ;
/
|
|
|
|
|