DM 3.0.0.665 instead of triggers not generating DDL correctly

There seems to be a bug in the DDL generation for manually created INSTEAD OF triggers on views. The INSTEAD OF trigger does not have the INSTEAD OF clause upon DDL generation. Instead, it has the BEFORE clause. It seems to be treating INSTEAD OF triggers as normal triggers. Note: When I reversed engineered a database that already had an INSTEAD OF trigger, it imported and generated DDL was fine. This bug shows itself when manually creating INSTEAD OF triggers.
Steps to replicate:
1. In any design that has a view.
2. In the physical model, find the view, expand it, right click to create Trigger for view
3. By definition, a trigger on a view can only be an instead of trigger.
4. The dialog box will have the 'Triggering time' showing as INSTEAD OF. You can't change it. (Which there is no reason to do anyway)
5. Generate DDL. When generating the DDL, the trigger will not be generated as INSTEAD OF, it will be generated as a BEFORE (INSERT/UPDATE/DELETE).
Included DDL generation from a simple database (I did not modify the DDL generated):
-- Generated by Oracle SQL Developer Data Modeler 3.0.0.665
-- at: 2011-03-30 13:16:32 EDT
-- site: Oracle Database 10g
-- type: Oracle Database 10g
-- CREATE DATABASE DB2
-- CONTROLFILE REUSE
-- MAXLOGFILES 1
-- MAXLOGMEMBERS 1
-- MAXLOGHISTORY 0
-- MAXDATAFILES 10
-- MAXINSTANCES 1
-- ARCHIVELOG
-- FORCE LOGGING
-- DATAFILE
-- '' SIZE 0 K REUSE
CREATE TABLE TABLE_1
Column_1 VARCHAR2 (1)
) LOGGING
CREATE OR REPLACE VIEW VIEW_1 ( Column_1 )
AS SELECT
TABLE_1.Column_1
FROM
TABLE_1 TABLE_1 ;
CREATE OR REPLACE TRIGGER Trg1
BEFORE INSERT ON VIEW_1
FOR EACH ROW
BEGIN
     NULL;
END;
-- Oracle SQL Developer Data Modeler Summary Report:
-- CREATE TABLE 1
-- CREATE INDEX 0
-- ALTER TABLE 0
-- CREATE VIEW 1
-- CREATE PACKAGE 0
-- CREATE PACKAGE BODY 0
-- CREATE PROCEDURE 0
-- CREATE FUNCTION 0
-- CREATE TRIGGER 1
-- CREATE STRUCTURED TYPE 0
-- CREATE COLLECTION TYPE 0
-- CREATE CLUSTER 0
-- CREATE CONTEXT 0
-- CREATE DATABASE 1
-- CREATE DIMENSION 0
-- CREATE DIRECTORY 0
-- CREATE DISK GROUP 0
-- CREATE ROLE 0
-- CREATE ROLLBACK SEGMENT 0
-- CREATE SEQUENCE 0
-- CREATE MATERIALIZED VIEW 0
-- CREATE SYNONYM 0
-- CREATE TABLESPACE 0
-- CREATE USER 0
-- DROP TABLESPACE 0
-- DROP DATABASE 0
-- ERRORS 0
-- WARNINGS 0

Hi,
Thanks for reporting this problem. I logged a bug on it.
David

