Updating Table with Triggers causes Raptor to Hang.

Received an Error Window
ORA-01000 Max Open Cursors Exceeded 1000
Vendor Code 100
This was displayed when updating a data value in a table which spawned a couple of Triggers, a before, after, and after statement trigger. What the Trigger does is when an Exchange Rate for a Date (one row), is changed the exchage_rate for every receipt is updated. The size of the table are in test and there are 100 receipts. The Echange Rate table has one record for every day between 01-JAN-2000 and 31-DEC-2050 (365.25*50) Rows. The open_cursors param in init file is 1000. Have done various scenarios and everything works fine from sqlplus. Hangs with message in Raptor, and have to kill process in windows..
When run in Sqlplus no problem with update.

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

Similar Messages

  • Updating parent row in a self-join table with triggers

    Hi Gurus!
    Need of a business to update parent row(s) in the same table with triggers (insert, update and delete). Table is having recursive relation and error is coming as mutating error. I was able to do this with MS-SQL server.
    Appreciate any help or work around possibilities.
    Regards,
    SH

    SH,
    popular solutions to this issue include
    - autonomous transactions
    - recording (typically in PL/SQL package variables) the rows being processed from the row level triggers and using this information in the after statement level trigger to perform the update on the parent rows
    - use a View with an instead of trigger to re-route the DML on your table
    Which one to use depends on what exactly you are trying to achieve and how the data hangs together.
    Lucas

  • Update table with data from dialog

    Hello,
    I need the problem.
    I'm not update table with inputtext field where data change from dialog.
    This metod is update table.
    public void returnHandlerGoods(ReturnEvent returnEvent) {
    // Add event code here...
    ArrayList<PricatGoods> data = (ArrayList<PricatGoods>) returnEvent.getReturnValue();
    BindingContainer bc = getBindings();
    DCIteratorBinding dcIterBinding;
    // сохранить изменения detail
    dcIterBinding = (DCIteratorBinding) bindings.get("findVMIOrderDetailsIter");
    RowSetIterator s = dcIterBinding.getRowSetIterator();
    System.out.println("Получено товаров " + data.size());
    for (int i =0; i < data.size(); i++){
    Row detailRow = (RowImpl)s.createRow();
    detailRow.setNewRowState(Row.STATUS_INITIALIZED);
    s.insertRow(detailRow);
    s.setCurrentRow(detailRow);
    // detailRow.setAttribute("lineNum",createLineNum(i));
    detailRow.setAttribute("gtin",((PricatGoods)data.get(i)).getGtin());
    detailRow.setAttribute("goodId",((PricatGoods)data.get(i)).getGoodId());
    detailRow.setAttribute("goodName",((PricatGoods)data.get(i)).getGoodName());
    detailRow.setAttribute("sellerarticle",((PricatGoods)data.get(i)).getGoodCode());
    detailRow.setAttribute("buyerarticle",((PricatGoods)data.get(i)).getBuyerArticle());
    detailRow.setAttribute("unit",((PricatGoods)data.get(i)).getUnit());
    detailRow.setAttribute("totalQuantity",0);
    detailRow.setAttribute("acceptedQuantity",0);
    detailRow.setAttribute("taxRate",((PricatGoods)data.get(i)).getVatPercent());
    detailRow.setAttribute("price",((PricatGoods)data.get(i)).getCost());
    detailRow.setAttribute("priceWithoutTax",((PricatGoods)data.get(i)).getCostWithoutVat());
    detailRow.setAttribute("sumWithoutTax",0.0);
    detailRow.setAttribute("totalSum",0.0);
    detailRow.setAttribute("currency",((PricatGoods)data.get(i)).getCurrency());
    System.out.println("Добавление товара \" "+((PricatGoods)data.get(i)).getGoodName()+ "\" с goodCode " +((PricatGoods)data.get(i)).getGoodCode());
    s.closeRowSetIterator();
    AdfFacesContext.getCurrentInstance().addPartialTarget(table2);
    Fields are update good where inputText.readOnly = true.
    Fields are not update good where inputText.readOnly = false. Old data duplicate in new row.
    I have found some posts, but in them is not told accurately as I can solve the given problem.
    How to update a adf table??
    Re: ADF Dialog FrameWork-Table Update Problem
    Whether it is possible to solve the given problem?
    Thx,
    Dema

    If I use outputText that all job's a good. But I don't change these fields. I should have field with change for users.
    Code jspx page for table ===>
    <af:table value="#{bindings.findVMIOrderDetails1.collectionModel}"
    var="row"
    rows="#{bindings.findVMIOrderDetails1.rangeSize}"
    first="#{bindings.findVMIOrderDetails1.rangeStart}"
    emptyText="#{bindings.findVMIOrderDetails1.viewable ? 'Товаров пока нет.' : 'Access Denied.'}"
    selectionState="#{bindings.findVMIOrderDetails1.collectionModel.selectedRow}"
    selectionListener="#{bindings.findVMIOrderDetails1.collectionModel.makeCurrent}"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.table2}"
    id="table2" styleClass="baseTable">
    <af:column sortProperty="lineNum" sortable="false"
    headerText="№"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column19}"
    id="column19">
    <af:inputText value="#{row.lineNum}" simple="false"
    required="true"
    columns="4"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText4}"
    id="inputText4" readOnly="false"
    requiredMessageDetail='Поле "№" обязательно для заполнения'/>
    </af:column>
    <af:column sortProperty="gtin" sortable="false"
    headerText="GTIN"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column20}"
    id="column20">
    <af:inputText value="#{row.gtin}" simple="true"
    required="#{bindings.findVMIOrderDetails1.attrDefs.gtin.mandatory}"
    columns="#{bindings.findVMIOrderDetails1.attrHints.gtin.displayWidth}"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText26}"
    id="inputText26" readOnly="true"/>
    </af:column>
    <af:column sortProperty="sellerarticle" sortable="false"
    headerText="Код товара у поставщика"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column21}"
    id="column21">
    <af:inputText value="#{row.sellerarticle}" simple="true"
    required="#{bindings.findVMIOrderDetails1.attrDefs.sellerarticle.mandatory}"
    columns="#{bindings.findVMIOrderDetails1.attrHints.sellerarticle.displayWidth}"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText27}"
    id="inputText27" readOnly="true"/>
    </af:column>
    <af:column sortProperty="buyerarticle" sortable="false"
    headerText="Код товара у покупателя"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column22}"
    id="column22">
    <af:inputText value="#{row.buyerarticle}" simple="true"
    required="#{bindings.findVMIOrderDetails1.attrDefs.buyerarticle.mandatory}"
    columns="10"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText28}"
    id="inputText28" readOnly="true"
    disabled="false"/>
    </af:column>
    <af:column sortProperty="goodName" sortable="false"
    headerText="Наименование"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column23}"
    id="column23">
    <af:inputText value="#{row.goodName}" simple="true"
    required="true"
    columns="11"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText29}"
    id="inputText29"
    requiredMessageDetail="Поле обязательно для заполнения"
    readOnly="true"/>
    </af:column>
    <af:column sortProperty="itemDesc" sortable="false"
    headerText="Описание"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column24}"
    id="column24" rendered="false">
    <af:inputText value="#{row.itemDesc}" simple="true"
    required="#{bindings.findVMIOrderDetails1.attrDefs.itemDesc.mandatory}"
    columns="#{bindings.findVMIOrderDetails1.attrHints.itemDesc.displayWidth}"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText30}"
    id="inputText30"/>
    </af:column>
    <af:column sortProperty="unit" sortable="false"
    headerText="Ед. изм."
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column25}"
    id="column25">
    <af:inputText value="#{row.unit}" simple="true"
    required="#{bindings.findVMIOrderDetails1.attrDefs.unit.mandatory}"
    columns="#{bindings.findVMIOrderDetails1.attrHints.unit.displayWidth}"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText31}"
    id="inputText31" readOnly="true"/>
    </af:column>
    <af:column sortProperty="currency" sortable="false"
    headerText="Валюта"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column26}"
    id="column26" rendered="false">
    <af:inputText value="#{row.currency}" simple="true"
    required="#{bindings.findVMIOrderDetails1.attrDefs.currency.mandatory}"
    columns="#{bindings.findVMIOrderDetails1.attrHints.currency.displayWidth}"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText32}"
    id="inputText32"/>
    </af:column>
    <af:column sortProperty="totalQuantity" sortable="false"
    headerText="Общее кол-во"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column27}"
    id="column27">
    <af:inputText value="#{row.totalQuantity}"
    required="#{bindings.findVMIOrderDetails1.attrDefs.totalQuantity.mandatory}"
    columns="#{bindings.findVMIOrderDetails1.attrHints.totalQuantity.displayWidth}"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText36}"
    id="inputText36" readOnly="true">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.findVMIOrderDetails1.formats.totalQuantity}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="acceptedQuantity" sortable="false"
    headerText="Кол-во поставки"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column28}"
    id="column28">
    <af:inputText value="#{row.acceptedQuantity}"
    required="true"
    columns="7"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText37}"
    id="inputText37"
    requiredMessageDetail='Поле "Подтвержденное количество "обязательно для заполнения'
    validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.validatorQuantity}"
    readOnly="false">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.findVMIOrderDetails1.formats.acceptedQuantity}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="taxRate" sortable="false"
    headerText="НДС, %"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column29}"
    id="column29">
    <af:inputText value="#{row.taxRate}"
    required="true"
    columns="4"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText38}"
    id="inputText38"
    requiredMessageDetail='Поле "НДС" обязательно для заполнения'
    validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorNDS}"
    readOnly="false">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.findVMIOrderDetails1.formats.taxRate}"/>
    </af:inputText>
    </af:column>
    <af:column sortable="false" headerText="Цена"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column34}"
    id="column34">
    <af:column sortProperty="priceWithoutTax" sortable="false"
    headerText="Без НДС"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column31}"
    id="column31">
    <af:inputText value="#{row.priceWithoutTax}"
    required="true"
    columns="6"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText40}"
    id="inputText40"
    requiredMessageDetail='Поле "Цена без НДС" обязательно для заполнения'
    validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorPriceWithoutTax}"
    readOnly="false">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.findVMIOrderDetails1.formats.priceWithoutTax}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="price" sortable="false"
    headerText="С НДС"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column30}"
    id="column30">
    <af:inputText value="#{row.price}"
    required="true"
    columns="6"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText39}"
    id="inputText39"
    requiredMessageDetail='Поле "Цена с НДС" обязательно для заполнения'
    validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorPrice}"
    readOnly="false">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.findVMIOrderDetails1.formats.price}"/>
    </af:inputText>
    </af:column>
    </af:column>
    <af:column sortable="false" headerText="Сумма"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column35}"
    id="column35">
    <af:column sortProperty="sumWithoutTax" sortable="false"
    headerText="Без НДС"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column32}"
    id="column32">
    <af:inputText value="#{row.sumWithoutTax}"
    required="true" columns="6"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText41}"
    id="inputText41"
    requiredMessageDetail='Поле "Сумма без НДС" обязательно для заполнения'
    autoSubmit="true"
    valueChangeListener="#{backing_documents_outcoming_unprocessing_type_15_edit_01.changeSum}"
    readOnly="false">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.findVMIOrderDetails1.formats.sumWithoutTax}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="totalSum" sortable="false"
    headerText="С НДС"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.column33}"
    id="column33">
    <af:inputText value="#{row.totalSum}" required="true"
    columns="6"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.inputText42}"
    id="inputText42"
    requiredMessageDetail='Поле "Сумма с НДС" обязательно для заполнения'
    autoSubmit="true"
    valueChangeListener="#{backing_documents_outcoming_unprocessing_type_15_edit_01.changeSum}"
    validator="#{backing_documents_outcoming_unprocessing_type_15_edit_01.unitValidatorTotalSum}"
    readOnly="false">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.findVMIOrderDetails1.formats.totalSum}"/>
    </af:inputText>
    </af:column>
    </af:column>
    <f:facet name="selection">
    <af:tableSelectOne text="Select and"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.tableSelectOne2}"
    id="tableSelectOne2">
    <af:commandLink text="Удалить"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.commandLink5}"
    id="commandLink5"
    action="#{backing_documents_outcoming_unprocessing_type_15_edit_01.deleteRow}"
    styleClass="tableControlButton"
    immediate="false"/>
    </af:tableSelectOne>
    </f:facet>
    <f:facet name="actions">
    <h:panelGroup binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.panelGroup2}"
    id="panelGroup2">
    <af:commandLink text="Добавить"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.commandLink6}"
    id="commandLink6"
    styleClass="tableControlButton"
    immediate="false"
    action="#{backing_documents_outcoming_unprocessing_type_15_edit_01.addRows}"
    useWindow="true" windowHeight="500"
    windowWidth="600"
    returnListener="#{backing_documents_outcoming_unprocessing_type_15_edit_01.returnHandlerGoods}"
    rendered="#{bindings.JdDoctype02rspType.inputValue == 9&amp;&amp;bindings.JdDoctype02orderrspId.inputValue==null}"/>
    <af:commandLink text="Пересчитать" id="commandLink31"
    styleClass="tableControlButton"
    binding="#{backing_documents_outcoming_unprocessing_type_15_edit_01.commandLink31}"
    action="#{backing_documents_outcoming_unprocessing_type_15_edit_01.calc}"
    useWindow="true" immediate="false">
    <af:setActionListener from="#{row.rowKeyStr}"
    to="#{processScope.mainRowKeyStr}"/>
    </af:commandLink>
    </h:panelGroup>
    </f:facet>
    </af:table>

  • Updating table with column NUMBER(6,2) causing concurrency exception in .NE

    For info,
    I try to update a table with a column defined as a NUMBER(6,2). I receive a concurrency exception.
    If I resize this column as a NUMBER(8,2), every thing works well.
    Bye

    I get the same problem. Changing from anything less than number(8,2) changes the vb datatype from single to double.
    Apparently ODP.NET cannot handle the single datatype.
    /Bj�

  • Help me to update table with condition's

    this table is an alert table which will update when the sql server down , not pinging and drive space low.
    Every 15 mins the monitoring system run. if the any issue came then it will update the information in this table. if  the issue not solved by 15 mins the table will update again with the same details.. 
    I would like update tickeraised = Y  only on first time and  if i got same issue less then 30 min the it should not change to Y..  based on server name , type and message. 
    min >10 and <20 min if any value is there then the table should not update with same value. can any one help me with tsql query...

    In future please post DDL and DML. For now I have created a scenario which will help you understand solution to your own requirement.
    CREATE TABLE Tickets_Log(
    Ticked_ID SMALLINT IDENTITY(1,1) PRIMARY KEY,
    Ticket_Type VARCHAR(20) NOT NULL,
    Log_Date DATETIME2 NOT NULL DEFAULT DATEADD(MINUTE,-15,GETDATE()),
    Machine_Name VARCHAR(50) NOT NULL,
    Message VARCHAR(100) NOT NULL,
    Ticket_Status CHAR(2) NOT NULL DEFAULT 'N',
    Update_Status SMALLINT DEFAULT 0)
    INSERT Tickets_Log(Ticket_Type,Machine_Name,Message)
    SELECT 'Pinging','HOD-400-651','Server Not Pinging' UNION
    SELECT 'Low Drive Space','HOD-400-652','Drive Space Low' UNION
    SELECT 'Connection','HOD-400-653','Unable to Connect to Server'
    UPDATE TL
    SET Log_Date=NewTickets.Log_Date,
    Update_Status=1
    FROM( SELECT 'Pinging' Ticket_Type,'HOD-400-651' Machine_Name,'Server Not Pinging' Message,GETDATE() Log_Date UNION
    SELECT 'Pinging','HOD-400-653','Server Not Pinging',GETDATE() Log_Date) NewTickets
    LEFT JOIN Tickets_Log TL ON NewTickets.Machine_Name=TL.Machine_Name AND NewTickets.Ticket_Type=TL.Ticket_Type
    WHERE TL.Ticket_Type IS NOT NULL AND TL.Machine_Name IS NOT NULL AND DATEDIFF(MINUTE,TL.Log_Date,NewTickets.Log_Date)>=15 AND Update_Status=0
    INSERT Tickets_Log(Ticket_Type,Machine_Name,Message,Log_Date)
    SELECT NewTickets.*
    FROM( SELECT 'Pinging' Ticket_Type,'HOD-400-651' Machine_Name,'Server Not Pinging' Message,GETDATE() Log_Date UNION
    SELECT 'Pinging','HOD-400-653','Server Not Pinging',GETDATE() Log_Date) NewTickets
    LEFT JOIN Tickets_Log TL ON NewTickets.Machine_Name=TL.Machine_Name AND NewTickets.Ticket_Type=TL.Ticket_Type
    WHERE TL.Ticket_Type IS NULL AND TL.Machine_Name IS NULL
    Chaos isn’t a pit. Chaos is a ladder. Many who try to climb it fail and never get to try again. The fall breaks them. And some are given a chance to climb, but they refuse. They cling to the realm, or the gods, or love. Illusions. Only the ladder is real.
    The climb is all there is.

  • 29875; error updating table with geometry but without index

    hi,
    I've a table with next description
    AGGREGATEDUNIT_ID NOT NULL NUMBER(38)
    DATASET_ID NUMBER(38)
    GEOMETRY MDSYS.SDO_GEOMETRY
    REDEFINEDMETADATA SYS.XMLTYPE
    I dont need a spatial index in column GEOMETRY, but when I try an update operation:
    INSERT INTO AGGREGATEDUNIT (AGGREGATEDUNIT_ID, DATASET_ID) VALUES (389, 893)
    I get next error:
    INSERT INTO AGGREGATEDUNIT
    ERROR en lmnea 1:
    ORA-29875: fallo al ejecutar la rutina ODCIINDEXINSERT
    ORA-13203: fallo al leer la tabla USER_SDO_GEOM_METADATA
    ORA-13203: fallo al leer la tabla USER_SDO_GEOM_METADATA
    ORA-06512: en "MDSYS.SDO_INDEX_METHOD_9I", lmnea 183
    ORA-06512: en lmnea 1
    anybody knows?
    thanx

    Hi,
    Whether you need the index or not, someone has created a spatial index on the table.
    You can drop the index, or you can add the metadata for the table into user_sdo_geom_metadata (it was there at the time the index was created).
    Hope this helps,
    Dan

  • Error Updating Table with "Get Active UnitOfWork" Checked

    Hi everyone.
    I call invoke the a DB Adapter twice to update table in one BPEL, and so I have checked "Get Active UnitOfWork" so that each update can be persisted. I am seeing inconsistent results. What could be causing this?

    Hi, Have you checked the .jca source to make sure this value is indeed checked? Sometimes even when you check this option in the wizard it doesn't reflect in the source when you also perform a select operation: http://docs.oracle.com/cd/E12839_01/relnotes.1111/e10133/adapter.htm. Also are you using the xADataSource driver in the data source and the xADataSourceName ConnectionFactory property?
    21.1.5.1 The Value Of the Active Unit Of Work Property Is Not Saved for Outbound SELECT Operation
    While configuring an outbound Oracle Database Adapter to perform a SELECT operation, if you select Get Active Unit of Work in the Adapter Configuration Wizard - Advanced Option page, then the value of the GetActiveUnitofWork property is not saved in the .jca file.
    The workaround for this issue is to manually add this property in the .jca file of the Oracle Database Adapter, as shown in the following example:
    <property name="GetActiveUnitOfWork" value="true"/>

  • Update table with select from another table

    Hallo,
    I'd like to update table b with codes from a mapping table a.
    a has:
    town_id, town_code, town_name
    b has town_code, town_id, town_population, town_zip_code,...
    Table a has all the details - town_id, town_code and town_name and acts as the mapping between town_id and town_code
    In table b, town_code is null. I want to update the column b.town_code with town_code from table a where a.town_id = b.town_id.
    How will the update query look like?
    I tried
    UPDATE B SET town_code = (SELECT A.town_code FROM A,B WHERE A.town_id=B.town_id)
    and I get the error 'single-row subquery returns more than one row'
    Will appreciate your assistance

    This is what I did.
    First, I created and populated the TOWN_INFO table:
    CREATE TABLE "TOWN_INFO"
    (     "TOWN_ID" NUMBER,
         "TOWN_CODE" NUMBER,
         "E_MAIL" CHAR(15 BYTE)
    Table Created.
    insert all
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3024,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3040,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3052,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3065,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3066,'[email protected]')
    select * from dual
    5 rows created.
    The following creates and populates the mapping table:
    CREATE TABLE "TOWN_MAPP"
    (     "TOWN_CODE" NUMBER,
         "TOWN_ID" VARCHAR2(255 BYTE),
         "TOWN_NAME" CHAR(6 BYTE)
    insert all
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3024,'1001','TOWN_1')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3040,'1003','TOWN_3')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3052,'1002','TOWN_2')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3065,'1004','TOWN_4')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3066,'1006','TOWN_6')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3088,'1007','TOWN_7')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3020,'1009','TOWN_9')
    select * from dual
    7 rows created.
    And now the update query:
    UPDATE TOWN_INFO
    SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
    WHERE B.TOWN_ID=B.TOWN_ID)
    SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
    ERROR at line 2:
    ORA-01427: single-row subquery returns more than one row
    Thanx in advance
    Edited by: user9954260 on Apr 13, 2010 7:40 AM
    Edited by: user9954260 on Apr 13, 2010 7:44 AM

  • Updating table with invalid identifiers

    Hi!
    I use a third-party plug in and that comparisons of chemical structures. I would like to update one table with values from another when the plug-in matches two rows. However, I am getting an invalid identifier problem.
    Two tables:
    PLATES: has VARCHAR2 columns of PLATE_SMILES, IN_DB
    INVEST: has VARCHAR2 columns of SMILES
    The operator is a binary one: jc_compare(PLATE_SMILES, SMILES)=1 (or 0 if they don't match)
    I want my query to say: "If comparison of PLATE_SMILES, SMILES = 1, set IN_DB=1 for that row" - effectively asking if PLATE_SMILES exists in the INVEST table.
    I've tried a number of renditions, all giving invalid identifiers. Here's an example:
    update (select plate.PLATE_SMILES, plate.IN_DB, invest.SMILES
    from PLATES plate
    INVEST invest
    WHERE jc_compare(PLATE_SMILES, SMILES)=1)
    set plate.IN_DB = 1;
    ORA-00904: "PLATE"."IN_DB": invalid identifier
    I'm hoping this should be an easy fix, and any help is greatly appreciated!

    Hi,
    You have
    UPDATE (SELECT plate.plate_smiles,
                   plate.in_db,
                   invest.smiles
            FROM   plates plate, invest invest
            WHERE  jc_compare ( plate_smiles, smiles) = 1)
    SET    plate.in_db = 1;   -- Error herePLATE is not known outside the inline view. Just remove it.
    Regards
    Peter

  • Update Table with xml data

    Hi,
    I have to update Table by reading Xml data.
    I have written a procedure which is given below.
    PROCEDURE Sp_Set_File_Permission
    p_i_v_xml_data  IN VARCHAR2,
    Cur_Out_Col_Nm    OUT Typ_Icon_Out
    IS 
    XmlDataset   XMLTYPE;
      BEGIN
    /* This is my xml
    <xmldata>
    <newdataset>
    <fileid>99</fileid>
    <add>TRUE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    <newdataset>
    <fileid>100</fileid>
    <add>FALSE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    </xmldata>*/
    xmldataset := Xmltype.Createxml(p_i_v_Xml_Data);
    --error occured on this line while executing procedure
    FOR i IN (SELECT
                   Dt.Extract('//newdataset/fileid/text()').Getstringval() AS Fileid,
                   Dt.Extract('//newdataset/add/text()').Getstringval() AS Add,
                   Dt.Extract('//newdataset/edit/text()').Getstringval() AS Edit,
                   Dt.Extract('//newdataset/del/text()').Getstringval() AS d,
                   Dt.Extract('//newdataset/ex/text()').Getstringval() AS e,
                   Dt.Extract('//newdataset/im/text()').Getstringval() AS I
                    FROM TABLE(Xmlsequence( xmldataset.Extract('//xmldata/newdataset'))) Dt)
        LOOP
        UPDATE t_object_master
      SET add_view=i.Add
      ,edit_view=i.Edit,
      delete_view=i.D,
      export_view=i.E,
      import_view=i.I
      WHERE objct_id=i.Fileid;
      COMMIT;
      END LOOP;
      END Sp_Set_File_Permission;
    When I am trying to exceute this procedure with the above mentioned xml ,getting error ORA-00923 ,FROM keyword not found where expected.
    Please help me out in this.
    Thanks,

    Something like this (no commit inside loop, no row per row)
    create table t_object_master as
    with myxml as (
    select xmltype(
    '<xmldata>
    <newdataset>
    <fileid>99</fileid>
    <add>TRUE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    <newdataset>
    <fileid>100</fileid>
    <add>FALSE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    </xmldata>') doc from dual
    select
    fileid
    ,add_view
    from
    myxml
    ,xmltable('//newdataset'
    passing myxml.doc
    columns
    Fileid number      path 'fileid'
    ,add_view varchar2(5) path 'add'
    table created
    select
    from t_object_master
    FILEID
    ADD_VIEW
    99
    TRUE
    100
    FALSE
    update t_object_master t
    set add_view = (
    with myxml as (
    select xmltype(
    '<xmldata>
    <newdataset>
    <fileid>99</fileid>
    <add>FALSE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    <newdataset>
    <fileid>100</fileid>
    <add>TRUE</add>
    <edit>TRUE</edit>
    <del>FALSE</del>
    <ex>FALSE</ex>
    <im>TRUE</im>
    </newdataset>
    </xmldata>') doc from dual
    , myextract as (
    select
    fileid
    ,add_view
    from
    myxml
    ,xmltable('//newdataset'
    passing myxml.doc
    columns
    Fileid number      path 'fileid'
    ,add_view varchar2(5) path 'add'
    select
    add_view
    from myextract
    where
    fileid = t.fileid
    select *
    from  t_object_master
    FILEID
    ADD_VIEW
    99
    FALSE
    100
    TRUE

  • Global Temp table with BLOB causing session crash

    Hi,
    i have a table as follows:
    create global temporary table spg_file_import (
    name varchar2 (128) constraint sfi_nam_ck not null,
    mime_type varchar2 (128),
    doc_size number,
    dad_charset varchar2 (128),
    last_updated date,
    content_type varchar2 (128),
    content long raw,
    blob_content blob
    on commit delete rows
    this is my 9ias 'document' table thats used to receive uploaded files which i modified to be global temporary.
    what i want to do is:
    a)upload a text file (xml)
    b) convert that file to clob
    c) store that file in new permanent table as clob
    d) commit (hence delete temp table rows as they are no longer necessary)
    to test it i have:
    CREATE OR REPLACE procedure daz_html
    as
    begin
    htp.p(' <FORM enctype="multipart/form-data" action="daz_fu" method="POST">');
    htp.p(' <p>');
    htp.p(' File to upload: <INPUT type="file" name="p_file_in"><br>');
    htp.p(' <p><INPUT type="submit">');
    htp.p(' </form>');
    htp.p('</body>');
    htp.p('</html>');
    end;
    CREATE OR REPLACE procedure daz_fu (
    p_file_in varchar2
    as
    -- BLOB Stream locator
    v_raw blob;
    v_clob clob;
    v_blob_length number;
    v_length number;
    v_buffer varchar2(32767);
    v_pos number := 1;
    begin
    -- Get xml document from transient 9iAs data store.
    select blob_content
    into v_raw
    from spg_file_import
    where name = p_file_in;
    -- create temp LOB
    dbms_lob.createtemporary(v_clob, false);
    -- get BLOB length
    v_blob_length := dbms_lob.getlength(v_raw);
    loop
    -- get length to read. this is set as a max length of 32767
    v_length := least((v_blob_length - (v_pos-1)),32767);
    -- assign BLOB to a varchar2 buffer in preparation to convert to CLOB
    v_buffer := utl_raw.cast_to_varchar2(dbms_lob.substr(v_raw, v_length, v_pos));
    -- now write out to the CLOB
    dbms_lob.writeappend(v_clob, v_length, v_buffer);
    -- increment our position.
    v_pos := v_pos + v_length;
    -- exit when we are done.
    exit when v_pos >= v_blob_length;
    end loop;
    commit;
    htp.p('commit done!');
    end;
    now if i upload a small text file (about 5kb) it works with no problem.
    however if I upload a large text file (say about 1Mb) it crashes oracle with:
    Fri, 26 Jul 2002 11:49:24 GMT
    ORA-03113: end-of-file on communication channel
    DAD name: spgd1
    PROCEDURE : daz_fu
    USER : spg
    URL : http://www.bracknell.bt.co.uk/pls/spgd1/daz_fu
    PARAMETERS :
    ============
    p_file_in:
    F22210/Document.txt
    this produces a large trc file.. the trace file indicates the crash occured on the commit; line
    Current RBA:[0x4eb0.117.10]
    *** 2002-07-26 12:35:11.857
    ksedmp: internal or fatal error
    ORA-00600: internal error code, arguments: [kcblibr_user_found], [4294967295], [2], [12583564], [65], [], [], []
    Current SQL statement for this session:
    declare
    rc__ number;
    begin
    owa.init_cgi_env(:n__,:nm__,:v__);
    htp.HTBUF_LEN := 255;
    null;
    daz_fu(p_ref_in=>:p_ref_in,p_type_in=>:p_type_in,p_file_in=>:p_file_in);
    if (wpg_docload.is_file_download) then
    rc__ := 1;
    wpg_docload.get_download_file(:doc_info);
    null;
    commit;
    else
    rc__ := 0; null;
    commit;
    owa.get_page(:data__,:ndata__);
    end if;
    :rc__ := rc__;
    end;
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    812b1998 42 procedure SPG.DAZ_FU
    819dff90 7 anonymous block
    ----- Call Stack Trace -----
    If i reaplce the temporary table with a non-temp table of the same structure i get no problems what-so-ever. Am I doing something that I shouldnt be with global temporary tables?
    Thanks.

    This is on Oracle 8.1.7.2

  • How to reduce time when updating table with join of anther table

    Hi all,
    I am update table Policy1 using another table from other scheme
    Policy1 is in schema "TEST".
    TRN_POLICY_RISK_GIS is in Schema "TEST2".
    Now i am executing my query which is taking lot of time to update and make cpu utilization upto 45%.
    update policy1 set total_si = (select total_is from (select pol_sys_id,
    avg(nvl(pol_cvr_si,0)) total_si from TEST2.TRN_POLICY_COVER_GIS tpcg
    group by pol_sys_id ) b where p.pol_sys_id = b.pol_sys_id)
    Help to optimize to given query.

    update policy1    A
        set total_si =
           (select avg(nvl(pol_cvr_si,0))
               from TEST2.TRN_POLICY_COVER_GIS    B
              where B.pol_sys_id = A.pol_sys_id
    ;hopefully there is an index on TEST2.TRN_POLICY_COVER_GIS (POL_SYS_ID)

  • Drop a table with triggers

    Dear All,
    I have a script which creates tables and triggers and drop the tables.
    I want to know if the triggers are dropped automatically when we drop the tables and when we create the tables what is the name of the tablespace that they are created in ?
    thank you in advance for your reply

    Triggers are dropped automatically when you drop the associated table.
    SQL> create table a (id number);
    Table created.
    SQL> create trigger trga before insert on a for each row
      2  begin
      3  null;
      4  end;
      5  /
    Trigger created.
    SQL> select trigger_name from user_triggers where table_name = 'A';
    TRIGGER_NAME
    TRGA
    SQL> drop table a;
    Table dropped.
    SQL> select trigger_name from user_triggers where table_name = 'A';
    no rows selected

  • Updating table with seq

    Hi,
    Need some help..........Theres this history table with composite primary key having a record version number which is incremented everytime theres a modification on its parent table and records are inserted for the same instrument id. (one id = multiple version record number) and these two forms the composite key.......now we have to drop this key, add new column, which will be populated using a sequence....this sequence should be mapped to the instrument id so that there is no data modification for the existing data; later a primary key be applied to this new column with seq numbers. Please help.........
    Thanks in adv.....

    What is the problem in question?
    null

  • 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

Maybe you are looking for

  • How do I change to a new Apple ID on iPhone4 (need to keep old ID usable aswell)

    How do I change my Apple iPhone4 - Apple ID from the ID it is set up with, to a new one.  I need to keep the current Apple ID as it is used by another family member on their iPhone.  At present both phones are using the same Apple ID.....

  • Kernel 3.0.4-1 with sky2 ethernet driver - VLAN problem

    Hello, after installing kernel 3.0.x (any) VLANs stopped working on sky2 driver. Althoug I can add VLAN to interface, i can't ping anything. Tcpdump does not register any traffic on tagged interface.Of course normal (untagged) traffic works without a

  • Where should I change the adapter? It doesn't work from the start.

    where should I change the adapter? It doesn't work from the start. But there is no apple store in our city.

  • How to handlle multiple ear and common database.

    Hi Friends, Need urgent help. I working on a project where there will be multiple ear ,each for one application. There are 4 project and 4 ears and one common util war file which will be shared by all ears. Problem is : 3 of the projects will use sam

  • Font importing issue.

    I've been asked by client to use 'Segoe' font in a project which they emailed me first as a file and then zipped. However, whenever I import it into Font Book it doesn't appear. Can anyone help? Or suggest a pre-installed font in FCP that is similar?