hi,
I have the following packaged function / view scenario that I'm hoping to improve the performance.
CREATE OR REPLACE PACKAGE Pkg_Sub_Time AS
FUNCTION CHGDATM(ts TIMESTAMP) RETURN TIMESTAMP;
END Pkg_Order_Archive;
/
CREATE OR REPLACE PACKAGE BODY Pkg_Sub_Time AS
FUNCTION chgdatm(ts TIMESTAMP) RETURN TIMESTAMP IS
wLTS TIMESTAMP;
BEGIN
SELECT ts - (SELECT to_number(VALUE) FROM OSMCFG WHERE NAME='MinusTime') INTO wLTS
FROM dual;
RETURN wLTS;
END chgdatm;
END Pkg_Sub_Time ;
/
The function is then used in a view passing a timestamp field.
The lookup of the time to subtract gets called for each row but SELECT to_number(VALUE) FROM OSMCFG WHERE NAME='MinusTime' is static data.
Can I call this just once and have it set on package load?
WP
I have the following packaged function / view scenario that I'm hoping to improve the performance.
CREATE OR REPLACE PACKAGE Pkg_Sub_Time AS
FUNCTION CHGDATM(ts TIMESTAMP) RETURN TIMESTAMP;
END Pkg_Order_Archive;
/
CREATE OR REPLACE PACKAGE BODY Pkg_Sub_Time AS
FUNCTION chgdatm(ts TIMESTAMP) RETURN TIMESTAMP IS
wLTS TIMESTAMP;
BEGIN
SELECT ts - (SELECT to_number(VALUE) FROM OSMCFG WHERE NAME='MinusTime') INTO wLTS
FROM dual;
RETURN wLTS;
END chgdatm;
END Pkg_Sub_Time ;
/
The function is then used in a view passing a timestamp field.
The lookup of the time to subtract gets called for each row but SELECT to_number(VALUE) FROM OSMCFG WHERE NAME='MinusTime' is static data.
Can I call this just once and have it set on package load?
WP