View previous topic :: View next topic
|
Author |
Message |
sid_aec
New User
Joined: 01 Jul 2008 Posts: 60 Location: Kolkata
|
|
|
|
Hi,
I have an ALIAS refrring a Db2 Table. I am about to Alter few columns into the table.
My objective is to get few New Columns into both ALIAS and TABLE.
Do I need to alter both Alias & Table or Altering TABLE only will reflect the new columns into ALIAS as well?
Please help. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Sid_aec,
Are you sure, you are talking about ALIAS. If its ALIAS, don't worry about it. Just ask your DBA to alter the table.
Thanks,
Sushanth |
|
Back to top |
|
|
sid_aec
New User
Joined: 01 Jul 2008 Posts: 60 Location: Kolkata
|
|
|
|
Thank you for your answer. I will ALTER the table only assuming ALIAS will have the same. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
You got to be kidding me!
sid_aec, First understand what is alias, synonyms, tables and views. Ask your collegues, GOOGLE, Read the manuals and get to know WHAT is WHAT.
Till then, don't make any changes.
To get you started
Regards,
Sushanth |
|
Back to top |
|
|
sid_aec
New User
Joined: 01 Jul 2008 Posts: 60 Location: Kolkata
|
|
|
|
Just Addition to my above reply, As per my understanding If I alter ALIAS /TABLE just either or of these two then both can be used into applications with the new added columns.
Just wanted to confirm from the forum. If someone has done similar activity then please share your experience. |
|
Back to top |
|
|
singhju
New User
Joined: 01 Dec 2010 Posts: 25 Location: Gurgaon
|
|
|
|
Hi Sid_aec,
An alias on a table cannot be altered. However, if you will alter the table by adding some new columns, then you can refer the table by its alias and it will be able to access the new columns.
So just altering the table will work. |
|
Back to top |
|
|
sid_aec
New User
Joined: 01 Jul 2008 Posts: 60 Location: Kolkata
|
|
|
|
Thank you so much for prompt answer. |
|
Back to top |
|
|
sid_aec
New User
Joined: 01 Jul 2008 Posts: 60 Location: Kolkata
|
|
|
|
Just Have one more question on this. I found in my system people have executed Alter Table Command on ALIAS and executed successfully . The same columns are altered as well into the table.
Can some one tell is there any difference between ALTER TABLE executed on ALIAS or TABLE? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
Can some one tell is there any difference between ALTER TABLE executed on ALIAS or TABLE? |
You should be able to understand Yourself the difference by rereading the link Sushanth pointed You to
( understanding above all the relation between ALIAS and <TABLE>name ...
what is an ALIAS and its relation to the original object )
no reason for anybody to reread and make a resume of the manuals!
in general to carry on administrative task on DB2 TABLES using the ALIAS is a bad practice!
all the elucubrations and requirements from a design point are carried on on the <base> object;
ALIASes are generally implementd much later in the process and most often because of needs external to the application for which the <table> was designed |
|
Back to top |
|
|
sid_aec
New User
Joined: 01 Jul 2008 Posts: 60 Location: Kolkata
|
|
|
|
Hi enrico-sorichetti,
Well My objective was not to get bookish answer & theoretical differences.
What theroies you said that I should understand, Yes I understood from the manual.
But my question is :
Is there any difference in the O/P when I use 'ALTER TABLE alias-name' instead of 'ALTER TABLE table-name'???
Is there anything other than BAD PRACTICE??? Is there anything from application perspective? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
Well My objective was not to get bookish answer & theoretical differences.
|
saying that
siddhartha Bhattacharya is wasting everybody' s time with his stubborness and stupid remarks
is the same thing as saying that
sid-aec is wasting everybody' s time with his stubborness and stupid remarks
once it is clear that sid_aec is an ALIAS for siddhartha Bhattacharya
any other comment is superfluous
well... when You ask on a forum You should be able to accept the answers You are given without criticizing them
if You cannot do that and Your objective is to get only the answers You like,
hire a paid consultant who will , for an appropriate fee (*), happily satisfy Your desires
(*) be prepared to pay for this kind of consultancies four to five times the normal fee! |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Sid_AEC,
Quote: |
Is there any difference in the O/P when I use 'ALTER TABLE alias-name' instead of 'ALTER TABLE table-name'??? |
First will fail.
Quote: |
Is there anything from application perspective? |
Developer's should know, from "WHERE" they are accessing data from.
Quote: |
Well My objective was not to get bookish answer & theoretical differences. |
Good Luck with that.....
Sushanth |
|
Back to top |
|
|
|