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

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

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

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

        <legend id='yCjvc'><style id='yCjvc'><dir id='yCjvc'><q id='yCjvc'></q></dir></style></legend>
      2. 从 oracle 获取函数列表和过程签名

        时间:2023-11-02
      3. <tfoot id='ZetIS'></tfoot>
          <tbody id='ZetIS'></tbody>

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

            • <legend id='ZetIS'><style id='ZetIS'><dir id='ZetIS'><q id='ZetIS'></q></dir></style></legend>

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

                  本文介绍了从 oracle 获取函数列表和过程签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否有任何查询可以为我提供函数/过程的签名详细信息.我在看返回类型,函数名,参数类型,是否为IN/OUT/INOUT.

                  Is there any query which can provide me signature details of a Function/Procedure. I am looking at return type, function name, argument types, whether IN/OUT/INOUT.

                  我知道这个 线程,但它只提供名称

                  I am aware of this thread, but it provides only names

                  推荐答案

                  这是一个生成 PL/SQL 函数原型的小脚本:

                  Here's a little script that produces PL/SQL function prototypes:

                  DECLARE 
                    -- Local variables here
                    strPrev_object          VARCHAR2(30);
                    strReturn_type          VARCHAR2(30);
                    strProcedure_definition VARCHAR2(32767);
                  BEGIN
                    -- This dumps out subprogram definitions.  It doesn't try to build
                    -- package scripts; instead, it dumps the package procedures as though they were defined
                    -- individually, with package name preceding subprogram name.
                  
                    FOR aRow IN (SELECT *
                                   FROM USER_ARGUMENTS a
                                   INNER JOIN (SELECT PACKAGE_NAME, OBJECT_NAME, MAX(SEQUENCE) AS MAX_SEQUENCE
                                                 FROM USER_ARGUMENTS
                                                 GROUP BY PACKAGE_NAME, OBJECT_NAME)
                                     USING (PACKAGE_NAME, OBJECT_NAME)
                                   WHERE PACKAGE_NAME IS NULL AND
                                         OBJECT_NAME = '<your package, procedure, or function>'
                                   ORDER BY PACKAGE_NAME, OBJECT_NAME, SEQUENCE)
                    LOOP
                      strProcedure_definition := NULL;
                  
                      IF strPrev_object IS NOT NULL AND
                         strPrev_object <> aRow.OBJECT_NAME 
                      THEN
                        IF strReturn_type IS NULL THEN
                          DBMS_OUTPUT.PUT_LINE('     );');
                        ELSE
                          DBMS_OUTPUT.PUT_LINE('     ) RETURN ' || strReturn_type || ';');
                        END IF;
                  
                        DBMS_OUTPUT.PUT_LINE('');
                      END IF;
                  
                      IF aRow.SEQUENCE = 1 THEN
                        IF aRow.ARGUMENT_NAME IS NULL THEN
                          strProcedure_definition := 'FUNCTION ';
                          strReturn_type := aRow.DATA_TYPE;
                        ELSE
                          strProcedure_definition := 'PROCEDURE ';
                          strReturn_type := NULL;
                        END IF;
                  
                        IF aRow.PACKAGE_NAME IS NOT NULL THEN
                          strProcedure_definition := strProcedure_definition || aRow.PACKAGE_NAME || '.' || aRow.OBJECT_NAME || '(';
                        ELSE
                          strProcedure_definition := strProcedure_definition || aRow.OBJECT_NAME || '(';
                        END IF;
                  
                        DBMS_OUTPUT.PUT_LINE(strProcedure_definition);
                      END IF;
                  
                      IF aRow.ARGUMENT_NAME IS NOT NULL THEN
                        DBMS_OUTPUT.PUT_LINE('     ' || aRow.ARGUMENT_NAME || '  ' ||
                                             CASE aRow.IN_OUT WHEN 'IN/OUT' THEN 'IN OUT' ELSE aRow.IN_OUT END || '  ' ||
                                             aRow.DATA_TYPE || CASE WHEN aRow.SEQUENCE <> aRow.MAX_SEQUENCE THEN ',' ELSE '' END
                                             );
                      END IF;
                  
                      strPrev_object := aRow.OBJECT_NAME;
                    END LOOP;  -- aRow
                  
                    IF strReturn_type IS NULL THEN
                      DBMS_OUTPUT.PUT_LINE('     );');  
                    ELSE
                      DBMS_OUTPUT.PUT_LINE(') RETURN ' || strReturn_type || ';');
                    END IF;
                  END;
                  

                  分享和享受.

                  这篇关于从 oracle 获取函数列表和过程签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:我们如何确定我的 oracle 表中的列正在被另一个表的触发器填充/更新? 下一篇:从 from 子句的列中获取表名

                  相关文章

                • <tfoot id='kxllE'></tfoot>

                    • <bdo id='kxllE'></bdo><ul id='kxllE'></ul>

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

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