sakthikumar
asked on
Cascade and Cascade include table data
Hi Guys,
I read about cascade and Cascade include table data for altering Oracle types in Oracle Documentation.
But I am not able to understand.
Can someone explain with a small example.
I read about cascade and Cascade include table data for altering Oracle types in Oracle Documentation.
But I am not able to understand.
Can someone explain with a small example.
And where did you read that?
ASKER
I read like cascase will change in all dependent objects, can't understand exactly. what will be changed.
suppose if we are increasing the width of a type attribute and the type is used in a table.
what will be changed in the table, we are just referring the type in the table structure and when the type is changed
what have to be changed in the table.?
suppose if we are increasing the width of a type attribute and the type is used in a table.
what will be changed in the table, we are just referring the type in the table structure and when the type is changed
what have to be changed in the table.?
Based on the 10g docs, there is an example:
http://docs.oracle.com/cd/B19306_01/appdev.102/b14260/adobjadv.htm#CJGFFICH
Basically if you create a type that is used in tables and alter the type, how do you want to handle the changes for the dependent objects?
http://docs.oracle.com/cd/B19306_01/appdev.102/b14260/adobjadv.htm#CJGFFICH
Basically if you create a type that is used in tables and alter the type, how do you want to handle the changes for the dependent objects?
ASKER
how do you want to handle the changes for the dependent objects?
what changes for dependent objects, a type is changed and is referred in a table,
in that case,what change is required in dependent objects.
what changes for dependent objects, a type is changed and is referred in a table,
in that case,what change is required in dependent objects.
Then it sounds like you want cascade include.
ASKER
For eg:
CREATE OR REPLACE TYPE Project AS OBJECT (
project_no NUMBER(2),
title VARCHAR2(35),
cost NUMBER(7,2));
/
CREATE OR REPLACE TYPE ProjectList AS VARRAY(50) OF Project;
/
CREATE TABLE department (
dept_id NUMBER(2),
name VARCHAR2(15),
budget NUMBER(11,2),
projects ProjectList);
in this case, how can i see the metadata of the type "ProjectList" stored in department table. or in which view I can find the definition of this.
Just understand the example in your link.
http://docs.oracle.com/cd/B19306_01/appdev.102/b14260/adobjadv.htm#i1009137
CREATE OR REPLACE TYPE Project AS OBJECT (
project_no NUMBER(2),
title VARCHAR2(35),
cost NUMBER(7,2));
/
CREATE OR REPLACE TYPE ProjectList AS VARRAY(50) OF Project;
/
CREATE TABLE department (
dept_id NUMBER(2),
name VARCHAR2(15),
budget NUMBER(11,2),
projects ProjectList);
in this case, how can i see the metadata of the type "ProjectList" stored in department table. or in which view I can find the definition of this.
Just understand the example in your link.
http://docs.oracle.com/cd/B19306_01/appdev.102/b14260/adobjadv.htm#i1009137
ASKER
just want to understand the example in your link.
I don't know the exact view where you can see the actual definition information.
You can get the ddl with:
select dbms_metadata.get_ddl('TYP E','PROJEC TLIST') from dual;
The one view I could find that shows you some info is:
select * from DBA_TYPES where type_name='PROJECTLIST';
I looked a little but could not find the view that showed the actual information about 'what' it is.
You can get the ddl with:
select dbms_metadata.get_ddl('TYP
The one view I could find that shows you some info is:
select * from DBA_TYPES where type_name='PROJECTLIST';
I looked a little but could not find the view that showed the actual information about 'what' it is.
ASKER
OK. In the link it was mentioned like, whenever we include cascade for alter type.
all the metadata associated with dependent objects will be changed.
in this case just like to see the meta data of department table which stores the columns of the type.
all the metadata associated with dependent objects will be changed.
in this case just like to see the meta data of department table which stores the columns of the type.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.