Transformation of Scripts that run only on the selected Tables

I'm relatively new to Data Modeler, but found almost everything to be very intuitive. I'm now doing use custom transformation scripts to dynamically add custom DDL elements. I wrote a transformation script that adds a sequence at the end of my DDL trigger successfully, and I'm happy with the results. The problem I run into is that we have two different categories of tables that require slightly different sequence triggers, but as my model is set to the level of database, my transformation scripts are applied to all arrays regardless they come what schema. Do you have any suggestions on how to limit the tables which proceeds by a transformation script? I thought to add if statements to check what schema tables are coming from, but if I have a situation where I have two different tables that require two different processing scripts, but they are in the same pattern, how can that I manage that? Ideally, I'd like to just pick a table and apply a transformation script for this table individually. Is this possible?

I work in a relational model with Data Modeler 4.0.

to dynamically add items customized to DDL

you need to check the custom of DDL in DM 4.1 features - "tools > rules and design transformations > Table DDL transformations"-DM 4.1 comes with example to generate tables of the newspaper and associated trigger.

. I wrote successfully in a transformation script that adds a sequence at the end of my DDL trigger

Data Modeler can generate the sequence and relaxation for you - you need to define the column as 'auto increment' / identity and set in preferences, you want "trigger" put in place. 4.1 DM added support for z/OS, DB2 LUW DB2 and MS SQL Server 2012.

Do you have any suggestions on how to limit the tables which proceeds by a transformation script? I thought to add if the instructions to check the schema, the tables are coming, but if I have a situation where I have two different tables that require two different processing scripts, but they are in the same schema

Well you need to sort it out on yourself - you can use classification types, dynamic properties user defined properties (in DM 4.1) or put paintings in various subviews or use the search feature (4.0.3 DM / DM 4.1 comes for example how to use the search results to create subview).

Ideally, I'd like to just pick a table and apply a transformation script for this table individually. Is this possible?

Here is an example of how get selected tables:

appv = model.getAppView();
dpv = appv.getCurrentDPV();
//check there is a diagram selected and it belongs to the same model
if(dpv!=null && dpv.getDesignPart() == model){
 tvs = dpv.getSelectedTopViews();
 for(var i=0;i

Philippe

Tags: Database

Similar Questions

  • How to make a script that runs only if another field's value

    I have a field in the sales tax in my form

    I do not charge the sales tax in TX, so when they choose the TX State on this field. I want to implement the sales tax.


    I am looking for how exactly that and am not having any luck.

    If it's for a calculated field, you can use a JavaScript custom script to do this, something along the lines of:

    // Calculate script for text field
    (function () {
    
        // Get the value of the State field
        var state = getField("State").value;
    
        // Get the subtotal
        vat total = getField("SubTotal").value;
    
        // Set the tax rate
        var taxRateTX = 0.0825  // 8.25%
    
        // Calculate the tax if Texas
        if (state === "TX") {
            event.value = util.printf("%.2f", total * taxRateTX);
        } else {
            event.value = "";
        }
    
    })();
    

    Change the field names in the code to match your form. I'm assuming that the State is selected in a combo box (dropdown) and it gives a value of "TX" when Texas is selected. Copy the following code rounds up to the nearest cent (assuming that subtotal is in dollars) which maybe aren't correct.

  • How to create a banner size mouseover who starts running only at the end (in Adobe Edge animate)

    A banner general practice is to have the entire banner be clickable as well that trigger the mouseover and mouseout/mouseouthandler().

    In flash, you would do an invisible button that captured the events, and then looks like an internal chronology of a chart of the CTA to play and which would scale upward.  I would also (in the main scenario where all the basic animation) a fade in opacity to the top of the CTA at the end Flash would allow me to set the rollover and rollout on the last image, so no features a rolling code would execute while the button was in invisible state.

    Along the busy, I know how a symbol, with an internal chronology which can evolve the assets. I know how to use the action of another layer to speak to this chronology of symbols and to play and to reverse the trend.

    But I can't understand how the mouseover and mouseout/mouseouthandler() code to run ONLY when the banner has played through the main timeline animation.

    Thank you.

    make a layer/button which is at the top with a transparent png of the size of your project. First frame of the main timeline, the value to display last image off the coast, it appears on the value.

  • How to find scripts that run in the background

    Hey

    I'm looking for which scripts to run in the background

    Thank you

    Open the Task Manager and go to the Details tab. If a VBScript or JScript is running the wscript.exe or cscript.exe process appear in the list.

    Right-click on the column header and select 'Command Line'. That should tell you what script file is running.

  • Y at - he opened a Java command/script that runs all calculations in a PDF document on the document?

    Long story short, design a timesheet for my company using Adobe Pro. The form has fields that use java script to calculate different values. For example when someone enters the week, finishing, it fills the rest of the form with the correct days. This is a simple script which is located in "custom calculation. It works fine on PC and iOS devices (when you use a PDF reader application) but not when calculating on Android devices. When opened on a PC then the dates have not been calculated. This seems to be a problem with the Android device and the way it handles the script embedded in the page. For the test I used Adobes PDF reader program so in theory, these functions must be activated. However, I find very little information on why this would happen. For me that a simple work-around would be to set the properties of the document just run all calculations on the open page. So when opened on a PC by our payroll service dates will fill up. If you are curious of the code that I use I have attached below.

    Thank you in advance.

    The script:

    Custom text field calculation script

    (function () {}

    Get the value of the ZZWEEKEND field

    var v = getField("ZZWEEKEND").value;

    If the field is blank, this field blank

    if (v === "") {

    Event.Value = v;

    return;

    }

    Convert string to date in a date object

    var d = util.scand ("mm/dd/yyyy", v);

    Subtract the number of days

    d.setDate (d.getDate () - 4);

    Set the value of this field

    Event.Value = util.printd ("mmm - dd", d);

    })();

    You can use the calculateNow method, for example:

    calculateNow();

    in a script Page Open.

  • Several scripts that run at the same time?

    Is it possible to have multiple scripts running successfully at the same time?

    For now if I start a second script while one is still ongoing, the other to be completed successfully, but one stops. This seems to be because one is so more the active document, once the other opens so cannot continue.

    Is there another way to anything like that script so that multiples can operate independently at the same time? You might wonder why I don't want to run both at the same time and not just wait, but I install an asp.net web do front end and have problems if two people, click on the button around the same time.

    I'm guessing this won't be possible and I'll have to look for ways to achieve this in asp.net instead and sort queued requests so you will have to wait longer if the script is already running?

    Thank you

    Andy

    I'm guessing this won't be possible and I'll have to look for ways to achieve this in asp.net instead and sort queued requests so you will have to wait longer if the script is already running?

    It is correct. PS script interface is single-threaded, so you'll need requests queued.

  • Hello. I need help developing a PowerCli script that will show me the current configuration of the video Ram of each individual virtual machine on a host\cluster or a vcenter. Can you help me?

    I have a script that will allow me to change the configurations of VRAM, but I need a script that retrieves the configuration of all virtual machines VRAM in my infrastructure.
    I need to get out information to a csv file and run this report on a monthly basis... can you help me?

    Right now my environment is mixed. I have Windows XP virtual machines set to 4 MB, Windows 7 virtual computers set to 8 MB and a subset of sall of virtual machines set to automatic detection of settings.

    I need to be able to recover these settings in a CSV file in order to use this information for comparisons of trdouble-shot performance issues...

    Thank you.

    vram.JPG

    Try something like this

    Get - VM |

    Select Name,

    @{N = "OS"; E={$_. ExtensionData.Config.GuestFullName}},

    @{N = "VideoRamMB"; E = {}

    [math]: Round (($_.)) ExtensionData.Config.Hardware.Device |

    where {$_-is [VMware.Vim.VirtualMachineVideoCard]} |

    (Select VideoRamSizeInKB - ExpandProperty) / 1 Ko, 1).

    }} |

    Export-Csv vm - videoram.csv - NoTypeInformation - UseCulture

  • How to generate a sql script that is based on the structure of the table

    I want to generate a sql script that is based on a table structure.

    For example:

    If the table is:

    CID id c_value
    -----------------------------
    1 1 zz
    2 1 yy
    3 2 zz
    4 2 xx
    5 3 ss
    6 tt 3


    The expected output is:

    WITH
    CHILD_tab like)
    SELECT 1 cid, 1 id, 'zz' c_value of all the double union
    SELECT 2 cid, 1 id, 'yy' c_value of all the double union
    SELECT 3 cid, 2 id, 'zz' c_value of all the double union
    SELECT 4 cid, 2 id, 'xx' c_value of all the double union
    SELECT 5 cid, 3 id, 'ss' c_value of all the double union
    SELECT 6 cid, 3 id, 'tt' double c_value)


    11.1.0.7.0 release

    I do a lot of XML these days (maybe too well) so here is a solution involving XQuery.
    We pass a query string and it generates a CLOB containing the WITH clause:

    SELECT DBMS_XMLGEN.Convert(
    XMLQuery(
    q'[concat(
    "WITH t AS (
    ",
    string-join(
     for $i in /ROWSET/ROW
     return concat( " SELECT ",
                    string-join($i/*/concat("'",ora:replace(text(),"'","''"),"' ",local-name()),", "),
                    " FROM dual" ),
    " UNION ALL
    "
    ),
    "
    )")]'
    passing dbms_xmlgen.getXMLType('SELECT * FROM scott.emp')
    returning content
    ).getClobVal(), 1) AS WITH_CLAUSE
    FROM dual;
    
    WITH_CLAUSE
    --------------------------------------------------------------------------------
    WITH t AS (
     SELECT '7369' EMPNO, 'SMITH' ENAME, 'CLERK' JOB, '7902' MGR, '17/12/80' HIREDATE, '800' SAL, '20' DEPTNO FROM dual UNION ALL
     SELECT '7499' EMPNO, 'ALLEN' ENAME, 'SALESMAN' JOB, '7698' MGR, '20/02/81' HIREDATE, '1600' SAL, '300' COMM, '30' DEPTNO FROM dual UNION ALL
     SELECT '7521' EMPNO, 'WARD' ENAME, 'SALESMAN' JOB, '7698' MGR, '22/02/81' HIREDATE, '1250' SAL, '500' COMM, '30' DEPTNO FROM dual UNION ALL
     SELECT '7566' EMPNO, 'JONES' ENAME, 'MANAGER' JOB, '7839' MGR, '02/04/81' HIREDATE, '2975' SAL, '20' DEPTNO FROM dual UNION ALL
     SELECT '7654' EMPNO, 'MARTIN' ENAME, 'SALESMAN' JOB, '7698' MGR, '28/09/81' HIREDATE, '1250' SAL, '1400' COMM, '30' DEPTNO FROM dual UNION ALL
     SELECT '7698' EMPNO, 'BLAKE' ENAME, 'MANAGER' JOB, '7839' MGR, '01/05/81' HIREDATE, '2850' SAL, '30' DEPTNO FROM dual UNION ALL
     SELECT '7782' EMPNO, 'CLARK' ENAME, 'MANAGER' JOB, '7839' MGR, '09/06/81' HIREDATE, '2450' SAL, '10' DEPTNO FROM dual UNION ALL
     SELECT '7788' EMPNO, 'SCOTT' ENAME, 'ANALYST' JOB, '7566' MGR, '19/04/87' HIREDATE, '3000' SAL, '20' DEPTNO FROM dual UNION ALL
     SELECT '7839' EMPNO, 'KING' ENAME, 'PRESIDENT' JOB, '17/11/81' HIREDATE, '5000' SAL, '10' DEPTNO FROM dual UNION ALL
     SELECT '7844' EMPNO, 'TURNER' ENAME, 'SALESMAN' JOB, '7698' MGR, '08/09/81' HIREDATE, '1500' SAL, '0' COMM, '30' DEPTNO FROM dual UNION ALL
     SELECT '7876' EMPNO, 'ADAMS' ENAME, 'CLERK' JOB, '7788' MGR, '23/05/87' HIREDATE, '1100' SAL, '20' DEPTNO FROM dual UNION ALL
     SELECT '7900' EMPNO, 'JAMES' ENAME, 'CLERK' JOB, '7698' MGR, '03/12/81' HIREDATE, '950' SAL, '30' DEPTNO FROM dual UNION ALL
     SELECT '7902' EMPNO, 'FORD' ENAME, 'ANALYST' JOB, '7566' MGR, '03/12/81' HIREDATE, '3000' SAL, '20' DEPTNO FROM dual UNION ALL
     SELECT '7934' EMPNO, 'MILLER' ENAME, 'CLERK' JOB, '7782' MGR, '23/01/82' HIREDATE, '1300' SAL, '10' DEPTNO FROM dual
    )
    

    It may be useful for small datasets only because we reached quickly ORA-01706.

  • How to debug an application incident that occurs only within the executable and not developing?

    LabVIEW 2011

    Looking for ideas on how to debug an application that crashes only from within the executable.

    Is there something useful that this error report can be used to, thanks in advance.

    ####
    #Date: Tuesday, August 23, 2011 15:10:18
    #OSName: Windows 7 Enterprise
    #OSVers: 6.1
    #OSBuild: 7600
    #AppName: LabDAQ
    #Version: 11.0 32-bit
    #AppKind: AppLib
    #AppModDate: 23/08/2011 18:59 GMT
    Base address of #LabVIEW: 0 x 30000000

    23/08/2011 3:10:48.331 PM
    Crash 0 x 0: Crash taken to DENY
    File Unknown (0): Crash: Crash captured by DENYING
    Minidump ID: a1c0be18-ad05-4b09-b914-afe4a3073daf
    ExceptionCode: 0xC0000005± N
    0x3072C874 - lvrt + 0
    0x3072CC28 - lvrt + 0
    0x7C37FDB4 - MSVCR71 + 0
    0x77330DF7 - ntdll + 0
    0x772F9ED5 - ntdll + 0
    0x00000000 - + 0

    I sprinkle a button Dialogs in any code that I can see to what extent the code gets before it crashes.

  • How to get to 'leave the event' script to run again when the form with the data file is reopened?

    I've created an Adobe Dynamic XML using LiveCycle Designer form with many fields / subforms that are 'visible' or the 'hidden' according to the selected options of different menu drop-down lists. Also, the form has been activated to save. Users can successfully fill out the form and save a copy with the data that has been entered.

    The problem I have is that when the recorded file is opened again in the 'hidden' fields / subforms that were previously made visible by selecting the appropriate options in the drop-down list NOT displayed now. However if you make the same selections from each of the drop-down list shows still hidden ONCE the fields / subforms are displayed, and do not contain data that has been entered.

    The problem seems to be that the script that determines whether a field / subform is 'hidden' or 'visible' is a

    "<event activity="output" name="event__exit">" "

    that is followed by

    If (this.rawValue is '0')- (i.e. the value of the drop-down list)

    sfCompanyDetails.presence = "visible";

    sfRecruitmentAgency.presence = 'hidden ';

    etc, etc.

    and, therefore, it is not executed again when the file is reopened.

    Can someone advise please how do I do this?

    Hello

    Check if you enabled the "auto" option to keep the script changes in the properties of the form.

  • Select the column in a table that is defined in the select previous in the statement

    Hello

    I want to write a procedure that selects all the data in a table has then records them in the text file. I tested on table hr.countries.

    My code is like this:

    echo off newpage 0 space 0 pagesize 0 feed head off trimspool check out serveroutput on the value

    coil countries.txt

    define dtable = COUNTRY;

    declare

    col_num NUMBER;

    no_lig NUMBER;

    line VARCHAR2 (100);

    Col VARCHAR2 (100);

    Start

    Select count (COLUMN_ID) in the col_num USER_TAB_COLUMNS WHERE table_name = '& dtable';

    Select count (*) in no_lig of & dtable;

    because me in 1.row_num

    loop

    1.col_num j

    loop

    Select column_name from col FROM USER_TAB_COLUMNS WHERE table_name = '& dtable' and column_id = j;

    Select the pass in the row (select col, rownum: nurse of (select col from & dtable)) where rn = i;

    IF (j! = col_num) THEN

    DBMS_OUTPUT. PUT(Row ||) ', ');

    ON THE OTHER

    DBMS_OUTPUT. PUT (Row);

    END IF;

    end loop;

    DBMS_OUTPUT. NEW_LINE;

    end loop;

    end;

    /

    spool off

    I have had no error, but the result is like this:

    COUNTRY_ID, COUNTRY_NAME, REGION_ID

    COUNTRY_ID, COUNTRY_NAME, REGION_ID

    COUNTRY_ID, COUNTRY_NAME, REGION_ID

    .. and so on for the whole table.

    I want to have results with data not only the names of columns. No idea what is the problem? I thought that select col online would do the thing, but the line is identical to the col variable...

    Thank you

    Honza

    Set serveroutput on;

    define dtable = COUNTRY;

    declare

    col_num NUMBER;

    no_lig NUMBER;

    line VARCHAR2 (100);

    Col VARCHAR2 (100);

    Start

    Select count (COLUMN_ID) in the col_num USER_TAB_COLUMNS WHERE table_name = '& dtable;

    Select count (*) in the no_lig argument of &dtable;

    because me in 1.row_num

    loop

    1.col_num j

    loop

    Select column_name from col FROM USER_TAB_COLUMNS WHERE table_name = '& dtable' and column_id = j;

    run immediately 'select'. Col | "from (select ' |) Col |', rownum: nurse from (select ' |) Col |' of & dtable)) where rn =' | I have

    Online;

    IF (j! = col_num) THEN

    DBMS_OUTPUT. PUT(Row ||) ', ');

    ON THE OTHER

    DBMS_OUTPUT. PUT (Row);

    END IF;

    end loop;

    DBMS_OUTPUT. NEW_LINE;

    end loop;

    end;

    /

    Output

    anonymous block filled

    AR, Argentina, 2

    To, Australia, 3

    BEING, Belgium, 1

    BR, Brazil, 2

    CA, Canada, 2

    CH, Switzerland, 1

    CN, China, 3

    OF (Germany), 1

    DK, Denmark, 1

    For example, Egypt, 4

    FR, France, 1

    HE, Israel, 4

    IN, India, 3

    IT, Italy, 1

    JP, Japan, 3

    KW, Kuwait, 4

    ML, Malaysia, 3

    MX, Mexico, 2

    NG, Nigeria, 4

    NL, Netherlands, 1

    SG, Singapore, 3

    UK, United Kingdom, 1

    WE, United States of America, 2

    ZM Zambia, 4

    ZW, Zimbabwe, 4

  • Creating a trigger to run only when a new table is created

    I know that I can use this to create the DDL create relaxation.
    CREATE OR REPLACE TRIGGER 
      create_table_trigger
      AFTER CREATE ON SCHEMA
    DECLARE
    BEGIN
    END;
    Problem is that this trigger would run on CFDS as "Create sequence." How can I perform it only for 'Create Table' CFDS?

    Published by: wonderboy87 on January 26, 2011 18:39

    Check ora_sysevent coupled with ora_dict_obj_type in your trigger. This will help you capture the CREATE TABLE event.

    Published by: Sissi Kandi on January 27, 2011 09:55

  • How to take partial dump using EXP/IMP in oracle only for the main tables

    Hi all

    select*from v$version;
    
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE    10.2.0.1.0    Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    

    I have about 500 huge data main tables in my database of pre production. I have an environment to test with the same structure of old masters. This test environment have already old copy of main tables production. I take the dump file from pre production environment with data from last week. old data from the main table are not necessary that these data are already available in my test environment. And also I don't need to take all the tables of pre production. only the main tables have to do with last week data.

    How can I take partial data masters pre prodcution database tables?  and how do I import only the new record in the test database.

    I use orders EXP and IMP. But I don't see the option to take partial data. Please advice.

    Hello

    For the first part of it - the paintings of masters just want to - use datapump with a request to just extract the tables - see example below (you're on v10, so it is possible)

    Oracle DBA Blog 2.0: expdp dynamic list of tables

    However - you should be able to get a list of master tables in a single select statement - is it possible?

    For the second part - are you able to qrite a query live each main table for you show the changed rows? If you can not write a query to do this, then you won't be able to use datapump to extract only changed lines.

    Normally I would just extract all the paintings of masters completely and refresh all...

    See you soon,.

    Rich

  • Display object is read-only on the static Table

    Greetings,

    I create a static af:table in JDeveloper 11.1.2.4.0 JSF,.

    temporally with 3 columns, so I can create rows and select data. When im to create as many lines and select data from all 3

    Select a column of choice, to save on the different table using methodAction.

    I do all the 3 columns can always be updated, but when im going to create a line, he throws me error in the table read-only.

    Keep in mind that temporally static table have no primary key.

    What should I do to work around this error?

    Thanks in advance for any help.

    See u object created by using wizard to only view real object?  Maybe that can be the cause...

  • Can we do a line read only in the advanced table?

    Hello

    We have an obligation where the user wants to the first line of a table advanced to readonly, and remaining lines as editable lines. Can someone please let me if we can achieve this?

    Thanks in advance.

    Solène

    Hello

    Yes, you can set row as read only in the table in advance.

    Steps to follow:
    (1) take the attribute Transient seen as ControlReadonly (Boolean Type) in the attached with advanced table view object.
    Note: Your all the lines will have now a new attribute called ControlReadOnly.

    (2) using the property read only set SPELL on each field of your advance deposited the region.
    as ReadOnly ${oa.. ControlReadOnly}

    (3) the loading of the page, in the query itself process you can set the attribute to True and if you need frontline to travel up to the end of the rows in the table and set the value to False for ControlReadOnly.
    ex: line = vo.first ();
    row.setAttribute ("ControlReadOnly", Boolean.TRUE);

    Kind regards
    Swati.

Maybe you are looking for