View previous topic :: View next topic
|
Author |
Message |
jose.jeyan
New User
Joined: 28 Jul 2006 Posts: 60 Location: Mumbai
|
|
|
|
wats the difference between alias and synonym
can anyone compare the functions pls
jose.jeyan |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
They are same except that synonyms can only be used by creator
& stored in SYSIBM.SYSSYNONYMS. While alias is an alternate name that can be used by everyone to refer the table or view in the same or remote db2 subsystem |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Ekta, can you please let me know what is the necessary of coding synonums and aliases when we have tables and views?
Thanks!
Rathna. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Rathna,
CREATE ALIAS WORKERS FOR EMPLOYEE
this will creates an alias WORKERS for the EMPLOYEE table:
CREATE SYNONYM WEMP
FOR DSN8810.EMPLOYEE;
This example does not work if the current SQL authorization ID is DSN8810.
this will creates an synonym WEMP for the EMPLOYEE table: |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Ekta, I got your point, my intention is though we are defining aliases and synonyms, finally these changes willreflect in the base tables only. In that case what is the necessary of declaring these two? B'cos I faced this question in several interviews. I have no exact answer for this. Even I have tried to find the documents on these two. But the thing is I am getting only how to create and use it. But I couldn't get What are all the necessary areas we MUST use only Synonym/Aliases.
If you have any doc link on this it would be very much helpful to me.
Thanks!
Rathna. |
|
Back to top |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Hi,
Alias and sysnoyms are not for the programer. It is for the end user,
Suppose, I am using table a which has very secured infomation then I need to disable the important information, So I need to provide the Synonym
Alias are for end user who doesnot know any complicated query |
|
Back to top |
|
|
|