<bdo id='VVTCY'></bdo><ul id='VVTCY'></ul>

        <small id='VVTCY'></small><noframes id='VVTCY'>

        <i id='VVTCY'><tr id='VVTCY'><dt id='VVTCY'><q id='VVTCY'><span id='VVTCY'><b id='VVTCY'><form id='VVTCY'><ins id='VVTCY'></ins><ul id='VVTCY'></ul><sub id='VVTCY'></sub></form><legend id='VVTCY'></legend><bdo id='VVTCY'><pre id='VVTCY'><center id='VVTCY'></center></pre></bdo></b><th id='VVTCY'></th></span></q></dt></tr></i><div id='VVTCY'><tfoot id='VVTCY'></tfoot><dl id='VVTCY'><fieldset id='VVTCY'></fieldset></dl></div>
        <legend id='VVTCY'><style id='VVTCY'><dir id='VVTCY'><q id='VVTCY'></q></dir></style></legend>

      1. <tfoot id='VVTCY'></tfoot>

      2. 如何在不使用 DESCRIBE 命令的情况下描述 Oracle 中的表?

        时间:2023-09-18
        1. <i id='gJCWG'><tr id='gJCWG'><dt id='gJCWG'><q id='gJCWG'><span id='gJCWG'><b id='gJCWG'><form id='gJCWG'><ins id='gJCWG'></ins><ul id='gJCWG'></ul><sub id='gJCWG'></sub></form><legend id='gJCWG'></legend><bdo id='gJCWG'><pre id='gJCWG'><center id='gJCWG'></center></pre></bdo></b><th id='gJCWG'></th></span></q></dt></tr></i><div id='gJCWG'><tfoot id='gJCWG'></tfoot><dl id='gJCWG'><fieldset id='gJCWG'></fieldset></dl></div>

        2. <legend id='gJCWG'><style id='gJCWG'><dir id='gJCWG'><q id='gJCWG'></q></dir></style></legend>
          • <tfoot id='gJCWG'></tfoot>

            <small id='gJCWG'></small><noframes id='gJCWG'>

                <tbody id='gJCWG'></tbody>
                • <bdo id='gJCWG'></bdo><ul id='gJCWG'></ul>
                  本文介绍了如何在不使用 DESCRIBE 命令的情况下描述 Oracle 中的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在上课时遇到了困难.我们需要编写一个与 DESCRIBE 命令类似的 Oracle 脚本.我们正在使用的这本书描述了如何非常糟糕地使用数据字典.不是在寻找答案,而是在正确的方向上找到一个点.

                  I'm having a hard time with a class I am taking. We need to write an Oracle script that will act just like the DESCRIBE command. The book we are using describes how to work with the Data Dictionary very poorly. Not looking for answers, but a point in the correct direction.

                  推荐答案

                  您正在寻找 USER_TAB_COLUMNS - 所有列及其在执行查询的架构中的描述 - 或 ALL_TAB_COLUMNS - 除了用户有权查看的所有表外都相同.

                  You're looking for USER_TAB_COLUMNS - all the columns, and their descriptions in the schema the query is executed in - or ALL_TAB_COLUMNS - the same except for all tables that user has permission to view.

                  一个典型的查询可能是:

                  A typical query might be:

                  select *
                    from user_tab_columns
                   where table_name = 'MY_TABLE'
                   order by column_id
                  

                  column_id 是表中列的顺序".

                  你应该确保'MY_TABLE'是大写的,除非你一直在添加带有大小写的表格(一个坏主意),在这种情况下你需要使用类似="MyTable"的东西.

                  You should ensure that 'MY_TABLE' is capitalised unless you've been adding tables with casing ( a bad idea ) in which case you need to use something like = "MyTable".

                  特别是 desc 等价于我从 ss64 中窃取的以下内容,一个优秀的 Oracle资源:

                  Specifically desc is equivalent to the following which I stole from ss64, a good Oracle resource:

                  select column_name as "Name"
                       , nullable as "Null?"
                       , concat(concat(concat(data_type,'('),data_length),')') as "Type"
                    from user_tab_columns
                   where table_name = 'MY_TABLE';
                  

                  您可以通过select * from dictionary找到所有此类视图,这是数据字典 或查看文档.

                  You can find all of this sort of view by select * from dictionary, which is the top level of the data dictionary or by looking at the documentation.

                  还有 DBA_TAB_COLUMNS,它与 ALL_TAB_COLUMNS 相同,但适用于数据库中的每个表.这假设您具有查看它和表的权限.如果您无权访问此表,则需要让您的 DBA 授予您 SELECT ANY DICTIONARY 权限.

                  There is also the DBA_TAB_COLUMNS, which is the same as ALL_TAB_COLUMNS, but for every table in the database. This assumes that you have the privileges to view both it and the tables. If you do not have access to this table you need to get your DBA to grant you the SELECT ANY DICTIONARY privilege.

                  这篇关于如何在不使用 DESCRIBE 命令的情况下描述 Oracle 中的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:冒号“:"是什么意思?在 SQL 查询中做什么? 下一篇:Spring Batch ORA-08177:运行单个作业时无法序列化此事务的访问,SERIALIZED 隔离级别

                  相关文章

                • <tfoot id='kUtD2'></tfoot>
                    • <bdo id='kUtD2'></bdo><ul id='kUtD2'></ul>
                    <i id='kUtD2'><tr id='kUtD2'><dt id='kUtD2'><q id='kUtD2'><span id='kUtD2'><b id='kUtD2'><form id='kUtD2'><ins id='kUtD2'></ins><ul id='kUtD2'></ul><sub id='kUtD2'></sub></form><legend id='kUtD2'></legend><bdo id='kUtD2'><pre id='kUtD2'><center id='kUtD2'></center></pre></bdo></b><th id='kUtD2'></th></span></q></dt></tr></i><div id='kUtD2'><tfoot id='kUtD2'></tfoot><dl id='kUtD2'><fieldset id='kUtD2'></fieldset></dl></div>
                  1. <legend id='kUtD2'><style id='kUtD2'><dir id='kUtD2'><q id='kUtD2'></q></dir></style></legend>

                    <small id='kUtD2'></small><noframes id='kUtD2'>