Updatable view

I need to create Updatable view for the below
The requirement is, We want to get the storkeeper_NAME and storkeeper DESCRIPTION from T storekeeper table when SYSTEM_STRKPER_ID == NULL,
Else if SYSTEM_STRKPER_ID <> NULL get the storkeeper_NAME and storkeeper DESCRIPTION  from T storekeeper_SYSTEMS table.
Why updatable view is because, we want to map the entities on the frontend to this view for the changes made in the UI can be updated.
So that when updating we need not worry about the above logic.
Please help

Consider using an INSTEAD OF trigger...
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1081632740728
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:5226026422731
http://www.oracle.com/pls/db102/search?remark=quick_search&word=instead+of

Similar Messages

  • Issue in Invoking an Updatable View with Instead of Trigger

    Hi,
    I am trying to insert a record using Updatable View with Instead of Trigger. When i try to save the data, i get the below error:
    java.sql.SQLException: ORA-01403: no data found
    ORA-06512: at line 1
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:213)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1075)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1466)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3887)
    at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:9323)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1508)
    at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
    at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:432)
    at oracle.jbo.server.EntityImpl.doDMLWithLOBs(EntityImpl.java:8566)
    Can someone help me resolve this issue?
    Also it would be great if you can share Sample codes for Invoking an updatable view with instead of trigger on Save/commit.
    Regards,
    Jeevan

    As a trigger is executed in the db and not in your app it's really hard to help as you did not give any useful information.
    Have you read this blog http://stegemanoracle.blogspot.com/2006/03/using-updatable-views-with-adf.html ?
    Timo
    Edited by: Timo Hahn on 22.09.2011 09:15
    And my friend google also found http://technology.amis.nl/blog/1447/adf-business-components-resfresh-after-insertupdate-and-instead-of-triggers

  • Updatable View as data block source - can't get to work

    I have created a simple form with one data block based on an updatable view, but it doesn't work properly after the form executes a query.
    I can use DML on this view using SQL*Plus and it works as it should.
    DML works in the form too, but only until I execute a query, after that I get the "FRM-40602: cannot insert into or update a view" error each time I try an insert, update, or delete.
    This is repeated for each runtime of the form. I have set the "query only" property to yes for the non-DMLable item from the view so that isn't part of the problem. This is an example out of "Developer Advance Forms and Reports (page 112) - Oracle Press" so it should work. There is nothing else (code, triggers, etc...) in this module besides the one data block.
    Any ideas would be appreciated.
    Thanks. Bill Brosnan.

    I have had the same issue and had to go through Oracle Support to get it working.
    First of all make sure that you have a recent patch installed (patch 9 as being the latest one available).
    Second, set in the data block the property key mode to updatable and the property primary key to yes for one item of the data block. (this is bug 1561423)
    Make sure that you only modify those columns that are updateable.
    Quite a large number of bugs have been reported on the concept of updatable views and the installation of a recent patch will most definitely get you working again.
    This functionality does work !
    Goodluck,

  • Update View SM30

    Hallo Guru,
    have you ever had this problem:
    I have created an update view, but when I try to update data via SM30... well, even if I save, no data is really saved...

    No, no events...
    I have:
    1. Created a Z table
    2. Created an update view for the table
    3. Created a maintainance view for the view.
    3. goto transaction SM30
    4. I make modifications, but no data is saved...

  • Update view ( view is based on 3 tables)

    i have view based on 3 tables.
    create view view_master
    select '1' as no , name , no from a
    union all
    select '2' as no , name , no from b
    union
    select '3' as no , name , no from c
    actually i wanted to update view base table, Can i update a view view_master ?
    My question here is does oracle support view update ( view is based on 3 tables)
    Please advise ,,,

    Apart from Instead of trigger any other work around? The best way to answer that question is if you let us know:
    - your database version ( select * from v$version; )
    - give us a narrowed down example of the 'begin-situation' and the desired 'final situation'.\
    See:
    {message:id=9360002} for more details.
    MY ORACLE DBA hates tiggers .He's not the only one ;)

  • Updatable view and Read only view

    Jdev version 11.1.1.6
    1. Can we use an updatable view instead of readonly view for LOVs?
    2. In my use case, I am having a panel-tabbed component. I create Region in the first tab & create Countries in the second tab. If I use a LOV for Regions based on the read-only view, then the data created & COMMITTED in the first tab is not getting reflected in the LOV in the second tab. But, if I use an updatable view for the Region field's LOV, then the LOV works fine. But, want to know if it is fine to use an updatable view for LOVs.

    Quotation from the developer guide
    >
    Best Practice: When you need to create a read-only view object for
    data lookup, you should use the entity-based view object and deselect
    the Updatable option in the Entity Objects page of the view object
    overview editor.
    >
    >
    View objects can either be related to underlying entity objects or not. When a view
    object is related to one or more underlying entity objects the default behavior supports
    creating new rows and modifying or removing queried rows. However, the update
    feature can be disabled by deselecting Updatable in the overview editor for the
    entity-based view object
    >
    So the answer for your first question is Yes

  • Updating Views in sql server

    Hi,
    I am trying to update a view but the result is 0 row(s) updated
    ALTER VIEW vw_AuthorizedStationeries
    AS
    SELECT StationeryID,
    CreatedOn,
    StationeryName
    FROM dbo.Stationeries
    WHERE Authorized = 1
    GO
    -----------------Update Views-------------------
    UPDATE vw_AuthorizedStationeries
    SET
    CreatedOn = GETDATE()
    WHERE
    StationeryName = 'StationThree'
    GO
    What am I doing wrong?
    I am trying to update the column 'CreatedOn' with todays date where the row is 'StationThree'.
    Is it even possible to what I am trying to do using Views?
    Thanks!

    Its possible so far as view retrieves a record which satisfies your specified condition ie 
    StationeryName = 'StationThree'
    You can check if there are records satisfying condition using below query
    SELECT COUNT(*)
    FROM dbo.Stationeries
    WHERE Authorized = 1
    AND StationeryName = 'StationThree'
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Updatable view vs Bulk Collect

    Hi friends.
    I need to know what is more fast....
    1. SELECT RO.NR_ORDEM BULK COLLECT INTO R
    FROM REP_ORD RO, REP_TRAB RT
    WHERE RO.NR_ORDEM = RT.NR_ORDEM ;
    FORALL I IN 1..R.COUNT
    DELETE REP_ORD WHERE NR_ORDEM = R(I);
    FORALL I IN 1..R.COUNT
    DELETE REP_TRAB WHERE NR_ORDEM = R(I);
    or
    2. To create an updatable view using something like the above select. After that, to delete data from view.
    Thank you for your patient.
    Message was edited by:
    Paulinha

    I think the bulk collect approach would be certainly be easier to implement. As someone pointed out, you can't delete from a view that has a table join - directly. However, you can create an "instead of" trigger to run a short PL/SQL program instead of deleting from the view, though, in chich you would then put your delete statements. The net effect of this would be that you were back where you started with the overhead of using a view as well (though this would probably not add too much extra processing).
    Getting back to your original question, I'd guess the bulk collects would be faster provided you don't have too many items in your collections. The only way to be certain would be to do it both ways and time it.

  • UPDATABLE VIEW AND MERGE

    Good Morning
    Is it possible to use merge with an updatable view.
    I've been trying with no success.
    If it is has anyone got an example
    I've been trying things like
    merge into UPDATABLE_VIEW
    using (select '10558630',99,'dhills',sysdate from dual) ver
    on (UPDATABLE_VIEW.person_code = '10558630')
    when matched then UPDATE set UPDATABLE_VIEW.value1 = 99
    when not matched then insert values ('10558630',99,'dhills',sysdate)
    Thanks
    David

    Never tried. Post Oracle version, proper example and error(s) encountered.

  • (BUG?) Migrating updatable views trouble

    I have some simple updatable views created as:
    select *
    from table
    where primary_key in (select ...)
    which are working well on database Release1 (10.1.0.3.0 - Linux).
    After moving application to Release2 (10.2 - Microsoft Windows, 32-Bit) all these views are no longer updateable.
    GB

    Hi,
    Windows:
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
    Linux
    Connected to Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 Maybe a bug introduced into 10.2.0.1 ?
    What I can say is that your test case work fine on my 10.2.0.3 database :
    SQL> conn system/demo102a@DEMO102A
    Connecté.
    SQL> create user user0 identified by user0 default tablespace users;
    Utilisateur créé.
    SQL> grant connect, resource to user0;
    Autorisation de privilèges (GRANT) acceptée.
    SQL> grant create any synonym to user0;
    Autorisation de privilèges (GRANT) acceptée.
    SQL> grant create public synonym to user0;
    Autorisation de privilèges (GRANT) acceptée.
    SQL> grant drop public synonym to user0;
    Autorisation de privilèges (GRANT) acceptée.
    SQL> grant create view to user0;
    Autorisation de privilèges (GRANT) acceptée.
    SQL>
    SQL> create user user1 identified by user1 default tablespace users;
    Utilisateur créé.
    SQL> grant connect, resource to user1;
    Autorisation de privilèges (GRANT) acceptée.
    SQL> grant create view to user1;
    Autorisation de privilèges (GRANT) acceptée.
    SQL> conn user0/user0@demo102a
    Connecté.
    SQL> drop table foreign_table;
    drop table foreign_table
    ERREUR à la ligne 1 :
    ORA-00942: Table ou vue inexistante
    SQL> create table foreign_table (
      2  foreign_id varchar2(14),
      3  foreign_name varchar2(250),
      4  foreign_alias varchar2(250),
      5  --
      6  constraint pk_foreign_table primary key (foreign_id)
      7  );
    Table créée.
    SQL>
    SQL> grant references on foreign_table to user1;
    Autorisation de privilèges (GRANT) acceptée.
    SQL>
    SQL> create or replace view foreign_view as
      2  select * from foreign_table;
    Vue créée.
    SQL>
    SQL> drop public synonym foreign_view;
    drop public synonym foreign_view
    ERREUR à la ligne 1 :
    ORA-01432: le synonyme public à supprimer n'existe pas
    SQL> create public synonym foreign_view for user0.foreign_view;
    Synonyme créé.
    SQL> grant select on foreign_view to user1;
    Autorisation de privilèges (GRANT) acceptée.
    SQL>
    SQL> create or replace package pkg as
      2 
      3  function func_1(i_id varchar2)
      4  return varchar2;
      5 
      6  function func_2(i_id varchar2)
      7  return varchar2;
      8  end;
      9  /
    Package créé.
    SQL>
    SQL> create or replace package body pkg as
      2 
      3  rec foreign_table%rowtype;
      4  cursor c is select * from foreign_table;
      5 
      6  function func_1(i_id varchar2)
      7  return varchar2
      8  is
      9  begin
    10  return 'SOME_ID';
    11  end;
    12 
    13  function func_2(i_id varchar2)
    14  return varchar2
    15  is
    16  begin
    17  return 'Y';
    18  end;
    19 
    20  end;
    21  /
    Corps de package créé.
    SQL>
    SQL> drop public synonym pkg;
    drop public synonym pkg
    ERREUR à la ligne 1 :
    ORA-01432: le synonyme public à supprimer n'existe pas
    SQL> create public synonym pkg for user0.pkg;
    Synonyme créé.
    SQL> grant execute on pkg to user1;
    Autorisation de privilèges (GRANT) acceptée.
    SQL>
    SQL> connect user1/user1@demo102a
    Connecté.
    SQL> create or replace view inner_view as
      2  select
      3  xc.foreign_id foreign_id,
      4  nvl(xc.foreign_name, xc.foreign_alias) foreign_name
      5  from foreign_view xc
      6  where pkg.func_1(foreign_id) = 'SOME_ID'
      7  and pkg.func_2(foreign_id) = 'Y';
    Vue créée.
    SQL>
    SQL>
    SQL> drop table base_table;
    drop table base_table
    ERREUR à la ligne 1 :
    ORA-00942: Table ou vue inexistante
    SQL> create table base_table (
      2  base_id varchar2(14),
      3  foreign_id varchar2(14),
      4  foreign_text varchar2(250),
      5  --
      6  constraint pk_base_table primary key (base_id)
      7  );
    Table créée.
    SQL>
    SQL> -- Final view
    SQL> -- Updatable on Linux, Non-updatable on Windows
    SQL> create or replace view final_view as
      2  select m.*,
      3  c.foreign_name r_foreign_name
      4  from base_table m,
      5  inner_view c
      6  where m.foreign_id = c.foreign_id (+);
    Vue créée.
    SQL>
    SQL> select * from final_view for update;
    aucune ligne sélectionnée
    SQL>
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> Well, an upgrade to the latest patchset would be well for you.
    Nicolas.

  • Creating new entities through updatable view

    I am trying to create 2 entity records through an updatable view. There is one primary entity which is joined to an another entity (which is an association table).
    The secondary entity is updatable and all it's attributes are updatable. But I get the following exception as soon as setAttribute() is called on the first attribute of the second entity
    SEVERE: oracle.jbo.ReadOnlyAttrException: JBO-27008: Attribute set for FpsgFoId in view object FolderByName failed
    javax.faces.el.EvaluationException: oracle.jbo.ReadOnlyAttrException: JBO-27008: Attribute set for FpsgFoId in view object FolderByName failed
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
         at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1087)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:204)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
    Here is my code
    ViewObject vo = findViewObject("FolderByName");
    Row folder = vo.createRow();
    vo.insertRow(folder);
    Sequence seq = new Sequence("FOLDERS_SEQ", this);
    Number foID = new Number(seq.getValue());
    folder.setAttribute("FoId", foID);
    folder.setAttribute("Name", name);
    folder.setAttribute("Description", description);
    folder.setAttribute("Type", type);
    folder.setAttribute("ParFoId", parFolder);
    folder.setAttribute("OwnerId", owner);
    folder.setAttribute("FpsgFoId", foID); **** fails here ***
    Pranab

    Thanks, but my scenario is little different. I have two entities with many to many association through an association table. Entity at one end of the association already exists. I am trying to create an entity at the other end of the association and the entity for the association record, all in one trasaction through an updatable view. The updatable view spans across the relevant entities.
    ADF is trying to create the association records before creating the record for the main entity and running into foreign key constraint viloation. It should do the inserts in the opposite order.
    Pranab

  • Add validations to z table update view

    Hi all,
    i have a z table updated by a z transaction that uses an update view generated in se11. The view inserts and/or updates one field of several registers and i need to check if the sum of them is less than certain value.
    Thanks in advance for any help.

    Hi Ebaristo,
    You would need to use table maintenance events "01" and "05" so that the check will be executed when you changes an existing entry as well as when you create a new entry.
    There is good article in SDN on how to use events: at http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc?quicklink=index&overridelayout=true
    Regards,
    Ramnivas

  • Triansient view objects vs updatable views...

    In the SRDEMO, they use the transient view objects to create a new request,They never used the eupdatable entity objects in create mode.Can i know the advantages of using transient views over the updatable views...

    There are no real advantages. Transient view objects are one technique to save per-user pending session state that different pages need to see. The create pages could have also been implementing using a straightforward entity-based view object using the Create built-in operation. The demo did it that way since it was the closest ADF BC equivalent to the way that the parallel EJB version of the demo.
    Section 13.6 "Creating an Input Form" of the ADF Developer's Guide for Forms/4GL Developers covers the Create-based way of making an input/create form.

  • Problem with creating "updatable" view. Any ideas?

    Hello to nice people!
    I'm trying to create plain, simple updatable view such as:
    CREATE OR REPLACE VIEW v_admin_maint
    (from_addrs,mail_invoice_addrs,auth_off,location_cd) AS SELECT
    A.from_addrs, A.mail_invoice_addrs, A.auth_off,
    A.location_cd FROM admin_maint A, sysusers B WHERE A.location_cd
    = B.location_cd and B.user_id = USER;
    TABLE admin_maint
    from_addrs,
    mail_invoice_addrs,
    auth_off,
    location_cd (PRIMARY KEY)
    TABLE sysusers
    USER_ID (PRIMARY KEY)
    FIRST_NAME
    LAST_NAME
    LOCATION_CD
    View works great as view-only, but I got an error on update
    statement "ORA-01779: cannot modify a column which maps to a non
    key-preserved table".
    UPDATE v_admin_maint SET from_addrs = 'test' where location_cd
    = 'HOME';
    TABLE admin_maint does have PK and this column included into
    VIEW.
    Any ideas? Please advice.

    You need to create a unique index on the location_cd column of
    the sysusers table, then re-create your view:
    SQL> ALTER TABLE sysusers
      2  ADD CONSTRAINT sysusers_location_cd_uk
      3  UNIQUE (location_cd)
      4  /
    Table altered.
    SQL> CREATE OR REPLACE VIEW v_admin_maint
      2    (from_addrs,
      3     mail_invoice_addrs,
      4     auth_off,
      5     location_cd)
      6  AS
      7  SELECT A.from_addrs,
      8         A.mail_invoice_addrs,
      9         A.auth_off,
    10         A.location_cd
    11  FROM   admin_maint A,
    12         sysusers B
    13  WHERE  A.location_cd = B.location_cd
    14  and    B.user_id = USER
    15  /
    View created.
    SQL> SELECT      column_name,
      2              updatable
      3  FROM        user_updatable_columns
      4  WHERE       table_name = 'V_ADMIN_MAINT'
      5  /
    COLUMN_NAME                    UPD
    FROM_ADDRS                     YES
    MAIL_INVOICE_ADDRS             YES
    AUTH_OFF                       YES
    LOCATION_CD                    YES
    SQL> UPDATE v_admin_maint
      2  SET    from_addrs = 'test'
      3  where  location_cd = 'HOME'
      4  /
    1 row updated.

  • Updatable views

    Hi
    Please let me know what are updatable views and if triggers are possible on updatable views.

    You can put an INSTEAD-OF trigger on any view.
    The definition of an updateable view can be found in the docs at http://tahiti.oracle.com or with google.
    But, I would think, the name would be sufficient to answer your question.

Maybe you are looking for

  • I can't export photos from events or library to a memory key

    In the past i have been able to select photos and drag them to the memory stick icon but for some reason now, when i try to do this a little white circle with a line through it appears and nothing gets onto the memory stick (this stick has lots of sp

  • Onload and Tabbing focus problem

    I was asked by some of my users to set focus to the username field on the login page when it loads. I began by adding to the body tag and cfform tags OnLoad function. This allowed the page to load and set up the user to just start typing without clic

  • Problems displaying some characters

    I have a dynamic HTML text field in my movie which is populated with text from an XML file. I need to display a TM symbol in the field and used the following in my XML: <title><![CDATA[<b>Main Title Copy Goes Here &#0153; </b>]]></title> This works f

  • Signing documents with tablet PC in acrobat 9

    I'm working with a customer who purchased several Acrobat 9.0 standard licenses for use with some patient forms. These forms need to be signed by each patient. I have a couple topaz signature pads, and have those working just fine. But I also need to

  • Printable Page - Corporate Branding

    Hi The corporate branding image disappears on Printable Page. The requirement is to print the branding image also. Thanks Gautam