Can I have procedures with the same name and number of parameters in the same package (ORACLE)?

Asked

Viewed 280 times

0

I can have a package with two procedures of the same name, quantity and type of parameters just by diversifying the name of the parameters?

  • What is the point of this? What will change in them beyond the name of the parameters? They will perform the same action?

  • @Laerte, a system I’m maintaining is generating a generic error enough not to help at all. I believe the cause of the error is the attempt to execute a precedent in the described scenario. Obviously they do not perform the same action.

1 answer

1


Yes, it is possible to create one or more procedures, functions, etc... in the same scope (e.g. package) with either different or equal amounts of parameters, names and types.

The compiler will call the subprogram in which the parameters passed are identified, either in quantity or value type, if the type of a parameter does not match the declaration an error will be returned.

Read about this in the oracle documentations:

Overloading Packaged Subprograms

Overloading Subprogram Names

Browser other questions tagged

You are not signed in. Login or sign up in order to post.