Renaming a View in DB2 v7

Edward Ryan

Renaming a View in DB2 v7
I have been asked if there is a Rename View function in DB2. We are
currently running DB2v7; hopefully, we will soon migrate to v8.

The DB2v7 SQL Reference manual does not include a Rename View command,
and the the Rename Table command states that the source table name must
not identify ... a view ...

Thank You.




The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Doyle Mark

Re: Renaming a View in DB2 v7
(in response to Edward Ryan)
There is not a "rename view" function per-se, but here is an easy way to
accomplish the same result:

1) Use your favorite "DDL generator" to give you the definition of the
existing view in "CREATE VIEW . . ." format.
2) Edit the definition to change the name as required.
3) Run the edited DDL using SPUFI, DSNTEP2, DSNTAID, etc.
4) Insure the new view is out there as you like it (can anyone say
"grants")
5) DROP the old view.
6) Done!

Mark

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Edward Ryan
Sent: Monday, January 28, 2008 2:12 PM
To: [login to unmask email]
Subject: Renaming a View in DB2 v7


I have been asked if there is a Rename View function in DB2. We are
currently running DB2v7; hopefully, we will soon migrate to v8.

The DB2v7 SQL Reference manual does not include a Rename View command,
and the the Rename Table command states that the source table name must
not identify ... a view ...

Thank You.




The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L
list archives, the FAQ, and delivery preferences are at
http://www.idug.org/lsidug under the Listserv tab. While at the site,
you can also access the IDUG Online Learning Center, Tech Library and
Code Place, see the latest IDUG conference information, and much more.
If you have not yet signed up for Basic Membership in IDUG, available at
no cost, click on Member Services at http://www.idug.org/lsms

______________________________________________________________________
This electronic message and any attachment is intended exclusively for the individual or entity to which it is addressed. It may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any unauthorized disclosure, copying, distribution or use of this electronic message or any attachment is prohibited. If you have received this message in error, please return it to the sender and delete this original from your system.

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

M. Khalid Khan

Re: Renaming a View in DB2 v7
(in response to Doyle Mark)
Why not simply create a new view with the desired name ?





"Edward Ryan" <[login to unmask email]>
Sent by: "DB2 Data Base Discussion List" <[login to unmask email]>
01/28/2008 02:11 PM
Please respond to
"DB2 Database Discussion list at IDUG" <[login to unmask email]>


To
[login to unmask email]
cc

Subject
[DB2-L] Renaming a View in DB2 v7






I have been asked if there is a Rename View function in DB2. We are
currently running DB2v7; hopefully, we will soon migrate to v8.

The DB2v7 SQL Reference manual does not include a Rename View command,
and the the Rename Table command states that the source table name must
not identify ... a view ...

Thank You.




The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L
list archives, the FAQ, and delivery preferences are at
http://www.idug.org/lsidug under the Listserv tab. While at the site, you
can also access the IDUG Online Learning Center, Tech Library and Code
Place, see the latest IDUG conference information, and much more. If you
have not yet signed up for Basic Membership in IDUG, available at no cost,
click on Member Services at http://www.idug.org/lsms




**********

The information contained in this communication is confidential, private, proprietary, or otherwise privileged and is intended only for the use of the addressee. Unauthorized use, disclosure, distribution or copying is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender immediately at (312)653-6000 in Illinois; (800)835-8699 in New Mexico; (918)560-3500 in Oklahoma; or (972)766-6900 in Texas.

**********

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Phil Grainger

Re: Renaming a View in DB2 v7
(in response to M. Khalid Khan)
Mark, you forgot

4a) Drop and recreate any dependent views on the old view to the new
view (and any dependent views on those must be recreated and and and
.....). Same goes for synonyms/aliases


Phil Grainger
CA
Product Management Director
Phone: +44 (0)1753 577 733
Mobile: +44 (0)7970 125 752
eMail: [login to unmask email]

Ditton Park
Riding Court Road
Datchet
Slough
SL3 9LL

CA plc a company registered in England and Wales under company
registration number 1282495 with its registered office at the address
set out above. VAT number 697904179.



-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Doyle Mark
Sent: 28 January 2008 20:34
To: [login to unmask email]
Subject: Re: [DB2-L] Renaming a View in DB2 v7

There is not a "rename view" function per-se, but here is an easy way to
accomplish the same result:

1) Use your favorite "DDL generator" to give you the definition of the
existing view in "CREATE VIEW . . ." format.
2) Edit the definition to change the name as required.
3) Run the edited DDL using SPUFI, DSNTEP2, DSNTAID, etc.
4) Insure the new view is out there as you like it (can anyone say
"grants")
5) DROP the old view.
6) Done!

Mark

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Edward Ryan
Sent: Monday, January 28, 2008 2:12 PM
To: [login to unmask email]
Subject: Renaming a View in DB2 v7


I have been asked if there is a Rename View function in DB2. We are
currently running DB2v7; hopefully, we will soon migrate to v8.

The DB2v7 SQL Reference manual does not include a Rename View command,
and the the Rename Table command states that the source table name must
not identify ... a view ...

Thank You.




