And are there any concerns if the structure of the referenced
tables changes ?

Thanks for any hints or comments
Henrik

This e-mail, including attachments, is intended for the person(s)
or
company named and may contain confidential and/or legally
privileged
information. Unauthorized disclosure, copying or use of this
information
may be unlawful and is prohibited. If you are not the intended
recipient,
please delete this message and notify the sender

Henrik Sorensen

The sql reference manual under alias and synonyms states:
A table or view can be referred to in an SQL statement by its
name,
by an alias that has been defined for its name, or by a synonym
that
has been defined for its name.
Thus, aliases and synonyms can be thought of as alternate names
for tables and views.
The option of referencing a table or view by an alias or a
synonym
is not explicitly shown in the syntax diagrams ...

Actually I have tried it and the foreign key was indeed
created.

But even after carefully reading the manual, it is still not clear
to me
what happens to the foreign key definitions using the alias, when
the
original table that alias points to is changed.

Maybe it is not common to use alias in foreign key definitions.

That is the reason I ask this estimed list for an advise or any
other practical hints.

This e-mail, including attachments, is intended for the person(s)
or
company named and may contain confidential and/or legally
privileged
information. Unauthorized disclosure, copying or use of this
information
may be unlawful and is prohibited. If you are not the intended
recipient,
please delete this message and notify the sender
---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives
and home page at http://www.idugdb2-l.org/archives/db2-l.html.
From that page select "Join or Leave the list". The IDUG DB2-L FAQ
is at http://www.idugdb2-l.org. The IDUG
List Admins can be reached at [login to unmask email] Find
out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Andy Lankester

I suspect this one of things that no-one has ever thought to try.
My advice
would be not to do it since it almost certainly is exercising code
paths
that have rarely if ever been tested. What would happen if you
tried to
insert a row into a table that had a FK pointing to 'nothing'. I
would
suggest that this is 'undefined'. Anyway it should be too difficult
to set
up some simple tests and explore what does happen. Relying on it
still
happening in Vx is more problematical.

The sql reference manual under alias and synonyms states:
A table or view can be referred to in an SQL statement by its
name,
by an alias that has been defined for its name, or by a synonym
that
has been defined for its name.
Thus, aliases and synonyms can be thought of as alternate names
for tables and views.
The option of referencing a table or view by an alias or a
synonym
is not explicitly shown in the syntax diagrams ...

Actually I have tried it and the foreign key was indeed
created.

But even after carefully reading the manual, it is still not clear
to me
what happens to the foreign key definitions using the alias, when
the
original table that alias points to is changed.

Maybe it is not common to use alias in foreign key definitions.

That is the reason I ask this estimed list for an advise or any
other
practical hints.

This e-mail, including attachments, is intended for the person(s)
or company
named and may contain confidential and/or legally privileged
information.
Unauthorized disclosure, copying or use of this information may be
unlawful
and is prohibited. If you are not the intended recipient, please
delete this
message and notify the sender
----------------------------------------------------------------------------
-----
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives
and home
page at http://www.idugdb2-l.org/archives/db2-l.html.
From that page select
"Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org.
The IDUG List Admins can be reached at
[login to unmask email] Find
out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Andy Lankester

I suspect this one of things that no-one has ever thought to try.
My advice
would be not to do it since it almost certainly is exercising code
paths
that have rarely if ever been tested. What would happen if you
tried to
insert a row into a table that had a FK pointing to 'nothing'. I
would
suggest that this is 'undefined'. Anyway it should be too difficult
to set
up some simple tests and explore what does happen. Relying on it
still
happening in Vx is more problematical.

The sql reference manual under alias and synonyms states:
A table or view can be referred to in an SQL statement by its
name,
by an alias that has been defined for its name, or by a synonym
that
has been defined for its name.
Thus, aliases and synonyms can be thought of as alternate names
for tables and views.
The option of referencing a table or view by an alias or a
synonym
is not explicitly shown in the syntax diagrams ...

Actually I have tried it and the foreign key was indeed
created.

But even after carefully reading the manual, it is still not clear
to me
what happens to the foreign key definitions using the alias, when
the
original table that alias points to is changed.

Maybe it is not common to use alias in foreign key definitions.

That is the reason I ask this estimed list for an advise or any
other
practical hints.

This e-mail, including attachments, is intended for the person(s)
or company
named and may contain confidential and/or legally privileged
information.
Unauthorized disclosure, copying or use of this information may be
unlawful
and is prohibited. If you are not the intended recipient, please
delete this
message and notify the sender
----------------------------------------------------------------------------
-----
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives
and home
page at http://www.idugdb2-l.org/archives/db2-l.html.
From that page select
"Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org.
The IDUG List Admins can be reached at
[login to unmask email] Find
out the latest on IDUG conferences at http://conferences.idug.org/index.cfm