Why not use MOVOBJ and/or iNav?
As far as your manager..
1) I consider it very rare to change the schema of a production table. The
only time I can recall doing it was right after creation when after
realizing I screwed up and put it in the wrong one.
2) And there are thousands that work better with those functions.
"Because that's what I'm paid for?" :)
On Fri, Jun 7, 2013 at 4:23 AM, Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>wrote:
Let me explain first:
Around 3 years ago I wrote an application with new tables. All these tables
are created with DDL, Identity Columns are used in all tables. Primary Key
Constraints are created over these identity columns. Referential
are defined (based on these identity columns). Additional triggers are
added. All to keep data consistent. Additionally a bulk of views was
to move as much business logic into data base as possible. Most of these
views join the newly created tables with existing ones (mostly) within the
same schema but also with tables in other schemas.
Yesterday my manager came up: the tables (and dependent objects) for this
application must be moved into a different schema.
Unfortunately both schemas contain a lot of other objects, so save the
library and restore it with a different name is not possible.
... and unfortunately the second schema is also in the library list but
AFTER the first one where my tables are located currently.
What's the easiest way to get those tables moved?
What I've done so far is to generate an SQL script containing all the
creation statements for my tables and dependent objects, in the sequence I
need to create the objects (Tables first with identity columns GENERATE BY
DEFAULT without constraints and triggers, then copy data, change identity
columns back to GENERATE ALWAYS and RESTART WITH the next Id, then
all constraints, views, indexes). I' currently testing whether all objects
will be generated and copied correctly.
... and finally I'll rename all existing objects before deleting them after
having tested it.
Is there a better way?
BTW according to my manager this morning:
1. "It is normal to move productive data from one schema to another one"
(may be for test issues OK, but NOT productive data!)
2. "There are thousands of applications outside that work well without
Identities, Referential Integrities, triggers and commitment control."
"Why are you so arrogant to think you know it better!"
Also (according to my manager): "Those techniques are useless
because error messages are sent, that an user cannot understand."
Mit freundlichen Grüßen / Best regards
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives