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

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

  • 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

  • How to create ADF BC components like EO from  "View with INSTEAD OF trigger

    I have a "View with INSTEAD OF trigger" on a external schema. is it possible to create ADF EO on top of this view in my local schema?. If possible, then is it possible to insert/update that external table using ADF standard data controls and Application module?. I'm trying to see if it's possible with standard ADF controls without calling pl/sql API to insert/update that external table. any ideas are appreciated.
    Regards,
    Surya

    http://stegemanoracle.wordpress.com/2006/03/15/using-updatable-views-with-adf/

  • ApEx 4.1.1: update record in a view with 'instead of update' trigger

    I created a form against a view. The view is complex enough which prevents direct updates. To incorporate the update logic I created an 'instead of update' trigger on the view. When I open up the form, do changes, and click 'Apply Changes' button I am getting the following exception
    ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
    I understand that the standard 'Automatic Row Processing' process is trying to lock the record before updating using a cursor like
    select *
    from my_view
    for update
    and fails. Is it possible to bypass this locking while using the standard APEX processes?
    I think I can create a custom PL/SQL process which would execute the UPDATE statement (at least, it works in SQL*Plus), but I would like to know if I can use a standard ApEx functionality for this.

    Hello,
    Sorry for delay.
    I had found a feedback about trigger issue when restore SQL Database from a BACPAC file. Microsoft said the fixed  will be available in the next major release of DacFx.
    Feedback:
    SQL Azure fires a trigger when restoring from bacpac
    You can refer to the workarounds in the feedback. For example, if there is small amount of triggers on the database, you can try to remove the triggers and then recreate when restore from bacpac file.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • ADF BC: Creating updatable VO based upon DB View with "instead of" trigger

    Hello all,
    I have got an interesting issue. I have an Oracle DB view that is used to hide some complexity in the underlying DB design (it does some unions). This view is updatable because we have created an "instead of" update trigger to update the correct table when a row is updated. This is working fine in SQL.
    Next, we have created an ADF Entity object based upon the view, specifying an appropriate PK for the DB View. Then, we have created an updatable VO based upon the EO. All well and good so far. The issue we have is in trying to commit changes to the DB - because the ADF BC framework is trying to lock the row to update (using SELECT ... FOR UPDATE), it's not working because of ORA-02014 - cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
    This leads me to thinking about overridding doSelect() on the EO as hinted here http://radio.weblogs.com/0118231/stories/2005/07/28/differenceBetweenViewObjectSelectAndEntityDoselectMethod.html
    As a temporary test, we have over-ridden the EO's doSelect to call super.doSelect(false) and it does work, although we will have lost update issues as detailed in Steve's article.
    My questions:
    1). Is overriding doSelect() the correct thing here? Perhaps there is a better way of handling this problem? I do have a base EO class from which all of the EO's extend, so adding this behavior should be straightforward.
    2). Does anyone have example doSelect implementation? I am thinking of overriding doSelect for my EO and calling super.doSelect (lock=false), but then I need to deal with some possible exceptions, no?
    Kind regards,
    John

    Hi John,
    I have exactly the same issue as you experienced back in January. I have a complex data modelling requirement which requires the need to pivot rows into columns using ROW_NUMBER() and PARTITION clauses. To hide the complexity from the middle tier, I have created a database view and appropriate INSTEAD OF triggers and mapped my EO to the view. I have overriden the lock() method on the EO implementation class (to avoid ORA-02014) and would like to try the same solution you used with the pl/sql call to lock the record.
    My question is, how did you manage the release of the lock if the transaction was not rolled back or committed by your application i.e. if the user closed the browser for instance.
    In my naivity, I would like to think that the BC4J framework would release any locks for the database session when it found the servlet session to be terminated however my concern is that the lock would persist and cause complications.
    Any assistance greatly appreciated (if you would be willing to supply your lock() method and pl/sql procedure logic I would be even more grateful!).
    Many thanks,
    Dave
    London

  • View with Instead of Trigger - ORA-01031

    I am having trouble with a form based on a view that uses an instead of trigger.
    When I attempt to update a complex view that uses instead of triggers in an APEX form, I get the following message:
    ORA-20001: Error in DML: p_rowid=21388, ... ORA-01031: insufficient privileges
    The view works correctly when updates are executed from SQL Plus.
    The view "VW" is based on several tables in the application schema "X", which is parsed by APEX, and several tables in another schema "Z". I have explicitly granted select permission on the tables in schema "Z" to schema "X", but this doesn't resolve the error.
    Any idea how to fix this problem? From reading other posts, it sounds like the only issue should be explicit grants on the tables in other schemas. I do not attempt to update the tables in schema "Z", and do not have update permissions to those tables.
    Sinerely, Justin

    Justin,
    you might try to grant the views to the FLOWS_xxxxx user, which performs the Apex processes.
    Dik Dral

  • View with instead of trigger still not updatable

    Hi everybody,
    could somebody explain how to make this view updatable?
    I have the following log:
    CREATE OR REPLACE FORCE VIEW BRS_V_VERPLICHTINGEN
    (VERPLICHTING_NR
    ,ONTSTAANSJAAR
    ,OMSCHRIJVING
    ,DATUM_VERANTWOORDING
    ,OBJECT_NR
    ,OBJECT_NAAM
    ,CDG_CODE
    ,TMA_CODE
    ,CREATED_BY
    ,CREATION_DATE
    ,LAST_UPDATED_BY
    ,LAST_UPDATE_DATE)
    AS SELECT vw_brs_verplichting.verplichting_nr
    ,     vw_brs_verplichting.ontstaansjaar
    ,     nvl( brs_verplichtingen.omschrijving, vw_brs_verplichting.verplichting_oms
    ,     vw_brs_verplichting.datum_verantwoording
    ,     vw_brs_verplichting.object_nr
    ,     vw_brs_verplichting.object_naam
    , brs_verplichtingen.cdg_code
    ,     brs_verplichtingen.tma_code
    ,     brs_verplichtingen.created_by
    ,     brs_verplichtingen.creation_date
    ,     brs_verplichtingen.last_updated_by
    ,     brs_verplichtingen.last_update_date
    FROM vw_brs_verplichting
    ,     brs_verplichtingen
    WHERE vw_brs_verplichting.vervallen_code = 'N'
    AND vw_brs_verplichting.verplichting_nr = brs_verplichtingen.verplichting_nr
    AND vw_brs_verplichting.ontstaansjaar = brs_verplichtingen.ontstaansjaar
    View created
    CREATE OR REPLACE TRIGGER BRS_VVG_IRU
    INSTEAD OF UPDATE
    ON BRS_V_VERPLICHTINGEN
    BEGIN
    brs_vvg_pck.instead_of_row_update( :new.verplichting_nr
    , :new.ontstaansjaar
    , :new.omschrijving
    , :new.cdg_code
    , :new.tma_code
    END ;
    Trigger created
    SELECT COLUMN_NAME
    ,     INSERTABLE
    ,     UPDATABLE
    ,     DELETABLE
    FROM USER_UPDATABLE_COLUMNS
    WHERE TABLE_NAME = 'BRS_V_VERPLICHTINGEN'
    COLUMN_NAME INSERTABLE UPDATABLE DELETABLE
    VERPLICHTING_NR YES YES YES
    ONTSTAANSJAAR YES YES YES
    OMSCHRIJVING NO NO NO
    DATUM_VERANTWOORDING YES YES YES
    OBJECT_NR YES YES YES
    OBJECT_NAAM NO YES NO
    CDG_CODE NO YES NO
    TMA_CODE NO YES NO
    CREATED_BY NO YES NO
    CREATION_DATE NO YES NO
    LAST_UPDATED_BY NO YES NO
    LAST_UPDATE_DATE NO YES NO
    12 rows selected
    But that one column still isn't updatable... however because i'm using an INSTEAD OF UDPATE trigger they should all be updatable, shouldn't they?
    I'm using the 10g database...
    Hope someone can help...
    Regards,
    Robert

    Justin,
    you might try to grant the views to the FLOWS_xxxxx user, which performs the Apex processes.
    Dik Dral

  • Returning newly created IDs from View with Instead Of

    Hi All,
    I have the following table:
    CREATE TABLE TBLSIM_SUPPLIER_H
        "SS_ID" NUMBER(10,0) NOT NULL ENABLE,
        "SS_GUID" NVARCHAR2(36) NOT NULL ENABLE,
        "SS_NAME" NVARCHAR2(50) NOT NULL ENABLE,
        "SS_H_IS_ACTIVE" NUMBER(1,0) DEFAULT 1 NOT NULL ENABLE,
        "SS_H_RE_ID"     NUMBER(10,0) NOT NULL ENABLE,
        "SS_H_DATE" DATE DEFAULT SYSDATE NOT NULL ENABLE,
        "SS_H_MASTER_ID" NUMBER(10,0),
        CONSTRAINT "TBLSIM_SUPPLIER_PK" PRIMARY KEY ("SS_ID") ENABLE,
        CONSTRAINT "TBLSIM_SUPPLIER_FK_M_ID" FOREIGN KEY ("SS_H_MASTER_ID") REFERENCES "TBLSIM_SUPPLIER_H" ("SS_ID") ENABLE
      )on which is enabled this trigger
    CREATE OR REPLACE TRIGGER TBLSIM_SUPPLIER_H_TRG BEFORE
      INSERT ON TBLSIM_SUPPLIER_H FOR EACH ROW BEGIN <<COLUMN_SEQUENCES>> BEGIN IF :NEW.SS_ID IS NULL THEN
      SELECT TBLSIM_SUPPLIER_H_SEQ.NEXTVAL INTO :NEW.SS_ID FROM DUAL;
    END IF;
    IF :NEW.SS_GUID IS NULL THEN
      :NEW.SS_GUID  := UTILITYPKG.formatted_guid;
    END IF;
    END COLUMN_SEQUENCES;
    END;UTILITYPKG.formatted_guid returns a standard 36chr GUID
    I then created a view
    CREATE OR REPLACE FORCE VIEW TBLSIM_SUPPLIER
    AS
      SELECT SS_ID,
        SS_GUID,
        SS_NAME,
        SS_H_IS_ACTIVE,
        SS_H_RE_ID,
        SS_H_DATE
      FROM TBLSIM_SUPPLIER_H
      WHERE (ss_h_is_active = 1);on which I enabled the trigger
    CREATE OR REPLACE TRIGGER TBLSIM_SUPPLIER_INS INSTEAD OF
      INSERT ON TBLSIM_SUPPLIER FOR EACH ROW
        BEGIN
      INSERT INTO TBLSIM_SUPPLIER_H (ss_name, ss_h_is_active, ss_h_re_id, ss_h_date)
        VALUES (:NEW.ss_name, 1, :NEW.ss_h_re_id, SYSDATE);
    END TBLSIM_SUPPLIER_INS;I then have a stored Procedure
    PROCEDURE SimSupplier_Create(
          cur_tblresource_id_in IN tblresource.re_id%TYPE
        , ss_name_in IN tblsim_supplier.ss_name%TYPE
        , ss_id_out OUT tblsim_supplier.ss_id%TYPE
        , ss_guid_out OUT tblsim_supplier.ss_guid%TYPE
      ) AS
      BEGIN
        INSERT INTO tblsim_supplier (
          , ss_name
          , ss_h_re_id
        VALUES ( 
          , ss_name_in
          , cur_tblresource_id_in
       RETURNING ss_id, ss_guid INTO ss_id_out, ss_guid_out;
      END SimSupplier_Create; What happens is that the RETURNING clause is not available.
    Any way of getting the ID & GUID of the just inserted record out of the prcedure?
    Thanks
    Andrea

    Why do you need this instead of trigger? Can't you simply insert into the view? Maybe enable WITH CHECK OPTION to prevent wrong values beeing entered via the view. Or simply insert into the table and not the view. As long as it is done in the procedure, you are safe that there is no priviledge confict.
    Edited by: Sven W. on Oct 17, 2012 5:38 PM

  • Import of .bacpac fails on view with instead of delete trigger

    I'm using Azure Premium SQL. 
    When I export the database using the portal and blob storage and then immediately try to import it as a test to a new database (also using the portal) I get the error below.
    Looking at the restored database, many of the views are not there (including the one listed) although that may be because it failed on this view during the restore.
    The trigger seems to be working just fine in the original database.  It just won't restore from the bacpac.
    BTW, I notice in the original database before backup, the trigger says "DELETE
    FROM alndata.AptChangeLog", not "DELETE alndata.AptChangeLog"
    Thanks.
    Bryan
    Error encountered during the service operation. 
     Could not import package.
     Error SQL72014: .Net SqlClient Data Provider: Msg 8197, Level 16, State 4, Procedure AdminChangeLogAptNameDelete, Line 7 The object 'AlnData.AdminChangeLogAptName' does not exist or is invalid for this operation.
     Error SQL72045: Script execution error. The executed script:
     CREATE TRIGGER [AlnData].[AdminChangeLogAptNameDelete]
     ON [AlnData].[AdminChangeLogAptName]
     INSTEAD OF DELETE
     AS BEGIN
     SET NOCOUNT ON;
     DELETE alndata.AptChangeLog
     WHERE aptchangelog_id IN (SELECT aptchangelog_id FROM deleted);
     END

    Hello,
    Sorry for delay.
    I had found a feedback about trigger issue when restore SQL Database from a BACPAC file. Microsoft said the fixed  will be available in the next major release of DacFx.
    Feedback:
    SQL Azure fires a trigger when restoring from bacpac
    You can refer to the workarounds in the feedback. For example, if there is small amount of triggers on the database, you can try to remove the triggers and then recreate when restore from bacpac file.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Problem updating view with triggers

    I created a view with instead-of triggers for updating. When I try to update the view with an ADO 2.7 recordset I receive errormessages.
    rsAns.CursorLocation = adUseServer
    rsAns.Open "select * from callcenter.v_ans where kidno = 1534", adoConn, adOpenKeyset, adLockOptimistic
    rsAns.fields("Name").value = "Thomas"
    The last line creates the error:
    -2147217888
    Consumer's event handler called a non-reentrant method in the provider.
    When I try the same lines of code with...
    rsAns.CursorLocation = adUseClient
    I get:
    -2147217887
    Multiple-step operation generated errors. Check each status value.
    By the way, when using client side cursors with Microsoft's OLE DB for Oracle it works fine.
    Any ideas?

    I had the same problem but without triggers. I only changed some values in different records (always automatically commited) and after the third change I got this error message. At the same time I was connected with TOAD to the databse and there was no problem to change the data - so it doesn't look like a database problem.
    UPDATE "BLATABLE"."KEYS" SET "BLAVALUE" = "abcdef" WHERE ROWID = 'AAA2c1AADAAAHa5AAH' AND ORA_ROWSCN = '7738949481842'
    One error saving changes to table "BLATABLE"."KEYS":
    Row 6: ORA-01000: maximum open cursors exceeded

  • ITunes - App Store - There are updates available that ain't available?

    First of all, I'm starting to think that the iPhone ***** big time, but that's a whole other story...
    So, here's my issue: Apparently there are updates to my applications available. So says iTunes and also the App Store app on the iPhone, both of them reporting the same number of apps available.
    I'm quite sure that there was a button to "update all" on the iPhone on 2.0.1 and 2.0, but that seems to be missing? (but not the point anyway)
    Then, in iTunes, the applications view tells me that there are updates available. When I click that link on the lower right that usually redirects to the update page, iTunes tells me that there are no updates available for my account?!
    How can that be? Either there are or there ain't.
    Is there a way to fix that problem? I would have updated the applications trough the iPhone, but as there are many (44) and I would have do update them one-by-one, I'd like to go an easier way...
    I'm really patient, but I start to hate my iPhone. As it is now, it is just a ******* expensive piece of junk. :-((

    I have fixed a similar issue in my iTunes. Here is my thoughts on why it happened and the fix.
    I had recently added a second computer w/ iTunes with which my iPhone is now synching. I wanted to move my music library synching from work to home.
    On the 1st PC (@ Work) I was synching:
    Info, Contacts
    Info, Calendar
    Ringtones
    Music
    Podcasts
    Video
    Applications
    On the 2nd PC (@ Home) I began synching:
    Ringtones
    Music
    Video
    Applications (this nicely caused all of my iPhone Applications to be copied to this PC, in case of a need for a restore from home)
    After beginning synching on the 2nd PC (@ Home), I disabled synching on 1st PC of:
    Ringtones
    Music
    Video
    Applications (This apparently caused the issue)
    The issue with phantom updates was showing up on the 1st PC (@ Work), but I was not synching Applications here. Apparently, I had updated some Applications from the 2nd PC (@ Home) and iTunes detected this and saw a need to show that my iTunes Applications needed updating. Something not in synch between iPhone - iTunes - App Store I believe.
    The Fix:
    On the 1st PC (@ Work) I enabled synching of Applications and then performed a synch. The phantom updates went away. I noted during the synch that my iPhone apparently updated some of the applications in my iTunes library.
    I hope this helps or enlightens others having this difficulty.

  • View-Update in forms with Instead-Of trigger

    I has created a view and an Instead-Of trigger on that view.
    Now, I want to update this view in FORMS 6. I am unable to update this view and getting error FRM-40602.
    Is there any way to update this view updatable in FORMS6 or FORMS6 has not this feature?

    Hi,
    This has been acknowledged by Oracle as bug earlier. The work-around for this is as follows:
    1. Create table 1
    2. Create table 2
    3. Create view
    4. Create instead of insert trigger on view
    5. Create instead of update trigger on view
    6. Now, in the forms, go to the Block property
    7. Look for the 'Key mode' property. By default it is 'Automatic'. Set it to Updateable (If your database design supports updating primary keys) or Unique (preferable).
    8. Now run the form. It should work.
    All the best.
    Sunil Kumar G S

  • "instead of" trigger on a view with a condition

    I'm trying to create an instead-of trigger on a view but I want it all such that:
    1. It fires only for a certain condition.
    2. When the condition isn't met, I want the normal DML on the view to continue as it normally would.
    3. I want to avoid writing as much manual DML code as possible for long-term maintainability.
    My first attempt is like this:
    create or replace trigger PROPOSAL_PARTS_V_IRU
      instead of update on proposal_parts_v
      for each row
      WHEN :old.PART_MASTER_ID <> :new.PART_MASTER_ID
    BEGIN
      do_stuff_for_part_master_change;
    END;So when the OLD and NEW PART_MASTER_IDs have changed, I want special processing. Else, I want it to do whatever it normally does (let the view get updated and the database will manage the update of the underlying table).
    When compiling that I get "ORA-25004: WHEN clause is not allowed in INSTEAD OF triggers".
    OK I will accept that even though I want it to work.
    So my next attempt could be:
    create or replace trigger PROPOSAL_PARTS_V_IRU
      instead of update on proposal_parts_v
      for each row
    BEGIN
      IF :old.PART_MASTER_ID <> :new.PART_MASTER_ID THEN
        do_stuff_for_part_master_change;
      ELSE
        UPDATE proposal_parts -- Manually update the underlying table with manually-written DML but I hate having to do this in case the view or table columns change.
        SET...
        WHERE...
      END;So my question is...is there any syntax to do something like this?
    create or replace trigger PROPOSAL_PARTS_V_IRU
      instead of update on proposal_parts_v
      for each row
    BEGIN
      IF :old.PART_MASTER_ID <> :new.PART_MASTER_ID THEN
        do_stuff_for_part_master_change;
      ELSE
        update_row;
      END;...where "update_row" is some sort of built-in command that tells oracle to continue with the current update as if the trigger never existed.
    Back in the day I seem to remember that Oracle Forms had a trigger and syntax like this where you could intercept a DML and if under certain conditions it wasn't true, you could say "update_row" (or maybe it was "update_record?...whatever) and it meant "continue with update as if this instead-of trigger never existed".
    Is anything available like that for the DB now? I know in older versions no, but we are now on 11g...anything new come out like this?
    Otherwise I have to manually write an update statement and I'd rather not if I don't need to.
    Thanks!

    riedelme wrote:
    gti_matt wrote:
    I'm trying to create an instead-of trigger on a view but I want it all such that:
    1. It fires only for a certain condition.You can use IF Logic inside a trigger to do or not do anything. As long as it is a condition you can check you can code IF logic around it
    2. When the condition isn't met, I want the normal DML on the view to continue as it normally would.You will have to code all of your logic in the INSTEAD of trigger. The whole purpose of the INSTEAD OF trigger is to execute INSTEAD OF performing DML on the view. There is no way to go back to the "normal DML" when the INSTEAD OF trigger exists.
    You can put all of the logic you will need in the INSTEAD OF trigger and use IF conditions. Use IF logic to code both your special and "normal" processing.
    3. I want to avoid writing as much manual DML code as possible for long-term maintainability.You will have to code the operative lines somewhere. Reusable functions and/or procedures in a package?Yep using an "IF" I knew about...no problem there.
    But was just looking for a cheap and easy way to say (for the "else" condition) to revert to normal DML processing. Sounds like in a DB trigger there is no such syntax I guess.
    This is an example from Oracle Forms, I was looking for a database equivalent of this(see http://sqltech.cl/doc/dev2000/help/fbhelp18.htm):
    Built-in Subprograms for On-Event Triggers For most of the transactional On-event triggers, there is a corresponding built-in subprogram.
    On-Event Trigger
    Corresponding Built-in
    On-Delete
    DELETE_RECORD
    On-Insert
    INSERT_RECORD
    On-Update
    UPDATE_RECORD
    When you call one of these built-in subprograms from its corresponding transactional trigger, Form Builder performs the default processing that it would have done normally at that point in the transaction.
    For example, if you call the INSERT_RECORD procedure from an On-Insert trigger, Form Builder performs the default processing for inserting a record in the database during a commit operation.
    When these built-ins are issued from within their corresponding transactional triggers, they are known as do-the-right-thing built-ins. That is, they do what Form Builder would normally have done at that point if no trigger had been present. Thus, an On-Insert trigger that calls the INSERT_RECORD procedure is functionally equivalent to not having an On-Insert trigger at all. Such a trigger is explicitly telling Form Builder to do what it would have done by default anyway.Note that the author calls them the "do-the-right-thing" built-ins. That's what I was looking for but on the DB side. Sounds like Oracle didn't come up with that (yet)?

Maybe you are looking for

  • Photos app shows I have less photos than my settings does

    Hello all. I got a new iPhone 5s in January and since I have noticed that in my photos app (where photos are stored) it says I have taken 624 photos and 14 videos but when going into Settings> General> About> Videos 15 and Photos 1,214. Why is this a

  • IPhone play count problem

    Hi guys, This is my first post - my first real problem since switching to Mac a few years ago - but I seem to have a problem with the play counts on my iPhone 3GS. With my iPods the play counts updated as usual and stayed the same and increased corre

  • About interfaces

    why should we write public before the method which is implemented in a class from an interface? what is that meaning?

  • Is the serial number for an iPad mini specific to the gb's on the device?

    I just bought a 32 gb iPad mini off eBay with some damage.  Taking it to the Apple store, I found out I was able to get a new one free of charge because it was under warranty.  They did this by checking the serial number.  After I came home, I realiz

  • Macbook Pro not working - charger flashing orange and green...

    So I have 13" macbook pro 2010... i was on it yesterday when all of a sudden the screen started flashing black and back to normal and black again really quickly... so i shut down the laptop and put it aside for a few hours... i returned later and tri