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 DBMSOBJG
Version 11.1
 
General Information
Purpose Undocumented object generator
Source {ORACLE_HOME}/rdbms/admin/prvtbobg.plb & prvthobg.plb
Dependencies SELECT name FROM dba_dependencies WHERE referenced_name = 'DBMSOBJG'
UNION
SELECT referenced_name FROM dba_dependencies WHERE name = 'DBMSOBJG'
ORDER BY 1;
 
CHECK_PERMISSIONS
Undocumented

Verifies that the named object exists in the named schema and is the type identified object type
check_permissions(
sname IN VARCHAR2,
oname IN VARCHAR2,
type  IN VARCHAR2);
exec dbmsobjg.check_permissions('UWCLASS','AIRPLANES','TYPE');

exec dbmsobjg.check_permissions('UWCLASS','AIRPLANES','TABLE');
 
FIND_COL_INFO

Undocumented

Finds some type of information about columns

dbmsobjg.find_col_info(
column_name IN VARCHAR2,
coltab      IN dbms_utility.coltab) RETURN NUMBER;
set serveroutput on

DECLARE
 coltb  dbms_utility.name_array;
 i      NUMBER;
BEGIN
  coltb(1) := 'UWCLASS.SERVERS';
  coltb(2) := 'UWCLASS.SERV_INST';
  i := dbmsobjg.find_col_info('SRVR_ID', coltb);

  dbms_output.put_line(TO_CHAR(i));
END;
/
 
FIND_TS_INFO

Undocumented

Finds some type of information about tablespaces

dbmsobjg.find_ts_info(
tablespace_name IN VARCHAR2(30),
tstab           IN dbmsobjg.tspace_tab,
tscnt           IN NUMBER) RETURN NUMBER;
set servertoutput on

DECLARE
 tstab dbmsobjg.tspace_tab;
 tscnt NUMBER(3);
 i     NUMBER;
BEGIN
  dbmsobjg.get_tab_space('UWCLASS','AIRPLANES','TABLE',tstab, tscnt);

  i := dbmsobjg.find_ts_info('UWDATA', tstab, tscnt);

  dbms_output.put_line(TO_CHAR(i));
END;
/
 
GENERATE_DDL

Undocumented

Overload 1
dbmsobjg.generate_ddl(
sname           ?  ?,
oname          IN  VARCHAR2,
type           IN  VARCHAR2,
flavor_columns IN  name_array,
tablespace     IN  VARCHAR2,
ddltab         IN  VARCHAR2S,
ddllentab      IN  number_array,
use_tablespace IN  VARCHAR2,
create_storage IN  VARCHAR2,
disabled_trig  OUT VARCHAR2,
force_view     IN  VARCHAR2,
debug_table    IN  VARCHAR2,
ddlcnt         OUT NUMBER,
tstab          IN  tspace_tab,
tscnt          IN  NUMBER);
set linesize 121
col argument_name format a20
col position format 99
col data_type format a15
col in_out format a6
col type_owner format a12
col type_name format a20
col type_subname format a20

SELECT argument_name, position, data_type, in_out, type_owner, type_name, type_subname
FROM all_arguments
WHERE object_name = 'GENERATE_DDL'
AND package_name = 'DBMSOBJG'
AND overload = 1
ORDER BY position, data_level;

Overload 2
dbmsobjg.generate_ddl(
sname              ?     ?,
oname             IN     VARCHAR2,
type              IN     VARCHAR2,
flavor_columns    IN     name_array,
tablespace        IN     VARCHAR2,
ddltab            IN OUT VARCHAR2S,
use_tablespace    IN     VARCHAR2,
create_storage    IN     VARCHAR2,
disabled_trig        OUT VARCHAR2,
disabled_trig_ddl IN OUT VARCHAR2S,
force_view        IN     VARCHAR2,
debug_table       IN     VARCHAR2,
ddlcnt            IN OUT NUMBER,
disabledcnt       IN OUT NUMBER,
tstab             IN     tspace_tab,
tscnt             IN     NUMBER);
set linesize 121
col argument_name format a20
col position format 99
col data_type format a15
col in_out format a6
col type_owner format a12
col type_name format a20
col type_subname format a20

SELECT argument_name, position, data_type, in_out, type_owner, type_name, type_subname
FROM all_arguments
WHERE object_name = 'GENERATE_DDL'
AND package_name = 'DBMSOBJG'
AND overload = 2
ORDER BY position, data_level;
 
GET_NLS_SUBSTR

Undocumented
dbmsobjg.get_nls_substr(
s      IN     VARCHAR2,
offset IN OUT NUMBER,
len    IN     NUMBER) RETURN VARCHAR2;
set serveroutput on

DECLARE
 ofs NUMBER := 3;
 x   VARCHAR2(100);
BEGIN
  x := dbmsobjg.get_nls_substr('ZZDUALZZ', ofs, 4);

  dbms_output.put_line(ofs);
  dbms_output.put_line(x);
END;
/
 
GET_TAB_SPACE

Undocumented
dbmsobjg.get_tab_space(
sname     IN     VARCHAR2,
oname     IN     VARCHAR2,
otype     IN     VARCHAR2
tspacetab    OUT dbmsobjg.tspace_tab,
tspacecnt    OUT NUMBER);
set serveroutput on

DECLARE
 tstab dbmsobjg.tspace_tab;
 tscnt NUMBER(3);
BEGIN
  dbmsobjg.get_tab_space(USER, 'TAB$', 'TABLE', tstab, tscnt);
--  dbms_output.put_line(tstab(tscnt));
  dbms_output.put_line(TO_CHAR(tscnt));
END;
/
 
 
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [51 users online]    © 2010 psoug.org