IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Alter ALIAS to get few New Columns into both ALIAS & TA


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Mon Mar 07, 2011 3:37 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Mar 07, 2011 8:06 pm
Reply with quote

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
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Mon Mar 07, 2011 11:08 pm
Reply with quote

Thank you for your answer. I will ALTER the table only assuming ALIAS will have the same.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Mar 07, 2011 11:52 pm
Reply with quote

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
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Tue Mar 08, 2011 8:06 am
Reply with quote

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
View user's profile Send private message
singhju

New User


Joined: 01 Dec 2010
Posts: 25
Location: Gurgaon

PostPosted: Tue Mar 08, 2011 10:55 am
Reply with quote

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
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Tue Mar 08, 2011 12:58 pm
Reply with quote

Thank you so much for prompt answer.
Back to top
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Fri Mar 11, 2011 8:34 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 13, 2011 3:54 pm
Reply with quote

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
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Sun Mar 13, 2011 6:30 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 13, 2011 9:57 pm
Reply with quote

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 icon_evil.gif
(*) be prepared to pay for this kind of consultancies four to five times the normal fee!
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sun Mar 13, 2011 11:05 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Remote Unload of CLOB Columns DB2 6
No new posts DROP & ALTER PARTITION-PBR DB2 0
No new posts Increase the number of columns in the... IBM Tools 3
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts DB2 Views with Multiple SQL & Col... DB2 8
Search our Forums:

Back to Top