Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle8: ALTER TYPE does not work ?
Andrew Protasov (oracle_at_protasov.kiev.ua) wrote:
: > I am setting up an oracle training for our students, including
: > a small Oracle8 part.
: >
: > [...]
: >
: > CREATE OR REPLACE TYPE GeoCoord AS OBJECT
: > (Longitude NUMBER,
: > Latitude NUMBER);
: > /
: > 2 3 4
: > Typ wurde erstellt.
: > [engl: Type has been generated]
: >
: > SQL> ALTER TYPE GeoCoord REPLACE AS OBJECT
: > (bla number);
: > 2 ALTER TYPE GeoCoord REPLACE AS OBJECT
: > *
: > FEHLER in Zeile 1:
: > ORA-22319: Typattributinformationen in ALTER TYPE geaendert
: > [engl: Type Attribute Information changed with ALTER TYPE]
: >
: > Any hints (the same occurs when member methods are defined in the
: > ALTER TYPE statement) ?
: Why do you not use CREATE or REPLACE instead of ALTER?
I hope to have the possibility to add features to a type which is already used in table definitions *without* having to drop these tables (although stated in some books, REPLACE is not possible when a type ist already used):
SQL> CREATE OR REPLACE TYPE GeoCoord AS OBJECT
2 (MEMBER FUNCTION bla (gaga IN NUMBER) RETURN number);
3
3 /
CREATE OR REPLACE TYPE GeoCoord AS OBJECT
*
FEHLER in Zeile 1:
ORA-02303: Typ mit abhngigen Typen oder Tabellen kann nicht geloescht
oder veraendert werden.
[engl: a type with dependent types or tables cannot be deleted or
changed]
(since it is for an educational course, I would prefer an incremental approach by ALTER TYPE -- especially since ALTER TYPE is given in the manual)
Is this expected to change in further releases (currently using 8.0.3.0.0)?
Wolfgang