Similar Messages

  • "Refresh after" insert fails for DB-View with INSTEAD OF Triggers

    Hi,
    I have a database view with INSTEAD OF triggers defined for INSERT, UPDATE, DELETE.
    For some EO attributes the refresh after insert and update is defined.
    Posting to database fails.
    According to Database 9.2 Manual and a previous thread (BC4J and Updatable Views the RETURNING clause is not allowed for database views with INSTEAD OF triggers.
    Is there a workaround so the refresh after is done, but without the RETURNING feature?
    I only need to refresh some values. The PK i can set in the create method of the EO so refresh via a additional SELECT would be possible.
    If not Feature Request:
    Add the possibility to do the "refresh after ..." with a 2nd SELECT using the PK instead of using the RETURNING clause.
    Of course then it is not possible to set the PK in the database trigger. PK has to be set in the create method of the EO.
    Thanks,
    Markus
    GEMS IT

    Hi Markus,
    Turning on the stack trace (-Djbo.debugout put=Console - in the Project/runner) did help and I should have done it sooner. Turns out that when I constructed my EO based upon a database view - I should have left out the PKs of the base tables.
    In my case, I am using an "Instead Of Trigger" to populate a multi-table arrangement (parent - child - grandChild - greatGrandChild relationship) where all base tables are using dbSequence/dbTriggers.
    Final analysis - I would like to see BC4J handle this situation. I do not want to use View-Links and I should * not * have to resort to stored procedures and BC4J/doDML. If I construct a DB View this is participating in an parent - child - grandChild - greatGrandChild relationship that are using dbSequence/dbTriggers, then BC4J should be smart enough to construct VO knowing that I want to do insert, update, delete, selects - based upon this structure.
    Thanks Markus,
    Bill G...

  • Editable views with instead of triggers in Oracle 10G

    Hi,
    We are attempting to migrate our database application from Oracle 9i to Oracle 10G. We have found that we are getting the error [ORA-03113 end-of-file on communication channel] when we attempt to insert multiple rows into database tables using editable views equipped with INSTEAD OF triggers. When inserting multiple rows, we are using a single insert statement of the form insert into...select from. Strangely enough, when the select query within the insert statement returns a single row, the insert statement is successful. We also noticed that if we issue a commit right before executing the insert statement, the insert statement is successful regardless of the number of rows being inserted. But this is not a viable workaround as the current transaction contents needs to be maintained. We did not have these issues in Oracle 9i. Does Oracle 10G have any known issues with editable views equipped with INSTEAD OF triggers? Are there any settings in the INIT.ORA file that can resolve these issues? Thanks for your help.

    Confirmed. If you use 2D input, or change the Z dimensions so they are different, you will get the results you expect in 10g. Otherwise - a line.
    I'm not sure why, and can't see a bug report on that in support, but obviously it was recognized and fixed as you indicate.
    Try it with 2D input, and it will work:
    select sdo_aggr_mbr(
    SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3),
    SDO_ORDINATE_ARRAY(-10, -10, 10, 10))
    from dual;
    Or with different Z values:
    select sdo_aggr_mbr(
    SDO_GEOMETRY(3003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3),
    SDO_ORDINATE_ARRAY(-10, -10, 1, 10, 10, 11))
    from dual

  • BUG? VIEWS with INSTEAD OF triggers are updatable????

    When I try to update the view created with the PL/SQL code from
    below, with an infobus data form generated by JDev wizards , i
    ontain this error "ORA-22816: unsupported feature with RETURNING
    clause"
    Below this text are an plus80 sql text file, producing the same
    error and creating the database environment required.
    It creates :
    .-2 tables,
    .-2 sequences
    .-a joined view of this 2 tables
    .-an "instead of insert" trigger on the view
    Demostrating the correctness of this code there are a
    normal insert alone, and a pl/sql block producing the same kind
    error from plus80.
    If you generate the form to edit this view, it produces the same
    error when trying to do an insert, that the error produced by
    this sql file.
    --------------------------------------------cut here
    drop sequence suf_seq;
    CREATE SEQUENCE SUF_SEQ
    NOMAXVALUE
    NOMINVALUE
    NOCYCLE
    NOCACHE
    drop sequence fam_seq;
    CREATE SEQUENCE FAM_SEQ
    NOMAXVALUE
    NOMINVALUE
    NOCYCLE
    NOCACHE
    DROP TABLE SUBFAMILIAS CASCADE CONSTRAINTS;
    CREATE TABLE FAMILIAS
    (ID NUMBER(6,0) NOT NULL
    ,DESCRIPCION VARCHAR2(50) NOT NULL
    ,ACTIVO NUMBER(38)
    ,USERALTA VARCHAR2(15)
    ,FECHAALTA DATE
    ,USERMOD VARCHAR2(15)
    ,FECHAMOD DATE
    DROP TABLE FAMILIAS CASCADE CONSTRAINTS;
    CREATE TABLE SUBFAMILIAS
    (ID NUMBER(6,0) NOT NULL
    ,FAM_ID NUMBER(6,0)
    ,DESCRIPCION VARCHAR2(50) NOT NULL
    ,ACTIVO NUMBER(38)
    ,USERALTA VARCHAR2(15)
    ,FECHAALTA DATE
    ,USERMOD VARCHAR2(15)
    ,FECHAMOD DATE
    set serveroutput on;
    create or replace view test ( fam_id , suf_id , fam_descripcion
    ,suf_descripcion) as
    Select fam.id,suf.id,fam.descripcion,suf.descripcion
    from familias fam,subfamilias suf
    where fam.id=suf.fam_id;
    CREATE OR REPLACE TRIGGER test_insert
    INSTEAD OF INSERT
    ON test
    declare
    auxFam_Id familias.id%type;
    auxSuf_Id subfamilias.id%type;
    begin
    select fam_seq.nextval,suf_seq.nextval into
    auxFam_id,auxSuf_id from dual;
    insert into familias(id,descripcion) values
    (auxFam_id,:NEW.fam_descripcion);
    insert into subfamilias(id,fam_id,descripcion)
    values(auxSuf_Id,auxFam_id,:NEW.suf_descripcion);
    end;
    show errors;
    /* here is a non returning insert everything works ok */
    insert into test(fam_descripcion,suf_descripcion) values
    ('familia test 1','subfamilia test1');
    declare
    aux RowId;
    -- aux subfamilias.id%type;
    begin
    insert into test(fam_descripcion,suf_descripcion) values
    ('Familia test 2','Subfamilia test 2') returning RowId into aux;
    dbms_output.put_line(aux);
    --select * from subfamilias;
    --delete from subfamilias;
    end;
    -------------------------cut here
    null

    Are INSTEAD OF triggers the only way to insert/update
    information from a form using a view that combines
    fields from two different tables? My goal is to try
    to get away from using so many triggers and contain
    as much as I can within HTML DB. Is this really the
    only way?While you might be intimidated by the seeming complexity of an instead-of trigger, in the long run you'll be glad to dug in and did it the right way. The instead-of trigger is a thing of beauty where databases are concerned.
    One thing to be careful about: when you attach a trigger to a view and recompile the view, if it has 'CREATE OR REPLACE' in the definition, any triggers defined for the view will be lost. All your hard work creating that elegant trigger could be gone in a keystroke.
    Either use 'CREATE' without the 'OR REPLACE' or save a copy in your script repository or someplace safe so you can recreate it the event that it 'goes away' unexpectedly.
    As always, this is only my experience. Your mileage may vary. Perhaps you're smarter than me and have a nice trick you'd like to share for preserving such things in a more elegant way??
    Earl

  • I can not view emojis correctly on my brand new iPhone 6 and happens no matter what generation phone and my txt are freen when I send them to someone instead of the normal color. Plz helpu

    I can not view emojis correctly on my brand new iPhone 6 and happens no matter what generation phone and my txt are freen when I send them to someone instead of the normal color. Plz helpu

    Hey John,
    If you are having an issue with emojis on your iPhone, I would suggest that you troubleshoot using the steps in this article - 
    iOS: Troubleshooting emoji issues - Apple Support
    Thanks for using Apple Support Communities.
    Happy computing,
    Brett L 

  • My computer no longer seesmy 3rd generation ipod nano.  after following the on line directions to re-install I get a message it is ok to discinnect instead of do not disconnect.  how to I get the ipod back onto my computer?

    my computer no longer seesmy 3rd generation ipod nano.  after following the on line directions to re-install I get a message it is ok to discinnect instead of do not disconnect.  how to I get the ipod back onto my computer?

    Hello rh3362,
    I would start with this:
    http://support.apple.com/kb/TS1369
    Hope this helps.
    ~Julian

  • PDF files not being displayed correctly, instead I get a blank screen with some sort of small pinned icon in the centre.  It was working fine until today HELP!

    PDF files not being displayed correctly, instead I get a blank screen with some sort of small pinned icon in the centre.  It was working fine until today HELP!

    What is your operating system?  Reader version?  Are these local or online PDFs?  If online, in what browser?
    Can you post a screenshot: https://forums.adobe.com/thread/1070933

  • I delete an individual message but the time I received the message is still showing next to the persons name in my inbox instead of going back into the correct date/time order. Anyone know how to fix this?

    I delete an individual message but the time I received the message is still showing next to the persons name in my inbox instead of going back into the correct date/time order. Anyone know how to fix this?

    SOLUTION
    Open "terminal" on your mac and type the following:
    defaults write com.apple.mail IgnoreSortOrderWhenSelectingAfterDelete 1
    (copy and past the whole line)
    This will stop that behaviour in mail. 
    It works on most opperating systems.
    mine is.
    Mac OSx 10.7.2 Lion
    Cheers

  • I just bought the student plan for photography but when I go to download photoshop and lightroom, it says "download trial" instead of "download". Is that correct??

    I just bought the student plan for photography but when I go to download photoshop and lightroom, it says "download trial" instead of "download". Is that correct??

    Sign in, activation, or connection errors | CS5.5 and later
    Mylenium

  • If the data network is not available for some time, to get it again we need to restart the phone instead it is not finding the data network instantly. why cant the iphone searches data net work offten if not available. i am totally disappointed with this!

    If the data network is not available for some time, to get it again we need to restart the phone instead it is not finding the data network instantly. why cant the iphone searches data net work offten if not available. i am totally disappointed with this!

    Still it could not find the data network.it searches for voice network instantly and works too. but even full voice network available, there is no data network.when i restart the phone it could find data network.
    Already i reset network settings for two times.

  • Can we use EDID4 instead of EDIDD for generating IDOC

    Hi Abap-Experts,
                           My question is can we use EDID4 instead of EDIDD for generating IDOC. I have declared internal table for idoc data using EDIDD...but can i use instead EDID4 for the same as well as in FM('MASTER_IDOC_DISTRIBUTE'). I have tried to use but it was giving me runtime error
       DATA : ls_edidd  TYPE edidd .
      DATA : it_edidd TYPE TABLE OF edidd .
    LOOP AT it_cust INTO wa_cust .
        lv_segnum = lv_segnum + 1 .
        ls_edidd-segnum = lv_segnum .
        ls_edidd-segnam = 'Z1ZZ_CUST' .
        ls_edidd-hlevel = '1' .
        ls_edidd-sdata = wa_cust .
    CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
        EXPORTING
          master_idoc_control                  = ls_edidc
      OBJ_TYPE                             = ''
      CHNUM                                = ''
        TABLES
          communication_idoc_control           = it_edidc
          master_idoc_data                     = it_edidd
    Thanks in advance,

    Hi Alexander,
             I am not getting any error when i try EDIDD for generating IDOC..but if i try EDID4........it does give me error message.
               so please tell me what is the solution for this.

  • Funct module instead of triggering event

    how one can start activity without an event

    I think you have posted same question twice ... please refer to help.sap or search the forum there are lots of questions related to this topic ...

  • Imac G5 will not start up correctly? invalid directory count 52 instead of 53

    Hi, i have a Imac G5. it had been working fine for many years untill a year or 2 ago when it stopped all of a sudden and just would not start up as it should. instead, it went to this grey screen with horizontal lines. eventually after trying just about every combination of keys held down on startup, the only way i could get the mac to restart was by starting it in safe mode. (at this point i rescued all my photos and music and moved them onto my macbook pro) i thought it was working fine in safe mode untill i realised that it could not connect to the internet, the sound would not work at all, and when i went to preferances it could not find any output device for the sound. it also keeps coming up with a message saying that my internet communication device does not exist. allot of the programs worked fine, such as word, or photoshop, whereas others would not. i verified the disk, and discored that it would not let me repair it.
    Invalid directory count
    it should be 53 instead of 52)
    checking attributes file
    checking volume bitmap
    checking volume information
    repaired.",1)
    macintosh hd
    error: the underlying task reported failure on exit
    HSF volume checked
    volume needs repair
    it then came up with a message saying that he disk utility stopped verifying the macintosh hd because of it reporting the failure on exit.
    i have tried doing this a few times but the exact same result is gained
    i tryed using disk repair whilst starting up from the original install disk, but this also did not fix the problem. eventually, i decided to reinstall the os x 10.4.11. this had absolutely no effect, and i am at the same point. i would be very gratefull if anybody would be able to come up with any ideas of how i could fix this problem?
    additional details: i have tried using the proxy reset
    i have also tried running a apple hardware test
    i have tried repairing the macintosh hd disk using the original install disks
    also: all of the sockets at the back work fine, e.g. usb, but the microphone and headphone sockets do not work.
    it will read disks fine

    but this also did not fix the problem. eventually, i decided to reinstall the os x 10.4.11. this had absolutely no effect,
    I'd have guess you reformated at that time. The file system is messed up.  You need to reformat.
    Format a disk using the installation DVD
    To format  the startup drive, you will need to run disk utility from your installation DVD.
    This article  will tell you how to get to disk utility.  Once in a disk utility, you can go and format the disk.
    http://support.apple.com/kb/TS1417
    To format your startup drive, you will need to run disk utility from your startup DVD.
    Mac OS X 10.4: About the utilities available on the Mac OS X 10.4 Install DVD
    http://support.apple.com/kb/HT2055
    How to run disk utility from your startup DVD.
    Insert your  startup DVD  into your reader.  Power down your machine.  Hold down to the c key.  Power on your machine.  This will bootup your startup DVD. ( Alternatively, you may hold down the control key, this brings up the startup manager. Click on the desired volume. Click on the right arrow. )
    This will bring you to a panel asking you for your language.  Pick your language.
    You you come to the Install Mac OS panel.  Do not install.
    Click on Utilities menu item.  This will give you a pulldown list of utilities.
    Click on the disk utility.
    Start up disk utility.
    On the left pane view, you will see a list of all your disks.  Click on the external  disk.
    Click on the partition tab.
    You will now see how your external disk is currently set up.  Fill in the information as appropriate. You should pick Mac OS Extended (Journaled).
    More details on formatting.
    http://www.kenstone.net/fcp_homepage/partitioning_tiger.html

  • Instead of Trigger not working as expected

    We use a view v_test ( union on two tables ) with an Instead of Trigger for insert. The Instead of Trigger just inserts data into one of the underlying tables.
    If we insert a single row ( insert into v_test(...) values(...) ) everything works fine.
    If we insert multiple rows using one statement ( insert into v_test(...) select ...) some columns have same values although they should be different.
    (tested on Oracle 9 and 10)

    here is an example (Oracle Version is 9.2.0.6.0):
    view vtest_:
    SELECT *
    FROM (SELECT * FROM EM_TRANSPORTMITTEL_B
    UNION
    SELECT * FROM EM_TRANSPORTMITTEL_H)
    WHERE Nvl(To_Date(pa_session.f_getContext('hist_date'), 'dd.mm.yyyy hh24:mi:ss'), SYSDATE) BETWEEN hist_from AND hist_to
    Instead of Trigger:
    CREATE OR REPLACE TRIGGER tib_v_test instead of insert on v_test for each row
    declare
    l_cols EM_TRANSPORTMITTEL_B%rowtype;
    begin
    l_cols.EM_TRANSPORTMITTELID := :new.EM_TRANSPORTMITTELID;
    l_cols.tmtyp := :new.tmtyp;
    insert into EM_TRANSPORTMITTEL_B (em_transportmittelid, tmtyp, ....) values (l_cols.em_transportmittelid, l_cols.tmtyp, ....)
    end tib_v_test;
    Insert Statement
    insert into v_test (em_transportmittelid, tmtyp, ...)
    select em_transportmittelid, 'WAGEN' tmtyp, ...
    from tmp_tmstamm
    order by wagenummer;

  • Instead of trigger not populating view

    I've got a interactive report. I created a view based on this so I can use it elsewhere. I had it wokring, have been distracted by other projects, came back and ARUGH...you know the story. The view is not updating with anything. Is it my trigger?
    VIEW
    CREATE OR REPLACE FORCE VIEW  "GET_USERNAME_VW" ("DOC_INFO_ID", "DOC_TITLE", "DOC_LINK", "ECRNO", "OWNER", "ISO_NUMBER", "STATUS_ID", "FILE_TYPE", "APPROVAL_REQ", "APPROVED", "JOB_DESC", "USER_NAME") AS
      select     "DOC_INFO"."DOC_INFO_ID" as "DOC_INFO_ID",
         "DOC_INFO"."DOC_TITLE" as "DOC_TITLE",
         "DOC_INFO"."DOC_LINK" as "DOC_LINK",
         "DOC_INFO"."ECRNO" as "ECRNO",
         "DOC_INFO"."OWNER" as "OWNER",
         "DOC_INFO"."ISO_NUMBER" as "ISO_NUMBER",
         "DOC_INFO"."STATUS_ID" as "STATUS_ID",
         "DOC_INFO"."FILE_TYPE" as "FILE_TYPE",
         "DOC_INFO"."APPROVAL_REQ" as "APPROVAL_REQ",
         "DOC_INFO"."APPROVED" as "APPROVED",
         "SH_JOB_DESCRIPTION"."JOB_DESC" as "JOB_DESC",
         "SH_EMPLOYEES"."USER_NAME" as "USER_NAME"
    from     "SH_EMPLOYEES" "SH_EMPLOYEES",
         "SH_JOB_DESCRIPTION" "SH_JOB_DESCRIPTION",
         "DOC_INFO" "DOC_INFO"
    where   "DOC_INFO"."OWNER"="SH_JOB_DESCRIPTION"."JOB_DESC"
        and     "SH_JOB_DESCRIPTION"."JOB_DESC_ID"="SH_EMPLOYEES"."JOB_DESC_ID"
    and "DOC_INFO"."STATUS_ID" IN (1,2)
    /TRIGGER
    create or replace TRIGGER "bi_GET_APPROVAL"
    INSTEAD OF UPDATE ON GET_USERNAME_VW
    REFERENCING NEW AS n                
    FOR EACH ROW
    BEGIN
    update doc_info
    set approval_req = :n.approval_req    
        WHERE DOC_INFO_ID = :old.DOC_INFO_ID;
    update doc_info
    set approved = :n.approved
        WHERE DOC_INFO_ID = :old.DOC_INFO_ID;
    END;

    My overlook - - In my testing I had been setting the status_id on my form to something other than 1 or 2. Friday afternoon has me making dumb mistakes - those kind that can really mess things up if you act on them. Better to take a break!
    Thanks anyway!!
    Have a great weekend.

Maybe you are looking for