Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
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, 7646👍, 0💬
Popular Posts:
How To Control White Spaces between Table Cells? - XHTML 1.0 Tutorials - Understanding Tables and Ta...
How To Enter Microseconds in SQL Statements? - MySQL FAQs - Introduction to SQL Date and Time Handli...
How To Assign Debug Privileges to a User? - Oracle DBA FAQ - Introduction to Oracle SQL Developer In...
How To Set Background to Transparent or Non-transparent? - CSS Tutorials - HTML Formatting Model: Bl...
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by p...