Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Alter ALIAS to get few New Columns into both ALIAS & TA
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: 1013
Location: India

PostPosted: Mon Mar 07, 2011 8:06 pm    Post subject:
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    Post subject: Reply to: Alter ALIAS
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: 1013
Location: India

PostPosted: Mon Mar 07, 2011 11:52 pm    Post subject:
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    Post subject: Reply to: Alter ALIAS
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    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sun Mar 13, 2011 3:54 pm    Post subject: Reply to: Alter ALIAS to get few New Columns into both ALIA
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    Post subject: Reply to: Alter ALIAS to get few New Columns into both ALIA
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sun Mar 13, 2011 9:57 pm    Post subject: Reply to: Alter ALIAS to get few New Columns into both ALIA
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: 1013
Location: India

PostPosted: Sun Mar 13, 2011 11:05 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
No new posts Define Alias for multiple Data sets u... sandy98669 JCL & VSAM 4 Fri May 27, 2016 1:07 pm
No new posts Combine columns without breaking words Indrajit_57 SYNCSORT 1 Sat Mar 19, 2016 9:33 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us