The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L
list archives, the FAQ, and delivery preferences are at
http://www.idug.org/lsidug under the Listserv tab. While at the site,
you can also access the IDUG Online Learning Center, Tech Library and
Code Place, see the latest IDUG conference information, and much more.
If you have not yet signed up for Basic Membership in IDUG, available at
no cost, click on Member Services at http://www.idug.org/lsms

______________________________________________________________________
This electronic message and any attachment is intended exclusively for
the individual or entity to which it is addressed. It may contain
information that is privileged, confidential and exempt from disclosure
under applicable law. Any unauthorized disclosure, copying, distribution
or use of this electronic message or any attachment is prohibited. If
you have received this message in error, please return it to the sender
and delete this original from your system.

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L
list archives, the FAQ, and delivery preferences are at
http://www.idug.org/lsidug under the Listserv tab. While at the site,
you can also access the IDUG Online Learning Center, Tech Library and
Code Place, see the latest IDUG conference information, and much more.
If you have not yet signed up for Basic Membership in IDUG, available at
no cost, click on Member Services at http://www.idug.org/lsms

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Doyle Mark

Re: Renaming a View in DB2 v7
(in response to Phil Grainger)
Phil,
You make a good point

Mark

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Grainger, Phil
Sent: Monday, January 28, 2008 2:45 PM
To: [login to unmask email]
Subject: Re: Renaming a View in DB2 v7


Mark, you forgot

4a) Drop and recreate any dependent views on the old view to the new
view (and any dependent views on those must be recreated and and and
.....). Same goes for synonyms/aliases


Phil Grainger
CA
Product Management Director
Phone: +44 (0)1753 577 733
Mobile: +44 (0)7970 125 752
eMail: [login to unmask email]


______________________________________________________________________
This electronic message and any attachment is intended exclusively for the individual or entity to which it is addressed. It may contain information that is privileged, confidential and exempt from disclosure under applicable law. Any unauthorized disclosure, copying, distribution or use of this electronic message or any attachment is prohibited. If you have received this message in error, please return it to the sender and delete this original from your system.

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Philip Sevetson

Re: Renaming a View in DB2 v7
(in response to Doyle Mark)
Hey! I was gonna say that about the dependencies... Oh, well, Phil got
there first 'cause I was over digging a REXX n00b out of a weird syntax
error.

--Phil Sevetson, NYCAPS DBA Support
Financial Information Services Agency of The City of New York
450 West 33rd Street, 4th Floor
New York, NY 10001
phone: (212) 857-1688
mailto: [login to unmask email]
-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Grainger, Phil
Sent: Monday, January 28, 2008 3:45 PM
To: [login to unmask email]
Subject: Re: [DB2-L] Renaming a View in DB2 v7

Mark, you forgot

4a) Drop and recreate any dependent views on the old view to the new
view (and any dependent views on those must be recreated and and and
.....). Same goes for synonyms/aliases


Phil Grainger
CA
Product Management Director
Phone: +44 (0)1753 577 733
Mobile: +44 (0)7970 125 752
eMail: [login to unmask email]

Ditton Park
Riding Court Road
Datchet
Slough
SL3 9LL

CA plc a company registered in England and Wales under company
registration number 1282495 with its registered office at the address
set out above. VAT number 697904179.


-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Doyle Mark
Sent: 28 January 2008 20:34
To: [login to unmask email]
Subject: Re: [DB2-L] Renaming a View in DB2 v7

There is not a "rename view" function per-se, but here is an easy way to
accomplish the same result:

1) Use your favorite "DDL generator" to give you the definition of the
existing view in "CREATE VIEW . . ." format.
2) Edit the definition to change the name as required.
3) Run the edited DDL using SPUFI, DSNTEP2, DSNTAID, etc.
4) Insure the new view is out there as you like it (can anyone say
"grants")
5) DROP the old view.
6) Done!

Mark

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Edward Ryan
Sent: Monday, January 28, 2008 2:12 PM
To: [login to unmask email]
Subject: Renaming a View in DB2 v7


I have been asked if there is a Rename View function in DB2. We are
currently running DB2v7; hopefully, we will soon migrate to v8.

The DB2v7 SQL Reference manual does not include a Rename View command,
and the the Rename Table command states that the source table name must
not identify ... a view ...

Thank You.



=========
Confidentiality Notice: This e-mail communication, and any attachments, contains confidential and privileged information for the exclusive use of the recipient(s) named above. If you are not an intended recipient, or the employee or agent responsible to deliver it to an intended recipient, you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. If you have received this communication in error, please notify me immediately by replying to this message and delete this communication from your computer. Thank you.

Any opinions, expressed or implied, presented are solely those of the author and do not necessarily represent the opinions of the agency or the City.
=========

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Phil Grainger

Re: Renaming a View in DB2 v7
(in response to Philip Sevetson)
That's why there are tools :)

They tend not to forget the "other stuff"

Phil Grainger
CA
Product Management Director
Phone: +44 (0)1753 577 733
Mobile: +44 (0)7970 125 752
eMail: [login to unmask email]

Ditton Park
Riding Court Road
Datchet
Slough
SL3 9LL

