subprograms in pl/sql [message #35641] |
Wed, 03 October 2001 07:10 |
Tony
Messages: 190 Registered: June 2001
|
Senior Member |
|
|
The question is can I have something in the following form, and if so what is the syntax.
This needs to load into memory nothing stored
DECLARE
-- variables
BEGIN
-- procedure here -- The prcedure has its own Begin -- and end here is where the errors pop up.
-- more code here such as cursors etc..
END;
----------------------------------------------------------------------
|
|
|
Re: subprograms in pl/sql [message #35642 is a reply to message #35641] |
Wed, 03 October 2001 07:28 |
Jon
Messages: 483 Registered: May 2001
|
Senior Member |
|
|
You can put subroutines in the DECLARE section which are executed from the main line logic. For example...
declare
function square (i IN NUMBER) return NUMBER
is
begin
Return(i*i);
end square;
BEGIN
DBMS_OUTPUT.PUT_LINE(to_char(square(9)));
END;
----------------------------------------------------------------------
|
|
|