views:

39

answers:

3

I tried to modify a type using the following code and it gave me the error code: 'ORA-02303'. I don't know much about Oracle or PL/SQL but I need to solve this; so I'd appreciate any further help with this.

Thanks in advance. The code is just an example. But then again, I need to check its dependents first.

create or replace type A as object (
  x_ number, 
  y_ varchar2(10),
  member procedure to_upper
);
/
+1  A: 

I'm sure it's available in the data dictionary somewhere, but not sure where off-hand; and you're likely to have lots of dependencies that aren't easy to resolve. But you may be able to modify the existing type instead: http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_4002.htm

There's also a FORCE option but that could still invalidate dependent objects.

Alex Poole
+1  A: 

Look in DBA_DEPENDENCIES, ALL_DEPENDENCIES, or USER_DEPENDENCIES as appropriate:

SELECT OWNER, NAME, TYPE
  FROM DBA_DEPENDENCIES 
 WHERE REFERENCED_OWNER = [type owner]
   AND REFERENCED_NAME  = [type name]
   AND REFERENCED_TYPE  = 'TYPE'
/
Adam Musch
+1  A: 

If you've used the type in a table you should be able to see it through a query like :

select * from all_tab_columns
where data_type_owner not in ('SYS');

But I'd start off looking at Alex's suggestion of using ALTER TYPE

Gary