Oracle OWM_VT_PKG
Version 21c

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose This package replicates or provides the functionality of group of related WMSYS schema functions and operators of value in managing date data.
AUTHID DEFINER
Dependencies
LTADM WM_INTERSECTION WM_OVERLAPS
WM_CONTAINS WM_LDIFF WM_PERIOD
WM_EQUALS WM_LESSTHAN WM_RDIFF
WM_GREATERTHAN WM_MEETS  
Documented No
First Available Not known
Security Model Owned by WMSYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/owmvts.plb
Subprograms
 
WM_CONTAINS
Undocumented owm_vt_pkg.wm_contains(
p1 IN wmsys.wm_period,
p2 IN wmsys.wm_period)
RETURN NUMBER;
DECLARE
 retVal INTEGER;
 p1b    DATE := TO_DATE('01-JAN-2021');
 p1e    DATE := TO_DATE('05-JAN-2021');
 p2b    DATE := TO_DATE('01-JAN-2021');
 p2e    DATE := TO_DATE('03-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_contains(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retval);

  p1b := TO_DATE('02-JAN-2021');
  p1e := TO_DATE('06-JAN-2021');

  SELECT wmsys.owm_vt_pkg.wm_contains(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retval);
END;
/
1
0

PL/SQL procedure successfully completed.
 
WM_EQUALS
Undocumented owm_vt_pkg.wm_equals(
p1 IN wmsys.wm_period,
p2 IN wmsys.wm_period)
RETURN NUMBER;
DECLARE
 retVal INTEGER;
 p1b    DATE := TO_DATE('01-JAN-2021');
 p1e    DATE := TO_DATE('03-JAN-2021');
 p2b    DATE := TO_DATE('01-JAN-2021');
 p2e    DATE := TO_DATE('03-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_equals(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retVal);

  p1b := TO_DATE('01-JAN-2021');
  p1e := TO_DATE('04-JAN-2021');

  SELECT wmsys.owm_vt_pkg.wm_equals(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retVal);
END;
/
1
0

PL/SQL procedure successfully completed.
 
WM_GREATERTHAN
Undocumented owm_vt_pkg.wm_greaterThan(
DECLARE
 retVal INTEGER;
 p1b    DATE := TO_DATE('01-FEB-2021');
 p1e    DATE := TO_DATE('03-FEB-2021');
 p2b    DATE := TO_DATE('01-JAN-2021');
 p2e    DATE := TO_DATE('31-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_greaterthan(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retVal);

  p2b := TO_DATE('02-FEB-2021');
  p2e := TO_DATE('31-DEC-2021');

  SELECT wmsys.owm_vt_pkg.wm_greaterthan(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retVal);
END;
/
1
0

PL/SQL procedure successfully completed.
 
WM_INTERSECTION
Undocumented owm_vt_pkg.wm_intersection(
DECLARE
 retVal WM_PERIOD;
 p1b    DATE := TO_DATE('01-JAN-2021');
 p1e    DATE := TO_DATE('10-JAN-2021');
 p2b    DATE := TO_DATE('08-JAN-2021');
 p2e    DATE := TO_DATE('12-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_intersection(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retVal.validfrom);
  dbms_output.put_line(retVal.validtill);
END;
/
08-JAN-21 12.00.00.000000 AM +00:00
10-JAN-21 12.00.00.000000 AM +00:00

PL/SQL procedure successfully completed.
 
WM_LDIFF
Undocumented owm_vt_pkg.wm_ldiff(
DECLARE
 retVal WM_PERIOD;
 p1b    DATE := TO_DATE('01-NOV-2021');
 p1e    DATE := TO_DATE('31-DEC-2021');
 p2b    DATE := TO_DATE('29-NOV-2021');
 p2e    DATE := TO_DATE('01-DEC-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_ldiff(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retval
  FROM dual;

  dbms_output.put_line(retVal.validfrom);
  dbms_output.put_line(retVal.validtill);
END;
/
01-NOV-21 12.00.00.000000 AM +00:00
29-NOV-21 12.00.00.000000 AM +00:00

PL/SQL procedure successfully completed.
 
WM_LESSTHAN
Undocumented owm_vt_pkg.wm_lessThan(
DECLARE
 retVal INTEGER;
 p1b    DATE := TO_DATE('01-JAN-2021');
 p1e    DATE := TO_DATE('02-JAN-2021');
 p2b    DATE := TO_DATE('03-JAN-2021');
 p2e    DATE := TO_DATE('16-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_lessthan(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retval
  FROM dual;

  dbms_output.put_line(retVal);

  p1b := TO_DATE('04-JAN-2021');
  p1e := TO_DATE('10-JAN-2021');

  SELECT wmsys.owm_vt_pkg.wm_lessthan(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retVal
  FROM dual;

  dbms_output.put_line(retVal);
END;
/
1
0

PL/SQL procedure successfully completed.
 
WM_MEETS
Undocumented owm_vt_pkg.wm_meets(
DECLARE
 retval INTEGER;
 p1b    DATE := TO_DATE('01-JAN-2021');
 p1e    DATE := TO_DATE('03-JAN-2021');
 p2b    DATE := TO_DATE('03-JAN-2021');
 p2e    DATE := TO_DATE('06-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_meets(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retval
  FROM dual;

  dbms_output.put_line(retval);

  p1b := TO_DATE('01-JAN-2021');
  p1e := TO_DATE('04-JAN-2021');

  SELECT wmsys.owm_vt_pkg.wm_meets(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retval
  FROM dual;

  dbms_output.put_line(retval);
END;
/
1
0

PL/SQL procedure successfully completed.
 
WM_OVERLAPS
Undocumented owm_vt_pkg.wm_overlaps(
DECLARE
 retval INTEGER;
 p1b    DATE := TO_DATE('01-JAN-2021');
 p1e    DATE := TO_DATE('31-JAN-2021');
 p2b    DATE := TO_DATE('31-DEC-2013');
 p2e    DATE := TO_DATE('02-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_overlaps(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retval
  FROM dual;

  dbms_output.put_line(retval);

  p1b := TO_DATE('03-JAN-2021');
  p1e := TO_DATE('31-JAN-2021');

  SELECT wmsys.owm_vt_pkg.wm_overlaps(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retval
  FROM dual;

  dbms_output.put_line(retVal);
END;
/
1
0

PL/SQL procedure successfully completed.
 
WM_RDIFF
Undocumented owm_vt_pkg.wm_rDiff(
DECLARE
 retval WM_PERIOD;
 p1b    DATE := TO_DATE('01-JAN-2021');
 p1e    DATE := TO_DATE('31-DEC-2021');
 p2b    DATE := TO_DATE('12-JAN-2020');
 p2e    DATE := TO_DATE('16-JAN-2021');
BEGIN
  SELECT wmsys.owm_vt_pkg.wm_rdiff(WM_PERIOD(p1b, p1e), WM_PERIOD(p2b, p2e))
  INTO retval
  FROM dual;

  dbms_output.put_line(retval.validfrom);
  dbms_output.put_line(retval.validtill);
END;
/
16-JAN-21 12.00.00.000000 AM +00:00
31-DEC-21 12.00.00.000000 AM +00:00

PL/SQL procedure successfully completed.

Related Topics
Built-in Functions
Built-in Packages
Database Security
OWM_ASSERT_PKG
OWM_BULK_LOAD_PKG
OWM_CPKG_PKG
OWM_DDL_PKG
OWM_DML_PKG
OWM_DYNSQL_ACCESS
OWM_IEXP_PKG
OWM_MIG_PKG
OWM_MP_PKG
OWM_VSCRIPT_PKG
WMSYS OPERATORS
What's New In 19c
What's New In 20c-21c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2019 Daniel A. Morgan All Rights Reserved
  DBSecWorx