Oracle DIUTIL
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.1 to 12.1.0.2. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Interested in Oracle GoldenGate? Check out the IGGOUG,
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
DIANA PIDL SUBPTXT2
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

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