Re: this is probably a stupid question...

From: Douglas Whitacre <whitacre_at_imake.com>
Date: Fri, 8 Jan 1999 13:46:57 -0500
Message-ID: <775jr3$rup_at_world1.bellatlantic.net>


[Quoted] From my point of view, the only difference is that programming "purists" want to use functions as a means to assign a single value to something. ex.

x number
x = funx(parm1, parm2);

The function, funx returns a number

Procedures just run code. Now, you can define parameters as IN OUT and assign values that way as well, but the assignment is a whole lot clearer if you use a function.

procx(x, parm1, parm2);

where procedure procx uses first parm as IN OUT, and other two as just IN. As you can see from the two examples, if you are debugging code, the assignment statement is easier to recognize that the variable x is assigned a value. You would have to know the definition of procx to know which of the parm Is IN OUT, and further, you would have to understand the code to determine if ANY of the parameters get assigned inside the procedure.

Both functions and procedures can call other functions and procedures. It's just a matter of taste and clarity (IMO).

I hope this makes sense.

>
>Just embarking on Oracle development.
>
>What's the difference between a 'function' and a 'procedure' ? The
>only thing I can figure is that a function holds procedures.
>
>The online docs arent too good at exaplining this.
>
>
>Thanks for the help,
>Ryan
>
>
>[Remove the <NO SPAM> from my email address to reply]
Received on Fri Jan 08 1999 - 19:46:57 CET

Original text of this message