CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle DIUTIL
Version 11.1
 
General Information
Source {ORACLE_HOME}/rdbms/admin/diutil.sql
First Available 7.3.4
Constants
Name Data Type Value
s_ok (successful) NUMBER 0
s_notinpackage (package found / proc not found) NUMBER 6
s_stubtoolong (subprogram not found) NUMBER 3
s_logic (logic error) NUMBER 4
s_other (other error) NUMBER 5
s_defaultval (true if parameters have default values) NUMBER 8
s_notv6compat (found non v6 TYPE OR construct) NUMBER 7
char_for_varchar2 BOOLEAN  
libunit_type_spec NUMBER 1
libunit_type_body NUMBER 2
load_source_yes NUMBER 1
load_source_no NUMBER 2
Defined Data Types SUBTYPE ptnod IS pidl.ptnod;

SUBTYPE ub4 IS pidl.ub4;
Dependencies
DIANA PIDL SUBPTXT2
Exceptions
Error Code Name
N/A e_subpnotfound
 N/A e_notinpackage
 N/A e_nopriv
 N/A e_stubtoolong
 N/A e_notv6compat
 N/A e_other
 
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);
Source code included in package
 
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 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 usr. 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);
Source code included in package
 
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);
Source code included in package
 
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
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);
Source code included in package
 
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);
Source code included in package
 
Thanks to Maxim Demenko for pointing me to this package
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [114 users online]    © 2010 psoug.org