Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Define a Sub Function
How To Define a Sub Function? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions
✍: FYIcenter.com
A sub function is a function defined and used inside another procedure or function. You need to define a sub function in the declaration part of the enclosing procedure or function. Sub function definition starts with the FUNCTION key word. Here is a sample script showing you how to define and use a sub function:
SQL> CREATE OR REPLACE PROCEDURE SUM_TEST AS 2 FUNCTION MY_SUM(X NUMBER, Y NUMBER) 3 RETURN NUMBER AS 4 BEGIN 5 RETURN X + Y; 6 END; 7 BEGIN 8 DBMS_OUTPUT.PUT_LINE('3 + 5 = ' || 9 TO_CHAR(MY_SUM(3,5))); 10 DBMS_OUTPUT.PUT_LINE('5 + 3 = ' || 11 TO_CHAR(MY_SUM(5,3))); 12 END; 13 / SQL> EXECUTE SUM_TEST; 3 + 5 = 8 5 + 3 = 8
2007-04-25, 7894👍, 0💬
Popular Posts:
What is Shell scripting A shell script is a script written for the shell, or command line interprete...
What does static variable mean? There are 3 main uses for static variables: If you declare within a ...
Where are cookies actually stored on the hard disk? This depends on the user's browser and OS. In th...
Which is the best place to store ConnectionString in Dot Net Projects? I am about to deploy my first...
How To Create an Add-to-Netvibes Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News ...