开发者

Describe in SQL*Plus - does it call a package or run SQL? (Or something else?)

开发者 https://www.devze.com 2023-04-13 03:48 出处:网络
When I describe开发者_C百科 an Oracle TYPE in SQL*Plus, what does SQL*Plus do \"under the bonnet\" - Is it calling DBMS_METADATA (or similar)?Or is it querying the data dictionary directly?

When I describe开发者_C百科 an Oracle TYPE in SQL*Plus, what does SQL*Plus do "under the bonnet" - Is it calling DBMS_METADATA (or similar)? Or is it querying the data dictionary directly?

Or something else entirely?


You can obviously use alter session set sql_trace=true to answer such questions.

For

create type desc_type as object (
 dummy varchar2(1),

 constructor function desc_type (a number) return self as result,

 final member procedure m 

);
/

alter session set sql_trace=true;

desc desc_type

alter session set sql_trace=false;

drop type desc_type
/

I find the following relevant SQL Statements in my trace file:

select procedure#,procedurename,properties,itypeobj# 
  from procedureinfo$ where obj#=:1 
 order by procedurename desc, overload# desc

select position#,
       sequence#,
       level#,
       argument,
       type#,
       charsetid,
       charsetform,
       properties,
       nvl(length, 0),
       nvl(precision#, 0),
       nvl(scale, 0),
       nvl(radix, 0),
       type_owner,
       type_name,
       type_subname,
       type_linkname,
       pls_type 
  from argument$ 
 where obj#=:1 and procedure#=:2 order by sequence# desc

select max(procedure#) from procedurec$ where obj#=:1

select max(procedure#) from procedureplsql$ where obj#=:1

select max(procedure#) from procedurejava$ where obj#=:1

select procedure#,entrypoint# from procedurec$ 
 where obj#=:1 order by procedure#

select procedure#,entrypoint# 
 from procedureplsql$ where obj#=:1 order by procedure#

select procedure#,ownerlength,classlength,methodlength,siglength, flagslength,cookiesize 
  from procedurejava$ where obj#=:1 order by procedure#

select ownername,classname,methodname,signature,flags 
  from procedurejava$ where obj#=:1 and procedure#=:2 order by procedure#

select count(*) 
  from vtable$ where obj#=:1

select vindex,itypetoid,imethod#,iflags,itypeowner,itypename 
  from vtable$ where obj#=:1 order by vindex

select externtype, externname 
  from type$ where tvoid=:1

So, under the bonnet, SQL*Plus uses plain SQL.

0

精彩评论

暂无评论...
验证码 换一张
取 消