CA plc a company registered in England and Wales under company
registration number 1282495 with its registered office at the address
set out above. VAT number 697904179.



-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Sevetson, Phil
Sent: 28 January 2008 20:51
To: [login to unmask email]
Subject: Re: [DB2-L] Renaming a View in DB2 v7

Hey! I was gonna say that about the dependencies... Oh, well, Phil got
there first 'cause I was over digging a REXX n00b out of a weird syntax
error.

--Phil Sevetson, NYCAPS DBA Support
Financial Information Services Agency of The City of New York 450 West
33rd Street, 4th Floor New York, NY 10001
phone: (212) 857-1688
mailto: [login to unmask email]
-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Grainger, Phil
Sent: Monday, January 28, 2008 3:45 PM
To: [login to unmask email]
Subject: Re: [DB2-L] Renaming a View in DB2 v7

Mark, you forgot

4a) Drop and recreate any dependent views on the old view to the new
view (and any dependent views on those must be recreated and and and
.....). Same goes for synonyms/aliases


Phil Grainger
CA
Product Management Director
Phone: +44 (0)1753 577 733
Mobile: +44 (0)7970 125 752
eMail: [login to unmask email]

Ditton Park
Riding Court Road
Datchet
Slough
SL3 9LL

CA plc a company registered in England and Wales under company
registration number 1282495 with its registered office at the address
set out above. VAT number 697904179.


-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Doyle Mark
Sent: 28 January 2008 20:34
To: [login to unmask email]
Subject: Re: [DB2-L] Renaming a View in DB2 v7

There is not a "rename view" function per-se, but here is an easy way to
accomplish the same result:

1) Use your favorite "DDL generator" to give you the definition of the
existing view in "CREATE VIEW . . ." format.
2) Edit the definition to change the name as required.
3) Run the edited DDL using SPUFI, DSNTEP2, DSNTAID, etc.
4) Insure the new view is out there as you like it (can anyone say
"grants")
5) DROP the old view.
6) Done!

Mark

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Edward Ryan
Sent: Monday, January 28, 2008 2:12 PM
To: [login to unmask email]
Subject: Renaming a View in DB2 v7


I have been asked if there is a Rename View function in DB2. We are
currently running DB2v7; hopefully, we will soon migrate to v8.

The DB2v7 SQL Reference manual does not include a Rename View command,
and the the Rename Table command states that the source table name must
not identify ... a view ...

Thank You.



=========
Confidentiality Notice: This e-mail communication, and any attachments,
contains confidential and privileged information for the exclusive use
of the recipient(s) named above. If you are not an intended recipient,
or the employee or agent responsible to deliver it to an intended
recipient, you are hereby notified that you have received this
communication in error and that any review, disclosure, dissemination,
distribution or copying of it or its contents is prohibited. If you have
received this communication in error, please notify me immediately by
replying to this message and delete this communication from your
computer. Thank you.

Any opinions, expressed or implied, presented are solely those of the
author and do not necessarily represent the opinions of the agency or
the City.
=========

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L
list archives, the FAQ, and delivery preferences are at
http://www.idug.org/lsidug under the Listserv tab. While at the site,
you can also access the IDUG Online Learning Center, Tech Library and
Code Place, see the latest IDUG conference information, and much more.
If you have not yet signed up for Basic Membership in IDUG, available at
no cost, click on Member Services at http://www.idug.org/lsms

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Luis M Martinez Ch

Re: Renaming a View in DB2 v7
(in response to Phil Grainger)
Only a little contribution-

The RENAME VIEW statement:

DB2 iseries 5.* does have it.
DB2 LUW 7,8,9 doesn't have it
DB2 ZOS 7,8,9 doesn't have it







[login to unmask email] escribió:

Why not simply create a new view with the desired name ?




"Edward Ryan" <[login to unmask email]>
Sent by: "DB2 Data Base Discussion List" <[login to unmask email]> 01/28/2008 02:11 PM Please respond to
"DB2 Database Discussion list at IDUG" <[login to unmask email]>


To
[login to unmask email] cc
Subject
[DB2-L] Renaming a View in DB2 v7




I have been asked if there is a Rename View function in DB2. We are
currently running DB2v7; hopefully, we will soon migrate to v8.

The DB2v7 SQL Reference manual does not include a Rename View command,
and the the Rename Table command states that the source table name must
not identify ... a view ...

Thank You.




The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms




**********
The information contained in this communication is confidential, private, proprietary, or otherwise privileged and is intended only for the use of the addressee. Unauthorized use, disclosure, distribution or copying is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender immediately at (312)653-6000 in Illinois; (800)835-8699 in New Mexico; (918)560-3500 in Oklahoma; or (972)766-6900 in Texas.
**********



The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at www.idug.org under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more.
If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services


Luis Miguel Martinez Chavez
IT Specialist
DB2 ZOS/LUW
Solaris/Linux/AIX

---------------------------------

¡Capacidad ilimitada de almacenamiento en tu correo!
No te preocupes más por el espacio de tu cuenta con Correo Yahoo!:
http://correo.yahoo.com.mx/

The IDUG DB2-L Listserv is only part of your membership in IDUG. DB2-L list archives, the FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information, and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms