Home » SQL & PL/SQL » SQL & PL/SQL » Can you have two stored functions with the same name ?
Can you have two stored functions with the same name ? [message #433248] Tue, 01 December 2009 00:06 Go to next message
priyasinha396
Messages: 15
Registered: November 2009
Location: Delhi
Junior Member
Can you have two stored functions with the same name ?

So far as I know, it should give the error as

Quote:

ERROR at line 1:
ORA-00955: name is already used by an existing object


but still I want to cofirm.
Re: Can you have two stored functions with the same name ? [message #433249 is a reply to message #433248] Tue, 01 December 2009 00:40 Go to previous messageGo to next message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can inside a package.

Regards
Michel
Re: Can you have two stored functions with the same name ? [message #433253 is a reply to message #433249] Tue, 01 December 2009 01:07 Go to previous messageGo to next message
priyasinha396
Messages: 15
Registered: November 2009
Location: Delhi
Junior Member
That means only packaged function/procedures can be overloaded,

and we can't create two stored functions with the same name as seperate objects in the database.

Am i correct?
Re: Can you have two stored functions with the same name ? [message #433254 is a reply to message #433253] Tue, 01 December 2009 01:12 Go to previous messageGo to next message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
That means only packaged function/procedures can be overloaded,

And type procedures too.

Quote:
and we can't create two stored functions with the same name as seperate objects in the database.

No, you can't.

Regards
Michel

Re: Can you have two stored functions with the same name ? [message #433255 is a reply to message #433253] Tue, 01 December 2009 01:17 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
priyasinha396 wrote on Tue, 01 December 2009 08:07
That means only packaged function/procedures can be overloaded,

and we can't create two stored functions with the same name as seperate objects in the database.

Am i correct?

Yes you can, as long as you put them in different schemas
Re: Can you have two stored functions with the same name ? [message #433256 is a reply to message #433254] Tue, 01 December 2009 01:19 Go to previous messageGo to next message
priyasinha396
Messages: 15
Registered: November 2009
Location: Delhi
Junior Member
Thanks...
Re: Can you have two stored functions with the same name ? [message #433257 is a reply to message #433255] Tue, 01 December 2009 01:24 Go to previous messageGo to next message
priyasinha396
Messages: 15
Registered: November 2009
Location: Delhi
Junior Member
Thanks...

It means creating stored function with same name is possible in different schemas but not in the same schema.
Re: Can you have two stored functions with the same name ? [message #433259 is a reply to message #433257] Tue, 01 December 2009 01:38 Go to previous message
Michel Cadot
Messages: 63810
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes.

Regards
Michel
Previous Topic: Comparing a field with a Set How to ?
Next Topic: Dynamically populating variables
Goto Forum:
  


Current Time: Thu Sep 29 05:36:20 CDT 2016

Total time taken to generate the page: 0.10100 seconds