I am trying to do the following; let's say I have created an object type in Oracle
create type test as object(
name varchar2(12),
member procedure print1);
/
create type body test is
member procedure print1 is
begin
dbms_output.put_line('Test');
end print1;
end;
/
Now I want to add a new member procedure print2 - again, I can do that by typing:
alter type test
add member procedure print2 cascade;
Now, my question is: how do I just define the body and add print2 without repeating other definitions? I know I can do a create or replace body test and list implementations for both procedures, but this is not practical as I have to maintain code for object types that others wrote and I have no idea how they implemented the code, just that these procedures and functions exist.
I have been through the documentation and the web, but could not find an answer and it seems silly to me that Oracle would expect the developer to type all the definitions again.
Regards, George
Use Oracle SQL Developer to change the type body.
Or use any text editor to change the source file and run it in your favorite SQL prompt.
Object types are the most advanced programming concept in Oracle. Maybe you'd be better off with standalone functions?
However, I understand your point. AFAIK the type body cannot contain functions that are not listed in the specification. The order of the methods shouldn't matter either, so there seems to be no reason not to have this option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With