| Oracle XML_SCHEMA_NAME_PRESENT Version 11.2.0.3 |
|---|
| General Information | ||||||||||||||||||||||||||||||||||
| AUTHID | DEFINER | |||||||||||||||||||||||||||||||||
| Dependencies |
|
|||||||||||||||||||||||||||||||||
| First Available | 10.1 | |||||||||||||||||||||||||||||||||
| Security Model | Owned by SYS with no privileges granted | |||||||||||||||||||||||||||||||||
| Source | {ORACLE_HOME}/rdbms/admin/catxdbdv.sql & catxdbv.sql | |||||||||||||||||||||||||||||||||
| Subprograms |
|
|||||||||||||||||||||||||||||||||
| IS_SCHEMA_PRESENT | ||||||||||||||||||||||||||||||||||
| Undocumented - but here's the source code. Some of the slickest coding I've ever seen. <g> This code is in catxdbdv.sql and not implemented in 11.1.0.6 through 11.2.0.3. |
FUNCTION is_schema_present(objname IN VARCHAR2, userno IN NUMBER) RETURN NUMBER AS BEGIN RETURN 0; END; |
|||||||||||||||||||||||||||||||||
| SELECT xml_schema_name_present.is_schema_present('Larry Ellison', 1) FROM dual; |
||||||||||||||||||||||||||||||||||
| Undocumented - but here's the source code. This code is in catxdbv.sql. It is this code that is implemented in 11.1.0.6.through 11.2.0.3. |
function is_schema_present(objname IN VARCHAR2, userno IN NUMBER) RETURN NUMBER AS sel_stmt VARCHAR2(4000); tmp_num NUMBER; BEGIN sel_stmt := ' select count(*) ' || ' from user$ u, xdb.xdb$schema s ' || ' where u.user# = :1 ' || ' and u.name = s.xmldata.schema_owner ' || ' and (xdb.xdb$Extname2Intname(s.xmldata.schema_url, s.xmldata.schema_owner) = :2)'; EXECUTE IMMEDIATE sel_stmt INTO tmp_num USING userno, objname; /* schema found */ IF (tmp_num > 0) THEN RETURN 1; END IF; sel_stmt := ' select count(*) '|| ' from xdb.xdb$schema s ' || ' where bitand(to_number(s.xmldata.flags, ''xxxxxxxx''), 16) = 16 ' || ' and xdb.xdb$Extname2Intname( s.xmldata.schema_url,s.xmldata.schema_owner) = :1 ' || ' and s.xmldata.schema_url ' || ' not in (select s2.xmldata.schema_url ' || ' from xdb.xdb$schema s2, user$ u2 ' || ' where u2.user# = :2 ' || ' and u2.name = s.xmldata.schema_owner) '; EXECUTE IMMEDIATE sel_stmt INTO tmp_num USING objname, userno; /* schema found */ IF (tmp_num > 0) THEN RETURN 1; END IF; RETURN 0; END; |
|||||||||||||||||||||||||||||||||
| SELECT xml_schema_name_present.is_schema_present('Larry Ellison', 1) FROM dual; |
||||||||||||||||||||||||||||||||||
| Related Topics |
| Packages |
| 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-2013 Daniel A. Morgan All Rights Reserved | |||||||||
|
|
||||||||||