Oracle DIUTIL
Version 12.2.0.1

General Information
Library Note Morgan's Library Page Header
"I spent my entire adult life looking out for the well-being, the training, the equipping of the troops for whom I was responsible. I will not be lectured about what our military needs by a five-deferment draft dodger,"
~ Sen. Tammy Duckworth
Purpose Diana application routines.
AUTHID DEFINER
Constants
Name Data Type Value
char_for_varchar2 BOOLEAN NULL
libunit_type_body NUMBER 2
libunit_type_spec NUMBER 1
load_source_no NUMBER 2
load_source_yes NUMBER 1
s_defaultval (true if parameters have default values) NUMBER 8
s_logic (logic error) NUMBER 4
s_notinpackage (package found / proc not found) NUMBER 6
s_notv6compat (found non v6 TYPE OR construct) NUMBER 7
s_ok (successful) NUMBER 0
s_other (other error) NUMBER 5
s_stubtoolong (subprogram not found) NUMBER 3
Data Types SUBTYPE ptnod IS pidl.ptnod;

SUBTYPE ub4 IS pidl.ub4;
Dependencies
DBMS_STANDARD DIANA SUBPTXT2
DBMS_WORKLOAD_REPLAY PIDL  
Documented No
Exceptions
Error Code Reason
N/A e_notinpackage
N/A e_nopriv
N/A e_notv6compat
N/A e_other
N/A e_subpnotfound
N/A e_stubtoolong
First Available 7.3.4
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/diutil.sql
Subprograms
 
ATTRIBUTE_USE_STATISTICS
Reports libunit's attribute count and limit diutil.attribute_use_statistics(
libunit_node    IN  ptnod,
attribute_count OUT ub4, 
attribute_limit OUT ub4);
Clear text source code in package body
 
BOOL_TO_INT
Translates 3-valued BOOLEAN TO NUMBER FOR USE in sending BOOLEAN parameter / RETURN VALUES between pls v1 (client) AND pls v2 since sqlnet. Has no BOOLEAN bind variable TYPE, we encode booleans AS false = 0, true = 1, NULL = NULL FOR network transfer AS NUMBER diutil.bool_to_int(b IN BOOLEAN) RETURN NUMBER;
set serveroutput on

DECLARE
 b BOOLEAN := TRUE;
BEGIN
  IF diutil.bool_to_int(b) = 1 THEN
    dbms_output.put_line('First it is TRUE');

    b := FALSE;
    IF diutil.bool_to_int(b) = 0 THEN
      dbms_output.put_line('Then it is FALSE');
    END IF;
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/
 
GET_D
Returns the root OF the diana OF a libunit, given name AND user. Name will be first folded TO upper CASE IF NOT IN quotes, ELSE stripped OF quotes. diutil.get_d(
name         IN     VARCHAR2,
usr          IN     VARCHAR2,
dbname       IN     VARCHAR2,
dbowner      IN     VARCHAR2,
status       IN OUT ub4,
nod             OUT ptnod, 
libunit_type IN     NUMBER := libunit_type_spec,
load_source  IN     NUMBER := load_source_no);
Clear text source code in package body
 
GET_DIANA
Returns the root OF the diana OF a libunit, given name AND usr. Name will be first folded TO upper CASE IF NOT IN quotes, ELSE stripped OF quotes. Will trace synonym links. diutil.get_diana(
name         IN     VARCHAR2,
usr          IN     VARCHAR2,
dbname       IN     VARCHAR2,
dbowner      IN     VARCHAR2,
status       IN OUT ub4,
nod          IN OUT ptnod,
libunit_type IN     NUMBER := libunit_type_spec,
load_source  IN     NUMBER := load_source_no);
Clear text source code in package body
 
INT_TO_BOOL
Translates 3-valued NUMBER encoding to BOOLEAN for use in sending BOOLEAN parameter / RETURN VALUES between pls v1 (client) AND pls v2. Since sqlnet has no BOOLEAN bind variable TYPE, we encode booleans AS false = 0, true = 1, NULL = NULL FOR network transfer AS NUMBER diutil.int_to_bool(n IN NUMBER) RETURN BOOLEAN;
set serveroutput on

DECLARE
 i PLS_INTEGER := 1;
BEGIN
  IF diutil.int_to_bool(i) THEN
    dbms_output.put_line('First it is TRUE');

    i := 0;
    IF NOT diutil.int_to_bool(i) THEN
      dbms_output.put_line('Then it is FALSE');
    END IF;
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/
 
NODE_USE_STATISTICS
Reports libunit's node count and limit diutil.node_use_statistics(
libunit_node IN  ptnod, 
node_count   OUT ub4,   -- diana nodes
node_limit   OUT ub4);
Clear text source code in package body
 
SUBPTXT
Returns the text OF a subprogram source (describe). diutil.subptxt(
name    IN     VARCHAR2,
subname IN     VARCHAR2,
usr     IN     VARCHAR2, 
dbname  IN     VARCHAR2,
dbowner IN     VARCHAR2,
txt     IN OUT VARCHAR2,
status  IN OUT ub4);
Clear text source code in package body
Thanks to Maxim Demenko for pointing me to this package
-- note also SYS functions SUBPTXT and SUBPTXT2 --

Related Topics
Packages
What's New In 12cR1
What's New In 12cR2

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-2017 Daniel A. Morgan All Rights Reserved