Rename the FK and PK, which exceed the limit name 30 characters

Hello

I am writing a custom (Rhino) script to change all the names of FK and PK, having more than 30 characters.
I have to do, because I get the script DDL Infosphere Data Architect, whitch ignores this restriction of Oracle.

I wrote this script, but it is not what I want. Instead of changing the name, it changes the PK / Index UK names. Can someone help me please.

tables = model.getTableSet () .toArray ();
for (var t = 0; t < tables.length; t ++) {}
table = table [t];
Index = table.getKeys ();
for (var i = 0; i < indexes.length; i ++) {}
index = index;
If ((index.isFK (): index.isPK ()) & & index.) GetName () .length > 30) {}
the index. SetName ('TEST');
}
}
}

Hello
Looks like you have broken it in two separate scripts.
Here's the script of filler treatment PK, FK and the UK:

tables = model.getTableSet().toArray();
for (var t = 0; t

This part will deal with primary keys AND unique keys:

 indexes = table.getKeys();
 for (var i = 0; i < indexes.length; i++) {
     index = indexes;     if((index.isUnique() || index.isPK()) && index.getName().length() > 30){          index.setName("TEST");     }}

This part will treat ONLY foreign keys:

   fkS = table.getFKAssociations();
   for (var i = 0; i < fkS.length; i++) {
     fk = fkS;     if(fk.getName().length() > 30){          fk.setName("TEST");     }}}

It can be executed as it is and validation after it will not return you "Primary key name has more than 30 characters". 

Tags: Database

