Enherit column attributes when ALTERing column

2555 pts.
Tags:
AS/400 DB2
AS/400 tables
OSV6R1
SQL
V6R1
I have this:

1. A field-reference table (fieldref):

CREATE TABLE mylib/fieldref ( A CHAR (10) NOT NULL WITH DEFAULT, B CHAR (10) NOT NULL WITH DEFAULT, C DECIMAL (7 , 5) NOT NULL WITH DEFAULT, PRIMARY KEY (A))

2. A data table (myfile) created on the basis of the above fieldref table:

CREATE TABLE mylib/myfile AS (SELECT A, C FROM mylib/fieldref) WITH NO DATA

If I alter the attributes of a column (field) in my fieldref table, I would like the alteration to cascade to all tables created on the basis of fieldref; - is this functionality available with SQL ?

To clarify: An ALTER TABLE mylib/fieldref ALTER COLUMN a SET DATA TYPE CHARACTER (12) + ??? shall cause the a column in the myfile to also expand from 10 to 12 chars. 



Software/Hardware used:
OS i v6r1 on Power i

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    I haven't heard of such a capability, and I can't quite picture how it would work in practice. I'd expect potentially disastrous results in a number of cases. Consider a simple foreign key constraint over a CustomerNumber column. Half a dozen large tables might relate to a CustomerNumber. A change to increase size of a reference column from eight to ten characters would need to cascade through all tables simultaneously. Each table would need to be duplicated in whole at once (and it might need to happen within journal entries). I wouldn't be surprised if it could bring a system to its knees. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following