在 SQL*Plus 中描述 - 它调用包还是运行 SQL? (或者其他什么?)

发布于 2024-12-09 13:21:02 字数 116 浏览 0 评论 0原文

当我在 SQL*Plus 中描述 Oracle TYPE 时,SQL*Plus “在幕后”做了什么 - 它是否调用 DBMS_METADATA (或类似的)?还是直接查询数据字典?

或者完全是别的什么?

When I describe 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜唯美灬不弃 2024-12-16 13:21:02

显然,您可以使用 alter session set sql_trace=true 来回答此类问题。

因为

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
/

我在跟踪文件中找到了以下相关的 SQL 语句:

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

因此,在幕后,SQL*Plus 使用普通 SQL。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文