Similar Questions

  • Does anyone know if Microsoft intends to increase the limit of 256 characters on the path/file names?

    It seems Im bumping up against the limit of 256 characters for path names / quite frequently these days. The increase of 8 + 3 characters for the file names, to the era of MS-DOS, to 256 characters/path of the file names is a wonderful thing when it was first implemented. But 256 limit character on the file + path names seems now quite inadequate. I'd even dare to suggest that increasing the limit above 256 would be more than just a nice update, but a required progress to catalogue the catalogue in full expansion of the knowledge we have today. Anyone know if Microsoft intends to increase this limit of 256 characters on the path + filename anytime in the near future?

    My recommendation is to increase the limit to a maximum of 256 characters to 4096 characters for the path + filename. This should be sufficiently comfortable for a few years anyway.

    System configuration: Winndows 7 RTM, Gigabyte GA-EP45-UD3L motherboard, Intel Pentium Dual - Core E6300 Wolfdale 2.8 GHz, 4 GB of memory PC-1066 DDR2 Patriot Viper, 500 GB Western Digital hard drive, GeForce 8800GT Videocard

    This already done with versions Unicode Windows API functions. When tools using the Ansi Version (to make it compatible with Win9x) the path is limited to 256 characters. "A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

  • Rename the file name background layer and move up

    I need a script that I can run at the end of an action to rename the name of the background layer and move it to the top of all the layers and hide visibility.

    That's what I want the layers of final document to look like, of course "filename" is the name of the file of the document itself. If I can change it to .jpg instead of a tif which would also be very useful.

    I use CC 2015 the more up-to-date version.

    Capture.JPG

    I found these scripts that are not exactly what I need, but close and I can't understand how to manipulate.

    Script layer moves

    Open, do, and rename the layer "Julieanne Kost's Blog

    Update: now, I think that this may be totally useless. Because of this, I wanted the original filename.jpg was so I could export the image as an asset later on the road. I just tried to create the image assets and found that it creates a folder for each file, so if someone can think of a better way, awesome.  I was able to create action and move all my layers of setting down instead of trying to move the layer of file name up and it worked, but because each file name is different I can't select and hide in my action. There is a solution simple but do not do exactly what I need.

    Thank you!

    Brandi

    #target photoshop;
    app.bringToFront();
    if(documents.length){
    var doc = activeDocument;
    doc.activeLayer = doc.layers[doc.layers.length -1];
    if(doc.activeLayer.isBackgroundLayer){
        doc.activeLayer.name = decodeURI(doc.name).toString().replace(/\..+$/,'') + ".jpg";
        doc.activeLayer.move(doc.layers[0], ElementPlacement.PLACEBEFORE);
        doc.activeLayer.visible = false;
        }
    };
    
  • Rename the file name

    I want to change a few medium-sized words my name of files like (SHT-30-SE45-CR-2003) HERE, I want TO CHANGE WORD from 30 to 25 AS (SHT -25- 2003-CR-SE45)

    1. Right mouse click on the file name.
    2. Select Rename from the context menu.
    3. The name will be highlighted.
    4. Use the left-right arrows of mouse or keyboard to move the cursor.
    5. Use the DELETE or BACKSPACE to delete characters.
    6. Type to add characters at the cursor location.
    7. Left mouse click on another part of the screen to change the name and exit.

    Tom Ferguson

  • Rename the column name of the view

    Suppose I have an employee of the table with the column name. Now, I want to make a view of the employee to the table with the name of the First_name and Last_name column. Is this possible?

    You can also use aliases in the view definition:

    CREATE VIEW employee_view (
      first_name,
      last_name
    ) AS
      SELECT first,
             last
      FROM   employee;
    

    However, you can rename a column in a view. You would have to DROP and CREATE or to CREATE or REPLACE.

    Concerning
    Peter

  • String panipulation - rename the package name in the source code.

    I want to do the replacement string as below:
    select 'CREATE OR REPLACE PACKAGE CollectStats IS
      PROCEDURE save_log(p_logrec IN LiveStatsLog%ROWTYPE);
      PROCEDURE UpdateLiveGamesHourlyStats;
      PROCEDURE UpdateSideGamesHourlyStats;
      PROCEDURE UpdateConcurrentPlayerStats;
      PROCEDURE CollectStats;
    END CollectStats;' from dual;
    
    -->
    
    select 'CREATE OR REPLACE PACKAGE CollectStats_20100810 IS
      PROCEDURE save_log(p_logrec IN LiveStatsLog%ROWTYPE);
      PROCEDURE UpdateLiveGamesHourlyStats;
      PROCEDURE UpdateSideGamesHourlyStats;
      PROCEDURE UpdateConcurrentPlayerStats;
      PROCEDURE CollectStats;
    END CollectStats_20100810;' from dual;
    The point is to rename the name of the package in the Package source code, in the first and the last line of the source code.
    This is only an example package. The query must sort the replacement of the chain so that the result would be, as shown in a package with a different name.
    Note that name of the package, and a procedure within the source code of the package are the same - see "PROCÉDURE CollectStats;".

    Somehow the replacement of the regular expression should be used.

    Published by: CharlesRoos on August 11, 2010 03:31

    Try this:

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'CREATE OR REPLACE PACKAGE BODY "XXX"."COLLECTSTATS" IS....
      2  PROCEDURE CollectStats IS
      3    BEGIN
      4      UpdateLiveGamesHourlyStats;
      5     UpdateSideGamesHourlyStats;
      6      UpdateConcurrentPlayerStats;
      7    END CollectStats;
      8  END CollectStats;
      9  /' body from dual)
     10  SELECT REPLACE(REPLACE(body,'BODY "XXX"."COLLECTSTATS"','BODY "XXX"."COLLECTSTATS_20100811"'),
     11         'END CollectStats;'||CHR(10)||'/','END CollectStats_20100811;'||CHR(10)||'/') body
     12* from t
    SQL> /
    
    BODY
    ----------------------------------------------------------------------------------------------------
    CREATE OR REPLACE PACKAGE BODY "XXX"."COLLECTSTATS_20100811" IS....
    PROCEDURE CollectStats IS
      BEGIN
        UpdateLiveGamesHourlyStats;
            UpdateSideGamesHourlyStats;
        UpdateConcurrentPlayerStats;
      END CollectStats;
    END CollectStats_20100811;
    /
    
    SQL> 
    
  • Form of process AD - rename the domain name does not

    Hi Experts,

    I changed the name of the label of 'AD Server' to 'Active Directory (AD) resource' in the form of process (UD_ADUSER) by creating a new version. But the process shape still shows the old name of the "AD Server" label. His poster is not the new tag name.

    Can U help me?

    Thanks and greetings
    INIYA

    The active version and also check if you have resource bundles, remove the resource bundles and restart (if you are not worried about beams) or take the resource for English beams and update the description of form there.

    Thank you
    Suren

  • Disable the limit text 70 characters on my iPhone 5 c?

    When I get a text of a person on an iPhone-no, it is broken down into 70 pieces of character and I am charged with 70 characters instead of 160 characters (I don't have unlimited messaging).

    Apparently, this has nothing to do with the carrier and implies a kind of framework in the phone... perhaps something involving "special characters", but I have no idea how to solve this problem in all environments.

    Any ideas on what might be happening would be appreciated.

    KrazyCat wrote:

    When I get a text of a person on an iPhone-no, it is broken down into 70 pieces of character and I am charged with 70 characters instead of 160 characters (I don't have unlimited messaging).

    Apparently, this has nothing to do with the carrier and implies a kind of framework in the phone... perhaps something involving "special characters", but I have no idea how to solve this problem in all environments.

    Any ideas on what might be happening would be appreciated.

    Once the characters in the UTF - 16 extended together (Emoji) are involved, each character takes two times more data, and you are therefore limited to 70 characters.

    70 characters SMS limit when text messages from Macbook

    https://www.Quora.com/why-does-using-Emoji-reduce-my-SMS-character-limit-to-70

  • After you rename the directory of missing files

    Hello

    I rename a directory of Windows and now all of the previous content are missing.  I need suggestions on how to recover.

    Background:

    My machine runs on Win7 x 64.  The "Downloads" folder under my profile of the user (C:\Users\Brian\Downloads) had been innaccesible for many months.  When I try to open, that it does not open and, possibly, the time-out.   I could see the content when you browse the directory in a shell.  As a work-around to access the content via a command prompt I moved all the files/directories in a new directory that I named "downloads" in the folder My Documents (C:\Users\Brian\Documents\downloads).   All files are installed perfectly (about 9 GB) and I could see all the files in the new profile of downloads (C:\Users\Brian\Documents\downloads).  Then I renamed the «_downloads» download folder

    When I open the _downloads file then all files were missing!  The directory is now completely empty.

    I tried two programs of recovery of files (NTFS Undelete and Piriform Recuva) without success.   I haven't restarted the computer.  I read that a possible solution would be to rename the original name 'downloads' folder, but I didn't yet.

    Any suggestions on next steps?

    Thank you!

    TestDisk (free) or R-Studio (not free).

    CHKDSK may be able to solve this problem, but be aware that there is always a risk of data loss when chkdsk is run, it is advisable to start on a clone rather than the original disk where the files are stored.

    John

  • Planning the application names

    In version 11.1.1 or 9.3.1 are we still limited to 8 application of character names in the schedule?

    Hello

    Yes the limit is 8 characters for both versions.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Cannot create or rename the new folders, cut and paste to a different destination

    Whenever I try to create a new folder it tells me that the file or folder does not exist when I cut paste in different folder does nothing so I have to drag-and - drop in different areas of my laptop to get the file where I want it to be.
    My OS is vista please anything you can do I appreciate it thanks

    Hello Young Ceaser,

    Thank you for using the Microsoft Windows Vista Forums.

    Have you always had this problem with the creation of a new folder?  When you try to create that file to?  Please let us know status.  Thank you!

    I'd like to experience for me to better understand the potential cause for what you are experiencing.

    What we will do is create a new folder in your user profile directory and test the availability of renaming.

    We also create a folder on your desktop and attempt to appropriate to see if we can then rename it.

    Here are the steps to do this:

    Click Start-> click on your username at the top right of the menu.

    In the new window, click on organize-> then new folder

    Check your ability to rename.

    From there, double-click the desktop folder.

    Take the same steps to create a new folder, test the name change.

    Then, on an issue that you cannot rename, test this procedure:

    To take ownership of a folder:

    Right-click the folder for which you want to set permissions, click Properties and then click the Security tab.

    Click Advanced to open the security settings advanced for the dialog box .

    Click on the owner tab, click on change. If you are prompted for an administrator password or a confirmation, type your password or click on continue.

    In the new security settings advanced to box, the change in ownership to: field, select your username and check Replace owner of subcontainers and objects. Click OK, repeat for the other boxes. (If your username does not appear click on the button other users or groups to add your account).

    Try to rename the folder.

    Once you are complete with tests, you can delete the folder created by right-clicking on them and selecting Remove.

    Engineer James Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • vCenter 4 and rename the server

    Hello, I got vCenter 4 installed and running under Windows 2003.

    Later, I've renamed the server since it is the default name of Microsoft at random.

    I am able to connect to vCenter and whatnot, however I noticed the 'performance' tab which shows the new mapping receives a message "cannot display the page.  If I look at the properties, I see her do a https://oldservername:8443/statsreport/vicr.do?blah_blah_blah_blah.   I had temporarily this problem by adding the former name of server to the hosts file.  OK it works.

    However, when I go to PlugIns, vCenter material status and vCenter Service status plugins said:

    The following occurred in download the scriptplugin of https://oldservername:8443/cim-ui/scriptConfig.xml: the remote name could not be resolved: 'oldservername '.

    Where in the database and/or do to solve this problem with the new name of the server?  I guess I could just rename the server to return... but I don't really want to.

    Any help would be appreciated!

    There are several problem with the renaming of VC.

    An XML file must be change manually.

    http://KB.VMware.com/kb/5850444

    http://communities.VMware.com/message/732613

    http://timjacobs.blogspot.com/2008/05/renaming-VirtualCenter-25-server.html

    André

    * If you found this device or any other answer useful please consider awarding points for correct or helpful answers

  • Urgent-renamed the folder in the folders and now error for all users?

    Hello
    Well I asked me to shorten a name in the shared folders and so I changed it. Now, I get an error if I click on tables of edge or shared folders (which is empty now btw?) or a catalog management, its display:

    Target path not found (operations customer/Shared /) error Code: GZ8VXQ96.

    Are we not supposed to create a folder in the folders and then change the name?

    Help, please. The server administrator BI tells me that everything the world reports are currently not available.

    Years

    Are we not supposed to create a folder in the folders and then change the name?

    You can, but as we are engineers, you can also expect impact of this...

    fix your problem is:

    1 rename the current folder in older...
    2. now, try to perform the operation and everything by doing this, you might have seen as option: preserve references to the old name of this item. below the field to rename...
    3. give the new name and use the name option preserve...

  • How can I copy and rename the file that I copied to another folder

    I have a file in a source file and I want to copy in a different folder.
    all these files from source have the same name and I put them in a folder which is the destination
    and I want to rename it to 1_1.txt 1_2.txt and so on.

    Here is my copy fuction

    UTL_FILE.fcopy ("FLX_SIGNATURES",
    filesource, - image source that I get using a loop above
    "DELTA_SIGNATURES,"
    filesource - destination image that I want torename
    );


    the foregoing is in a loop
    so for each filesoure, the name will be 1_1.txt for all files that have the same file name and I want to change the name of any time I copy can help you

    Dear kama021!

    Please take a look at the following link. It shows UTL_FILE. FRENAME. This should be the procuedure that fits your needs.

    [http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#i1003641]

    Yours sincerely

    Florian W.

  • How can I customize the Thunderbird message columns to show the raw sender address (not the full name) and e-mail address "received for" which was used to reach me?

    I find more and more important to be able to see the actual email address of the sender rather than just displaying the name, because they do not usually show a company name - a domain would always be. Is it possible to customize the settings/write a file of script/tweak to add columns of name email & domain raw? When dealing with a number of people from the same company, it is difficult to order or nod thanks to a list of emails to find. I know also that 2 people with the same name to different companies and it is impossible to distinguish.

    Secondly, as an addition of associated column, since a number of e-mail aliases join it would be useful to have a column to display the "received for" part of the source of the message that reveals the real enamel used in the To/CC/BCC, which led to me. Once again can it be twisted or scripted?

    I have programming experience but did not Add ons, and would be open to a proposal which is to create a custom module if adding columns with custom values is possible like this.

    Best regards

    Drew

    This module help you?

    https://addons.Mozilla.org/en-us/Thunderbird/addon/show-address-only/

Maybe you are looking for

  • Portege A100 (PPA10A) - where to get spare parts?

    Hi all I have a Portege A100 PPA10A, he is old enough and the cable from the Touchpad to the motherboard is broken. N that anyone know the part number for this cable or knows where I can get the part number? I sent an email to a place called "spare =

  • will not open several tabs from previous session start

    Upgrade to the latest version. He still asks about closing multiple tabs when Firefox is closed, but, initially up to automatically opens these tabs. I don't want to have to use 'restore previous session' every time. This does not work when another p

  • Portege M100 stop when unplug the a/c adapter - battery problem

    Hi people, Laptop for my wife, it's a Portege M100 3 or 4 years, which is seems a good machine, although the hard drive failed and had to be replaced recently.However, there is also a problem with the battery charging. The machine works very well whe

  • Satellite Pro 6100 orange clear syndrome

    Hello!I heard that SP 6100 had a problem with the power connector causing the light orange at the start and not starting at all.My toshiba did not start so often, so I can't count on it with my work.Is longer under warranty and I don't want to spend

  • Satellite P850 take about 4 minutes to start Windows after the Welcome screen

    Hey My SATELLITE P850 take some time after the Welcome screen to start windows, it was like this the first time that I get it. Any help or idea? thx a lot