Grants using transformation scripts

Hello

I am trying to write a script (transformation) to give a table privileges to roles defined by the user.

For a few hours I searched on the web and also in the official documentation. No result, as trial and error.

Is there someone who can give a clue?

Kind regards

Hubert Schollen

Thanks Philippe! My script works very well at the moment!

Tags: Database

Similar Questions

  • Help for the dialog window "Table DDL Transformation Scripts"

    Hello world

    I'm trying to understand how to use transformation scripts. the Fund on the dialog window does not work. Is there a document describing the meaning of each of the Visual controls in this dialog box?

    In particular, I'm looking to create my own script attached to "create an after. Also plays with the 'empty' supplied script I found it's result appear if build up in the DDL result appears whenever I press the button additional Test line:

    Sincerely

    Alek

    Hi Alek,

    Thanks for reporting the problem with the generation of DDL to test. Otherwise, you can look here for more information user Oracle SQL Developer Data Modeler 4.1 - DDL generation using transformation scripts

    Philippe

  • How to use between operator in Disqualification without using the script processor?

    Hello Experts,

    How to use between operator in Disqualification? for example phonenumberLength between 7 and 10. I don't want to use the script processor? Also how to reproduce the SWITCH statement Disqualification CASE?

    Thank you

    Konate

    1 Add a processor 'check the length.

    2. connect the transformer and open the configuration dialog box

    3. in the tab 'Attributes' select your attribute of telephone number as the "field Check.

    4. in the tab "Options", enter "7-15"in the option 'number of valid characters.

    5. run the process.

    a. accounts with [included] a character length 7-15 phone numbers out of the release of "valid".

    b. records with a length of character <7 or="">15 phone numbers out of the release of "Invalid character count.

    Note: the processor also adds a 'LengthValid' flag attribute which you may also branch on [with the values "Y" and "NC" for both scenarios above]. See Library of processor of the online help for more information.

    Thank you

    Nick

  • transformation script changes not saved in design

    Hello

    I made several scripts processing to change my relational model to the Data Modeler.

    One of the scripts defined abbreviations of table for all the table based on the PK constraint. (I'm importing the model of my data dictionary which has PK constraints defined as {abbr} _PK)

    After I "Apply of Scripts of Transformation Custom", I see that all tables have now an abbreviation of the table.

    However, if I save my design, close and reopen it, all abbreviations are empty again.

    I did a few tests and manually fill the field of abbreviation Table changes be saved.

    If I check the table XML files, I can clearly see that the table for which I manually added the acronym has a < short > tag, which is not what I filled auto with the transfer script.

    I noticed a similar behavior for scripts that I use to fill the parameters of Auto_inrement and others. After I run the script, I can see all the values filled in my template, but is not be saved and I lose all the changes made after closing my model.

    I noticed that the changes be saved if I choose Save as and save my template in a new directory (however to register as in the same directory create a SVN error).

    Is there something I should add to my .js script that changes be saved?

    Is this a bug?

    Does anyone else have these issues?

    I use Data Modeler 4.1 early adapter on a win machine 7.

    An example of .js script I use:

    //******************************************************************************

    //

    NAME: set_table_abbreviation

    AUTHOR: NVDA - NIAUW

    OBJECTIVE: use this script to define abbreviations of table in the physical model for each table

    VERSION: 1.0

    //

    PREREQUISITES:

    -Table with PK constraint and name constraints = {table abbr} _PK - as it is in the designer

    //

    //******************************************************************************

    load compatibility to 4.1 data maker script (ea)

    Load("Nashorn:mozilla_compat.js");

    import Java packages

    importPackage (javax.swing);

    //----------------------------------------------------------

    Global declarations

    //----------------------------------------------------------

    var msg ="";

    //----------------------------------------------------------

    Main body

    //----------------------------------------------------------

    find all tables in datamodel in table

    tables = model.getTableSet () .toArray ();

    loop over the tables and do something with it

    for (var t = 0; t < tables.length; t ++) {}

    If (! table [t] .getAbbreviation ()) {}

    var abbr = setAbbrv ([t] tables);

    If (abbr! == ") {}

    tables [t] .setAbbreviation (abbr);

    tables [t] .setCommentInRDBMS ("abbreviation table: ' + abbr");

    MSG += "table" table [t] .getName () + 'got abbr' abbr + "\n";

    }

    }

    }

    inform about what happened

    If (msg! == ") {}

    JOptionPane.showMessageDialog (null, msg);

    } else {}

    JOptionPane.showMessageDialog (null, ' no table (without abbr) found.) ») ;

    }

    //----------------------------------------------------------

    Functions

    //----------------------------------------------------------

    FUNCTION: setTbleAbbrv

    //----------------------------------------------------------

    function setAbbrv (table) {}

    var = abbr "

    var s = table.getPKeys () .toArray ();

    for (var t = 0; t < constr.length; t ++) {}

    cast to string

    var strConstr = constr. [t] + '.';

    If (strConstr.match(/_PK./)) {}

    abbr = strConstr.replace var ('_PK' ");

    }

    }

    If (abbr = ") {}

    MSG += "table" + table.getName () + "is not a PK constraint. \n » ;

    }

    back to abbr;

    }

    FUNCTION: read

    //----------------------------------------------------------

    function read (pMessage) {}

    var input = JOptionPane.showInputDialog (pMessage);

    return entry;

    }

    Hello

    in the loop where you treat the tables, do the following:

    tables [t] .setDirty (true);

    This will mark the object as being edited and saved during the registration of the design.

    Joop

  • Problems with the debugger in Data Modeler Beta DDL Custom Transformation Scripts

    Hello

    I use Oracle SQL Data model Beta 4.1.0.866.

    Currently, I am working on a project to generate the models in PHP for our relational database models MVC framework. Some settings must be entered from the user,

    so, I'm importing Java classes for JOptionPane in the Transformation of the customized with DDL Scripts

    var ji = new JavaImporter(java.io, java.lang, javax.swing, java.util);

    I can use these classes with no problems, but when I want to use the debugger, it cancels the execution with this error message:

    debugger_data_modeler.PNG

    Is this a bug or am I missing something here?

    And would it not possible and even preferable to processing entirely in Java instead of JavaScript scripts?

    Hello

    Try it following the syntax:

    var ji = new JavaImporter(java.io, java.lang, Packages.javax.swing, java.util);

    And would it not possible and even preferable to processing entirely in Java instead of JavaScript scripts?

    Well, it's not on the use of JavaScript, it's scripts in Java Platform - JSR 223 https://www.jcp.org/en/jsr/detail?id=223

    So if you have a JSR 223 engine of script in the JAVA virtual machine you can use your scripting language. We simply provide a setting where you can put your scripts to do something useful.

    We don't know in advance what language will be used. JavaScript engine is included in Java6 and Java7 so this is the reason why our examples are in JavaScript.

    Using Java instead of JavaScript don't make the job easier, look at the part of import here - Re: impossible to cast objects in the Script SQL DM 4.0 Transformation

    Philippe

  • Transformation script: create package

    Hello experts,

    I is currently examining the possibilities of transformation scripts in the SQL developer Data Modeler.

    I'm using version 4.0.3.853 and Mozilla Rhino on a relational model.

    I already understood how to create triggers and sequences in the physical model, but does not have the same approach to the package.

    Create sequences:

    SEQ = model.getStorageDesign () .getSequenceSet () .createSequence ();

    Create a trigger:

    Trigg = model.getStorageDesign () .getTriggerSet () .createTrigger ("TriggerOracle");

    Following these statements, I try to create a package, but does not seem to do things.

    I have already tried:

    CPK = model.getStorageDesign () .getPackageSet () .createPackage ();

    CPK = model.getStorageDesign () .getPackageSet () .createPackage ("PackageOracle");

    CPK = model.getStorageDesign () .getPackageSet () .createPackageOracle ();

    CPK = model.getStorageDesign () .getPackageSet () .createOraclePackage ();

    but in all cases to get the error "TypeError: cannot find the function object packages xxx" where xxx represents the feature that I used.

    When I check the documentation of the meta model, there is a createPackage method but it does not work.

    Can someone help me on this? What I am doing wrong?

    Any help would be appreciated!

    Kind regards

    Bart

    Hi Peeteba,

    try this one:

    CPK = model.getStorageDesign () .createPackageOracle ();

    Best,

    Ivan Zahariev

  • Cannot remove index via the transformation script custom

    I want to remove through the Custom transformation script a clue, in the relational model.
    Le script runs without error by only the index is not deleted

    1. tables = model.getTableSet () .toArray ();
    2. for (var t = 0; t < tables.length; t ++) {}
    3. table = table [t];
    4. table.setDirty (true);
    5. constlist = table.getKeys ();
    6. for (var i = 0; i < constlist.length; i ++) {}
    7. constraint = constlist [i];
    8. constraint.setDirty (true);
    9. indname = constraint.getName () + "_IX";
    10. {if (Constraint.isFK ())}
    11. index = table.getIndexes () .getByName (indname);
    12. index = table.getObject (indname);
    13. If (index! = null) {}
    14. index.setDirty (true);
    15. {if (index. GetName(). Equals (indname))}
    16. the index. Remove;
    17. }
    18. }
    19. }
    20. }
    21. }

    Hello

    If you use "debug", probably you will see some of the problems you have.

    line 16 - index.remove;

    be - index.remove ();

    but you can't get there because you're wrong check:

    {if (Constraint.isFK ())}

    must be:

    {if (!) {(Constraint.isFK ())}

    other problems:

    (1) 4th place will put all the paintings as dirty

    table.setDirty (true);

    This should be moved after the removal of the index

    (2) the same for the constraint - you define constraints like salty, BTW, it is not necessary define elements of array as dirty, if the table is / will be defined as dirty.

    Script could be dangerous - make your tests on the copy of the drawing or model. Versioning can help here - after running the script and save the drawing, you can see in the outgoing changes (subject to a window changes) exactly what is changed by this script and probably undo the changes if you don't like them.

    Philippe

  • delete the index in the transformation script

    In a custom transformation script, I would delete the indexes on a table.  However, I don't see that there is no table.removeIndex function ().  Is there another way I can drop an index?

    You can use the table.remove(KeyObject key) method, passing the Index into the KeyObject parameter.

    David

  • Can we migrate Informatica transformation Scripts in Oracle Data Integrator?

    Hello

    I just wanted to know that if we can migrate/move/use the transformation scripts that build in INformatica power Center in oracle Data Integrator. (ODI).

    If 'YES' then what the tool is used to migrate.

    with impatience.

    Kind regards

    AMSI

    Hello

    Just to clarify any passage of Informatica in ODI you will have to do it yourself, like a reimplementation

    Your informatica workflow to create new package ODI (eventually plan to charge).
    Use your mappings informatica to create new ODI interface (don't forget that ODI can load only 1 target by interface table)

    Oracle Open World, this has been a hot topic in the discussions, but there was nothing still.

    Thank you

    ~ KKT ~.

  • connection to the base of a transformation script?

    Hello

    For a specific purpose, I think of a custom transformation script that would SELECT data from an oracle database. I experimented a bit with mozilla rhino (outside data Modeler), but I could not import the necessary java packages into a javascript program, no matter how to set the classpath to invocation. Then I started to wonder if it wouldn't be possible at all inside the Data Modeler. So I ask here: is it possible to connect to oracle from a custom transformation script and if yes, then what is the method?

    Hello

    Here are two examples:

    Precision of the numbers lost when importing Erwin 7.3 model

    Re: How to create foreign keys in the relational model using the Transformation

    I think that there is more on the forum, but those that should be sufficient.

    Philippe

  • help to change the size of precomp (weight and size using the script)

    Hi guys, need help with change precomp size (weight and size using the script), my problem in this... when I change the size of the model (height and weight) of GUI AE, AE change the size of the composition of the Center model, but if I change the size of the model of my script it change from upper left... so I need some how change in the center of scripts of composition or something like that?

    now I change size with this code

    MyComp.Width = myComp.Width.Width + 50;

    MyComp.Height = myComp.Width + 50;

    Hi Zipkiev,

    If you want to change the composition and all the layers it contains, there is a script: scale Composition.jsx that comes with Ae (in the Scripts folder) which does exactly the same thing.

    He puts on a scale by a factor uniform using a temporary null object. You can twist no uniform scaling by a factor.

    But if you want only to preserve the size of the layers and adjust their position so that their new position relative to the new comp Center is the same as previously, the script above can not help.

    In the simplest situation you just compensate for all positions of layers related by the same amount: [(compNewWidth-compOldWidth) * 0.5, (compNewHeigth-compOldHeight) * 0.5].

    Not sure it will work well in all situations (such as 3D with cameras).

    You can try it, it might work for you:

    COMP is the composition, newWidth, newHeight its new width/height

    var

    DX = (newWidth - comp.width) * 0.5;

    DY = (newHeight - comp.height) * 0.5;

    layer, n,

    p, j,

    value;

    COMP. Width = newWidth;

    COMP. Height = newHeight;

    for (n = 1; n<=comp.numLayers;>

    layer = comp.layer (n);

    If (layer.transform &! layer.parent) {}

    p = layer.transform.position;

    If {(p.numKeys===0)}

    p.value = value;

    value [0] += dx;

    value [1] += dy;

    p.setValue (value);

    }

    else {}

    for (j = 1; j<=p.numKeys;>

    value = p.keyValue (j);

    value [0] += dx;

    value [1] += dy;

    p.setValueAtKey (j, value);

    };

    };

    };

    };

  • Tips for the custom transformation script change the Associations of FK table

    Hello

    I try to write a transformation script that will scroll through tables in a large model and change some
    FK associations to change the remote table at CF. By the way, the reason is that our logic model
    the logical entities that represent many areas of codes of small research. However, our relational and physical model has a
    utility single physical filing table of codes that contains all areas of these codes. Therefore, a part of the transformation
    our logic model for the relational model is to swing all FK associations for these areas of research codes
    in the table of common code. Then the paintings representing the research areas can be removed from hard.

    In any case, I'm looking at the

    oracle.dbtools.crest.model.design.relational.FKIndexAssociation

    or the

    oracle.dbtools.crest.model.design.relational.Index

    to see if one of them can be manipulated to perform the transformation I want to accomplish.

    When I perform the equivalent process manually via the property sheets there are several ways to address this problem.

    (a) the method more jolise seems to change the FK in place by clicking on the FK in the relational schema and changing
    the property called ' PK / UK Index'. Change that to the pharmacokinetics of utility code repository table that replaces the original
    table (which represents the research field). A side effect of this translates into CF mapping
    columns being nulled out. They must be remapped to original columns (which are kept).
    So in two stages, the existing FK is detached from the original, attached table to the new table, and then
    FK columns are reused in place for new CF mapping.

    (b) the brute force method is to remove the original FK and then create a completely new FK to the new table. There are
    several dialog boxes that allow you to keep the original FK columns and use them in the new FK.

    I realize, this is a somewhat complex transformation, but I would like a few algorithmic advice on which path to take
    to try to achieve. In particular, there is a script that is equivalent to that of the first process above?

    I don't even know if the CF which is represented on the relational schema is represented by the FKIndexAssociation or Index
    class in the script object model. In other words, I have to loop through the tables in the relational model what would be my
    starting point:

    FKS = table.getFKAssociationsList ();

    or

    fkIndexes = table.getAllInds_FKeyInds ();

    or something else. The names of the properties in the user interface are always with the properties of scripts not so
    It's a little difficult to understand such things.

    Once I have access to the object that is equivalent to the FK in the property/diagram worksheet, which
    is the best way to handle via script. How can I change the end of parent and away from CF to point to the new table.
    Or if I have to delete the original CF and then re-create - is there a way to save the original FK columns and reuse them
    While creating the new FK?

    ********************

    Another question. What is the best way to remove tables from a relational model. I note that there is a remove() undocumented (?)
    a method that is available on the Table. It's probably a superclass to remove other things as well.

    When I try to use this method in a loop the script throws up to dialog boxes that are similar to dialog boxes that are displayed during the execution of a removal
    manually through the user interface. Is it possible to intercept and answer dialogs programmatically?
    So for example if I get a window of dialogue as

    You want to remove generated columns of FK 'FOO' in the table 'BAR '?

    is it possible to intercept this dialog in the script and then answer Yes or no it via the script?

    ***************

    If it is too difficult to perform this type of transformation with the help of script
    is to do the transformation on the generated DDL file. But it would be cleaner to
    to do the transformation in the relational model DM if possible.

    All advice appreciated.

    Rgds, BP

    When I try to use this method in a loop the script throws up to dialog boxes that are similar to dialog boxes that are displayed during the execution of a removal
    manually through the user interface. Is it possible to intercept and answer dialogs programmatically?
    So for example if I get a window of dialogue as

    You want to remove generated columns of FK 'FOO' in the table 'BAR '?

    is it possible to intercept this dialog in the script and then answer Yes or no it via the script?

    It's in the preferences - "Data Modeler > model > relational > remove FK column strategy."

    I don't even know if the CF which is represented on the relational schema is represented by the FKIndexAssociation or Index

    Is a pair of two - FKIndexAssociation, that's what you see the pattern, but it is hidden in the table index - isFK() returns true for this type of index and you can take FK with getFKAssociation()

    Once access to the object that is equivalent to the CF in the property/diagram worksheet

    table.getFKAssociations () - returns an array of the foreign keys;
    You can get to them from the relational model:
    model.getFKIndexAssociationSet () .toArray () - FK all model

    How can I change the end of parent and away from CF to point to the new table.
    Or if I have to delete the original CF and then re-create - is there a way to save the original FK columns and reuse them
    While creating the new FK?

    There should be no problem if you use the same number of columns with the same data type and order:

    get the current FK columns
    columns = fk.getColumns ();
    newRefKey is the new key question; referred and child columns must match the data type and the order in the keys - you do not ask how to get
    fk.changeKeyObject (newRefKey, columns);

    function setting in preferences, you will get the question on the columns of FK.

    Therefore, a part of the transformation
    our logic model for the relational model is to swing all FK associations for these areas of research codes
    in the table of common code. Then the paintings representing the research areas can be removed from hard.

    You can create the hierarchy of entities with the root attribute (and PK identifier) KP holding entity and entity - your look-up - empty child relationships will be these entities of the child. With the help of the transformation of the "unique Table" you will get what you are trying to achieve now with script.

    Philippe

  • How to use the script "click menu item" command on a menu item for an application that runs under another user?

    Hey everyone, quick question...

    I am trying to run this script:

    say application "System events".

    say process of "iTunes."

    click on menu item "Start Station" from the menu 'Song' to menu bar item 'Song' in the menu bar 1

    end say

    end say



    The idea behind this is to start a song selected currently playing station. I know, it's not hard to do it manually, but I want to be able to do it without having to call the iTunes app to the front. Now, this script works for my own iTunes app, but I have a second instance of iTunes connecting the second user on my computer at home (User2), with its own separate library and account and all. script I have works fine for an instance of iTunes under my user account, but I can't figure out how to specify which instance of iTunes, I'd like the script to work on.




    I want to emphasize as an FYI that i use.


    the shell script "connection f User2 /Applications/iTunes.app/Contents/MacOS/iTunes > & - 2 > & - &" with administrator privileges

    -to open my second instance of iTunes as User2



    is there a way to change the "process"iTunes"to say" something like 'process 'unix ID' say' and have the ID for each respective instance of iTunes unix?


    Let me know if I do not make sense... Thanks in advance to anyone who can help






    You can target a process of application using various properties of system events, for example:

    tell application "System Events"
      tell first item of (get application processes whose unix id is 15174) -- or whatever id
        activate --> needed when using GUI scripting
        get properties
      end tell
    end tell
    
  • Name of access to case / battery inside the case using VI scripts

    Hello everyone. I have a script that finds all instances of a specific under vi. All instances of this subroutine VI will be contained in a box structure. Using VI scripts, I want to be able to cross back and determine the name of the case that the sub vi is in. Is attached an image of the code that I currently have, however he mistakes in the part where I cast the reference to a case structure. Anyone know what I am doing wrong? Thank you.


  • How can I put a digital indicator in a box structure using VI scripts

    I am using VI scripts and I try to add a digital indicator within a box structure.  I'm able to add the structure of the case and the digital display fine, but as soon as I determine the structure of the case as the 'owner' of the digital (rather than the pattern-block being owner) I get error 1060.  Is there a way to get around this?

    Note: I am doing this is because this particular (indicator in a case structure) provision will prevent a VI to be inline when it is built.  This model will provide no functionality itself, it prevents only inlining.  It is added to a larger VI which is used to initialize objects in a simulation, and there are many of them in the total simulation.  If they are inlined, it takes a long time to generate the C code and a performance on this VI is not a problem because it is run only once at the beginning of the simulation.  The rest of the screw must be inline for performance reasons.  Therefore, I am open to other options to avoid a screw of Inline if 'the indicator in a structure of the case' can be done via the script.

    If this is not clear, please let me know and I can clarify.  Thank you.

    Sorry for the mess, it works for me.

    Don't mind the empty cluster constants.

Maybe you are looking for

  • Critical applications

    I noticed circulate many apps on the app store with tags like "Editor's choice" or "Essentials" However, it is unnecessarily difficult to find a complete list of these apps on the store, especially now that apple has marked these applications as tool

  • Accents do not appear when the button is held down

    When I used to hold a key (example e) a list of the different accents, it would seem that I could choose. Now, when I hold the same key letter repeats instead? I haven't changed the settings so don't know why it does is no longer. All solutions? Than

  • Satellite Pro 480cdt: repair repair

    Where can I get a repair manual for a Satellite Pro 480cdt service?

  • printing continuous paper

    Can I print paper continuous (without the holes of the kingpins) on my HP 3520 scan-print-copy?

  • Satellite A100-003: the Vista Explorer displays blank DVD

    A few months after his dvd player, I bought my laptop started to behave very strange. Right now, most of the cds and dvds that I get is recognised as void by windows Explorer (I am running Windows Vista Home Premium 32 bit English, bought with the ma