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, 8125👍, 0💬
Popular Posts:
What is difference between Association, Aggregation and Inheritance relationships? In object oriente...
.NET INTERVIEW QUESTIONS - What are Daemon threads and how can a thread be created as Daemon? Daemon...
Can you explain in brief how can we implement threading ? Private Sub Form1_Load(ByVal sender As Sys...
How To Use mysqlbinlog to View Binary Logs? - MySQL FAQs - Server Daemon mysqld Administration If yo...
.NET INTERVIEW QUESTIONS - What is Suspend and Resume in Threading ? It is Similar to Sleep and Inte...