We help IT Professionals succeed at work.

Cascade and Cascade include table data

sakthikumar
sakthikumar asked
on
446 Views
Last Modified: 2014-09-01
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.
Comment
Watch Question

And where did you read that?

Author

Commented:
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.?
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
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?

Author

Commented:
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.
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
Then it sounds like you want  cascade include.

Author

Commented:
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

Author

Commented:
just want to understand the example in your link.
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019

Commented:
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('TYPE','PROJECTLIST') 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.

Author

Commented:
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.
CERTIFIED EXPERT
Most Valuable Expert 2012
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.