cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

using DB2MVS11 (DB2 for z/OS v11) datasource. If a table will be renamed PowerDesigner is generating scripts like

...
drop table "tmp_TABLETT";
rename table TABLETT to "tmp_TABLETT";
...
insert into TABLETTSSS (C1, C2)
select C1, C2
from "tmp_TABLETT";

Searching for the definition of the rename table syntax I found
rename [table ][%OLDQUALIFIER%]%OLDTABL% to %NEWTABL%

So the %NEWTABL% will be taken from the %OLDTABL% by adding a "tmp_" prefix. Do we have the possiblity to change "tmp_" to another value and maybe restrict the length of %NEWTABL% to 15 characters in all Statements (DROP, RENAME, and INSERT)?

If I only modify %NEWTABL% variable with %[[?][-][<x>][.[-]<y>][<options>]:]<variable>% syntax only the rename table statement will be changed. Drop and Iinsert stay at "tmp_TABLETT".

Many thanks

Robert

0 Likes
View Entire Topic
GeorgeMcGeachie
Active Contributor
0 Likes

hello Robert

There appear to be two parts to your question -

  1. How do I limit the table names to 15 characters? The table name in the DDL is taken from the 'Code' of the table in the PDM - in the Database Definition file you can control the maximum length of table names See Maxlen, under Script\Objects\Table. Why do you want to keep your table names so short? 15 characters seems really unmanageable - you'll probably have to manually amend them to avoid duplicates, no matter how many abbreviations you use.
  2. Can I change the name of the temporary table that the script creates? I don't think you can, but why would you want to do that?

By the way, you probably already know that you can tell PD not to create temporary tables in the DB alter script - I'm not a DBA or DB Developer, so I can't say whether or not that's a good idea 🙂