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, 7726👍, 0💬
Popular Posts:
What are database triggers? How are the triggers fired? Read this collection of questions and answer...
What is AL.EXE and RESGEN.EXE? In the previous question you have seen how we can use resource files ...
Which is the best place to store ConnectionString in Dot Net Projects? I am about to deploy my first...
Can JavaScript steal text from your clipboard? It is true, text you last copied for pasting (copy &a...
I have 5 questions please give me the answer ,explanation,suggestions if any?? what is PMP(project m...