uh_big_mike_boi
uh_big_mike_boi

Reputation: 3470

Qualified Oracle Function Name

Hi I have been working with SQL Server for a while. I am on ORacle 11g today though and I am a little lost.

I see an object with the name “Inventory_Part_Config_API.Get_Estimated_Material_Cost(contract, part_no, '*')”.

How can I look at the definition for this function?
Is Inventory_Part_Config_API a Schema? A package? A database? (I am pretty sure Oracle doesn't have 'databases' the same way SQL Server does though.

If Inventory_Part_Config_API is a package, how can I view all the packages? The same for databases. I know how to view all the schemas and I didn't see this.

Upvotes: 0

Views: 153

Answers (2)

Chinthaka Senaratne
Chinthaka Senaratne

Reputation: 110

Inventory_Part_Config_API looks like a package and Get_Estimated_Material_Cost is a procedure inside that package. If you have PL/SQL developer you can directly go to this package using RMB->View Spec and Body.

If you are using only SQL plus command prompt then you can see the source of the package using following command.

Select Text from User_Source where Name Like UPPER('Inventory_Part_Config_API');

For both, you need to have the permission to view the package body.

To view the type of any object you can use the SYS.USER_OBJECTS OR ALL_OBJECTS as mentioned in the previous answer.

Upvotes: 1

J91321
J91321

Reputation: 727

As mentioned in comments you can use USER_OBJECTS to see all objects where your user is the owner, in DBA_OBJECTS you can see all objects in database, this may not be accessible to you I think, if you don't have sufficient privileges (you need explicit privilege for this view or DBA role). Best way is probably to use ALL_OBJECTS there should be listed all object which are accessible by your user. So you can do something like this:

SELECT object_type FROM ALL_OBJECTS WHERE object_name = 'name_of_your_object';

If you want to check schemas then use SELECT * FROM DBA_USERS every schema is user in Oracle DB.

Upvotes: 0

Related Questions