Procedure Parameters

Procedures in Oracle can take optional parameters. Each parameter you specify can have a mode. The valid mode types are IN, OUT, and IN OUT. If you do not specify a mode, it defaults to IN. Note that while parameters also have a type, you do not specify the size of precision of types which normally have this information.

Here is some information which is counter intuitive. IN parameters are passed by reference. While OUT parameters are passed by value. Normally you would think it would be the other way around. At least that's how I think C, C++, and Java do it.

Some people think an OUT parameter is just like a return value. However this is not the best analogy. I heard it explained to me that it is more like the caller passing a bucket to the procedure. The procedure then fills the bucket with a certain OUT value.

Note that I have not spoken much about IN OUT parameters. I do not think I have used them much. My instructor for PL/SQL programming said that IN OUT parameters are just not that common. That makes sense. When do you need to receive a value in, and then turn around and want to overwrite it with something else?