Fail to Update Data

I have no idea what is wrong with this code.. Can someone please try to debug this code..
This is the javabean method declaration
public void updatePersonalInfo(String FirstName, String LastName, int Age, String Gender, String Address, String City, String State, int ZipCode, String Country, int PhoneNumber, String PhoneType, String Occupation, String pk) throws SQLException, Exception
if(con!=null)
try
PreparedStatement updatepersonal;
String s = "Update PersonalInfo set FirstName = ?, LastName = ?, Age = ?, Gender = ?, Address = ?, City = ?, State = ?, ZipCode = ?, Country = ?, PhoneNumber = ?, PhoneType = ?, Occupation = ? WHERE pk = ?";
updatepersonal = con.prepareStatement(s);
updatepersonal.setString(1,FirstName);
updatepersonal.setString(2,LastName);
updatepersonal.setInt(3,Age);
updatepersonal.setString(4,Gender);
updatepersonal.setString(5,Address);
updatepersonal.setString(6,City);
updatepersonal.setString(7,State);
updatepersonal.setInt(8,ZipCode);
updatepersonal.setString(9,Country);
updatepersonal.setInt(10,PhoneNumber);
updatepersonal.setString(11,PhoneType);
updatepersonal.setString(12,Occupation);
updatepersonal.setString(13,pk);
updatepersonal.executeUpdate();
catch(SQLException sqle)
error = "SQLException: Fail to Update Data";
throw new SQLException(error);
else
error = "Exception: Connection to database was lost.";
throw new Exception(error);
And this is the .jsp file
ad.connect();
ad.updatePersonalInfo(FirstName, LastName, age, Gender, Address, City, State, zipcode, Country, phonenumber, PhoneType, Occupation, s);
ad.disconnect();
I really have no idea what is wrong with this code..
Everytime i try to run this file, it gives an error that says "Fail to Update Data"..

type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: SQLException: Fail to Update Data
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
     at java.lang.Thread.run(Thread.java:536)
root cause
javax.servlet.ServletException: SQLException: Fail to Update Data
     at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:497)
     at org.apache.jsp.update_jsp._jspService(update_jsp.java:103)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
     at java.lang.Thread.run(Thread.java:536)
this is what the program says

Similar Messages

  • Fails to update data during view object test

    Hi, I'm using:
    Postgresql w/JDBC drivers
    Jdeveloper 10g
    I created entities and associations for my tables, and now I created a view object, assigned it to application module and run it.
    It shows the data properly, but when I try to commit a change, it gives me:
    Business Component Browser - oracle.jbo.DMLException
    (oracle.jbo.DMLException) JBO-26041: Failed to post data to database during "Update": SQL Statement "UPDATE PUBLIC.SIGNON Signon SET username=? WHERE username=?".
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) ERROR: parser: parse error at or near "Signon" at character 22
    Any idea what I'm doing wrong?

    You're hitting Bug# 3537056. Contact worldwide support and they have a one-off patch for this that they can supply for you. The issue is related to lack of support in your database for a table alias in the update statement.

  • Master Data loading got failed: error "Update mode R is not supported by th

    Hello Experts,
    I use to load master data for 0Customer_Attr though daily process chain, it was running successfully.
    For last 2 days master data loading for 0Customer_Attr got failed and it gives following error message:
    "Update mode R is not supported by the extraction API"
    Can anyone tell me what is that error for? how to resolve this issue?
    Regards,
    Nirav

    Hi
    Update mode R error will come in the below case
    You are running a delta (for master data) which afils due to some error. to resolve that error, you make the load red and try to repeat the load.
    This time the load will fail with update mode R.
    As repeat delta is not supported.
    So, now, the only thing you can do is to reinit the delta(as told in above posts) and then you can proceed. The earlier problem has nothing to do with update mode R.
    example your fiorst delta failed with replication issue.
    only replicating and repeaing will not solve the update mode R.
    you will have to do both replication of the data source and re-int for the update mode R.
    One more thing I would like to add is.
    If the the delat which failed with error the first time(not update mode R), then
    you have to do init with data transfer
    if it failed without picking any records,
    then do init without data transfer.
    Hope this helps
    Regards
    Shilpa
    Edited by: Shilpa Vinayak on Oct 14, 2008 12:48 PM

  • Ihave an iphone 5.  Everytime i click on my hotmail icon is says...cannot get mail.  The connection to the server failed.  i hit ok and then it downloads my messages.  Also at the bottom the updated date is saying that it is june 4 not june 9th

    I have an iphone 5.  Everytime i click on my hotmail icon is says...cannot get mail.  The connection to the server failed.   I have to hit ok a couple of times and then it downloads my messages.  Also at the bottom the updated date is saying that it is june 4 not june 9th

    i would suggest deleting and readding the mail account in settings > mail contacts calendars

  • Update data with CachedRowSet failed ! Help....

    I can select data from Oracle DBMS with CachedRowSet,However I can't update data with it.
    the Exception is :Cannot determine the table name
    Can anyone help me out with the
    above problem?
    my email is: [email protected]
    my codes are:
    Connection con = ds.getConnection();
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM T_XML_TEST");
    CachedRowSet crset = new CachedRowSet();
    crset.populate(rs);
    rs.close();
    stmt.close();
    System.out.println("name");
    while (crset.next()){
    System.out.println(crset.getString("name"));     
    try{
    crset.previous(); // or crset.absolute(4);
    crset.updateString("name","changed");
    crset.updateInt("layer",55);
    crset.updateRow();
    crset.moveToCurrentRow();
    crset.acceptChanges(con);
    catch(Exception e)
    System.out.println("update failed:"+e.getMessage());
    e.printStackTrace();     
    }

    Hey,
    Would you please let me know which JDBC driver you are using?
    Thanks!
    ~Ji

  • EDT Cat. 15 Data loaded to SAP but failed when updating

    Hi,
    I have an structure to load data into BP using KCLJ with Cat 15.
    Here it is.
    AKTYP
    TYPE
    PARTNER
    ROLE1
    KUNNR
    KUNNR_EXT
    BU_GROUP
    FIBUKRS
    CHIND_ADDR
    NAME_CO
    NAME_ORG1
    NAME_ORG2
    STREET
    STR_SUPPL1
    STR_SUPPL2
    STR_SUPPL3
    LOCATION
    HOUSE_NUM1
    POST_CODE1
    CITY1
    COUNTRY
    REGION
    LANGU
    CHIND_TEL
    TEL_NUMBER
    TEL_EXTENS
    We had the data loaded to SAP with ROLE 000000 and TR0100 but somehow when we tried to update the address thru ROLE TR0100, we had a dump and failed to update. However, the update is good when we use ROLE 000000 to update.
    Anyone would have a clue of this?
    Thanks

    I am new to EDT also. I know Cat 15 which can load BP. SAP has more categories which can load more using KCLJ. Here's my experience.
    Under Tcode SIMGH, find IMG structure External Data Transfer for SAP Banking. Under that structure, you can find Display Required and Optional Entry Fields for SEM Banking. When you enter 15 in the Category box, you'll see a whole list of fields about BP. You can use these fields to create your own structure.
    After you created your structure, use Define Sender Structure under External Data Transfer for SAP Banking to define your structure. After that, it is done. You can try use KCLJ to load your BP.
    If you still have other issues, mostly will be the configuration.
    Enjoy.

  • "Failed to update binary data in the database".

    Hi,
    we will get this message ("Failed to update binary data in the database".) when one of our customers want to install our add-on in one specific server.
    they got a copy of their database and put in another computer and could install add-on. but they can not install add-on on their main server.
    please advice me.

    Hi Senthil,
    Thanks for your consideration,
    They checked and they don’t have any record in SARI table related to R1. they have one record for XLR only.
    This problem is only on one specific server.
    Do you have any other idea? Please help us.
    Regards,
    Neda

  • Failed to post data to database during "Update": SQL Statement

    Hi,
    I'm getting this error while trying to update a VO via BCBrowser or UI.
    Failed to post data to database during "Update": SQL Statement
    This is a simple & straight forward default VO created on Entity Object (Database Table)
    On the same table & with same DB credentials, I could successfully update the record.
    Any Guess, on what went Wrong??
    Thanks in Advance for any help.
    p.s Jdev 11.1.1.6
    Log:
    oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Update": SQL Statement "BEGIN UPDATE CAR CarEO SET SEL_ITEM=:1 WHERE TXN_NO=:2 AND LOGID=:3 AND SEQNO=:4 RETURNING DELIVERY_MODE, CERTIFICATION_REQ, SOFT_COPY_IND, SELITEM INTO :5, :6, :7, :8; END;".
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:583)
      at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8575)
      at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6816)
      at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3290)
      at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3093)
      at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2097)
      at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2378)
      at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1615)
      at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1417)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1437)
      at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2150)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
      at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
      at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
      at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:111)
      at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.Component.processMouseEvent(Component.java:6289)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6054)
      at java.awt.Container.processEvent(Container.java:2041)
      at java.awt.Component.dispatchEventImpl(Component.java:4652)
      at java.awt.Container.dispatchEventImpl(Container.java:2099)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
      at java.awt.Container.dispatchEventImpl(Container.java:2085)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
      at java.awt.EventQueue.access$000(EventQueue.java:85)
      at java.awt.EventQueue$1.run(EventQueue.java:603)
      at java.awt.EventQueue$1.run(EventQueue.java:601)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
      at java.awt.EventQueue$2.run(EventQueue.java:617)
      at java.awt.EventQueue$2.run(EventQueue.java:615)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.sql.SQLException: Invalid column type
      at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:150)
      at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:399)
      at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:581)
      at oracle.jdbc.driver.OracleCallableStatementWrapper.registerOutParameter(OracleCallableStatementWrapper.java:1765)
      at oracle.jbo.server.OracleSQLBuilderImpl.bindUpdateStatement(OracleSQLBuilderImpl.java:2243)
      at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:10524)
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:412)
      ... 52 more

    The issue is resolved now.
    new Columns added to the Database table, after creating Entity Object. These latest changes were not picked up in Entity Object.
    I found this difference after comparison of entity object with DB Table.
    And when I added those new columns to EO & VO, I'm not getting this error anymore.
    Thanks to all who tried to help

  • JBO-26041: Failed to post data to database during "Update":

    Hi,
    When Iam trying to update data to database Using View object this error comes .Please help me....
    Thanks....

    No info mean no help....
    There must be an underlying error or at least a full stack trace.
    What did you try to do?
    Which JDev version and which technology you are using?
    Timo

  • Cannot update data in a demantra worksheet..

    Hello all,
    I am not able to update data in a demantra worksheet - referred to Oracle Metalink
    https://metalink.oracle.com/CSP/ui/flash.html#tab=KBHome(page=KBHome&id=()),(page=KBNavigator&id=(bmDocID=459527.1&bmDocType=PROBLEM&viewingMode=1143&bmDocDsrc=KB&bmDocTitle=Worksheet%20Data%20is%20Not%20Being%20Saved%20to%20the%20Database%20-%20Error%20:%20Update%20Data%20Failed,%20Can't%20Create%20%3Cb%3EW...&from=BOOKMARK))
    DocId= 459527.1
    I have the same error message and I followed the steps exactly but I cannot seem to get rid of the error
    Cannot create Wf process. Update Data id: ....
    I have the components correctly defined, display units seems ok. Not sure why the Update Data is failing somewhere??
    Cheers

    Hey there!
    Make sure you restart web server (tomcat) after any changes you make in the business modeler, and before checking the worksheets. Make sure component has units associated, and series associated too.
    Hope this helps,
    Aaron

  • Update data from a view

    Hi,
    trying to update data from a view with:
    - Company (table)
    - Products (table)
    In a form, the user wants to update
    e.g: both products.product_name and Company.company_name.
    Is there a way to update a view records built on 2 tables ?
    Any idea will be really appreciated
    Thks

    An other question on INSTEAD OF Trigger:
    Base Tables:
    1.
    SQL> desc pcs_companies;
    Name Null? Type
    COMPANY_ID NOT NULL NUMBER(12)
    COUNTRY VARCHAR2(350)
    COMPANY_NAME VARCHAR2(320)
    COMPANY_PHONE VARCHAR2 (320)
    COMPANY_FAX VARCHAR2(320)
    COMPANY_URL VARCHAR2(150)
    UPDATED_DATE DATE
    2.
    SQL> desc pcs_individuals;
    Name Null? Type
    INDIVIDUAL_ID NOT NULL NUMBER(12)
    COMPANY_ID NUMBER(12)
    FIRST_NAME VARCHAR2(320)
    LAST_NAME VARCHAR2(320)
    LOB VARCHAR2(300)
    JOB_ROLE VARCHAR2(300)
    TITLE VARCHAR2(300)
    GENDER VARCHAR2(3)
    EMAIL VARCHAR2(720)
    FAX VARCHAR2(720)
    PHONE_NO VARCHAR2(720)
    UPDATED_DATE DATE
    COUNTRY VARCHAR2(150)
    ADDRESS_1 VARCHAR2(720)
    ADDRESS_2 VARCHAR2(720)
    ADDRESS_3 VARCHAR2(720)
    CITY VARCHAR2(720)
    3. pcs_individuals.COMPANY_ID = FK, ref pcs_companies.
    4.
    SQL> CREATE VIEW V_PCS_COMPANY_IND
    AS
    SELECT
       i.INDIVIDUAL_ID,
       c.company_id,
       c.country,
       c.Company_name,
       c.company_phone,
       i.Company_id indiv_company_id,
       i.gender,
       i.first_name,
       i.last_name,
       i.lob,
       i.job_role,
       i.title,
       i.email_address,
       i.fax,
       i.phone_no ,
       i.address_1,
       i.address_2,
       i.address_3,
       i.city
    FROM
      pcs_individuals i,
      pcs_companies c
    WHERE
      i.company_id = c.company_id
    5.
    CREATE OR REPLACE TRIGGER PCS_ADMIN.PCS_COMP_IND_UPDATE_TR
    INSTEAD OF UPDATE ON PCMS_ADMIN.V_PCS_COMPANY_IND
    FOR EACH ROW
    begin
    update PCS_COMPANIES
    set
         Company_name = nvl(:new.company_name,company_name),
         company_phone = nvl(:new.company_phone,company_phone)
    where company_id = :new.company_id;
    update PCS_INDIVIDUALS
    set
         gender = nvl(:new.gender,gender),
    first_name = nvl(:new.first_name,first_name),
         last_name = nvl(:new.last_name,last_name),
         lob = nvl(:new.lob,lob),
         title = nvl(:new.title,title),
         email_address = nvl(:new.email_address,email_address),
    phone_no = nvl(:new.phone_no,phone_no),
         fax = nvl(:new.fax,fax),
         country = nvl(:new.country,country),
         address_1 = nvl(:new.address_1,address_1),
         address_2 = nvl(:new.address_2,address_2),
         address_3 = nvl(:new.address_3,address_3),
         city = nvl(:new.city,city)
    where company_id = :new.company_id;
    end PCMS_COMP_IND_UPDATE_TR;
    6.
    CREATE OR REPLACE TRIGGER PCS_ADMIN.NEW_COMPANY_ID_INSERT
    INSTEAD OF INSERT ON PCS_ADMIN.V_PCS_COMPANY_IND
    DECLARE
    ID number;
    BEGIN
    INSERT INTO pcs_companies (org_id)
    select v_pcs_comp_id_seq.nextval
    into ID
    from dual;
    :new.company_id = ID;
    INSERT INTO pcs_individuals (company_id)
    select v_pcs_comp_id_seq.nextval
    into ID
    from dual;
    :new.company_id = ID;
    end;
    My question
    On point 6:
    Assumption:
    - Company_id is PK of pcs.Company and FK in pcs.individuals
    - It should be feed by sequence (v_pcs_comp_id_seq)
    Now how can i insert the same value for company_id (current.v_pcs_comp_id_seq) in both pcs_companies and pcs_individuals ? I've tested it in the above INSTEAD OF Trigger.It failed.
    Thks for any advice,
    lamine

  • Cannot update data from DSO to Cube with further update in process chain

    Hi Guys,
                  This is the message am getting when am trying to update to cube by process further update with process chain.Process fails at further update with the following below message.
    However at DSO level i can see the data mart status but no request at cube level.
    Error Message:
    Cannot update request REQU_D57WAP7Z2WAI1CG5Y5OQ5W7JR in data target
        Message no. RSM1523
    Diagnosis
        System checks show that request REQU_D57WAP7Z2WAI1CG5Y5OQ5W7JR cannot be
        updated to a data target.
        The system checked whether
        o   request REQU_D57WAP7Z2WAI1CG5Y5OQ5W7JR is already in the data target
        o   the data target has active update rules for the InfoSource
        o   the data target was selected for updating
        o   locks exist
        o   for a DataStore object as a data target, that the request was
            updated in the correct order, if the DataStore object stipulates
    When i check the monitor screen under status tab it says "A caller 01, 02 or equal to or greater than 20 contains an error meesage" and under details tab "Data Package 1 : arrived in BW ; Processing : Data packet not yet processed "
    Regards,
    Krishna.
    Edited by: krishna Krishna on Mar 4, 2009 6:37 PM

    Hi
    It seems you used infopack when you select update data inot datatarget then system prompts you a infopack.That's the infopack which is generated by system being used in process chain variant to update data into datatarget.
    Create new infopack/ DTP manually then use that infoapck/DTP on the process chain variant then try.
    Chandu.

  • How to update date in a table from another database

    Hello,
    I am trying to code a way to Update my Testing database from another database. In the coding below the database that has the updated data ends in Restore.
    Use ClientDB_MASTER_Restore
    Truncate Table ClientDB_MASTER_Testing.dbo.Activity_Tracking_AZ
    GO
    SELECT * INTO ClientDB_Master_Testing.dbo.Activity_Tracking_AZ
    FROM Activity_Tracking_AZ
    Go
    I know with this Technique the table must be truncated if not deleted first.  There is probably a better way to do this which I'm very open to.  I'm also looking for coding that will roll back any changes made should an error occur.
      As always, any help is greatly appreciated.
    David92595

    USE ClientDB_MASTER_Testing
    go
    SET XACT_ABORT ON
    BEGIN TRANSACTION
    Truncate Table dbo.Activity_Tracking_AZ
    -- SET IDENTITY_INSERT dbo.Activity_Tracking_AZ ON
    INSERT dbo.Activity_Tracking_AZ (col1, col2, ...)
    SELECT col1, col2,
    FROM ClientDB_MASTER_Restore.dbo.Activity_Tracking_AZ
    -- SET IDENTITY_INSERT dbo.Activity_Tracking_AZ OFF
    COMMIT TRANSACTION
    If you find it boring to type the column lists, just find the table in Object Explorer, and drag the columns node to where you want the column list.
    You need the SET IDENTITY_INSERT command if the table has an IDENTITY column.
    By wrapping the code in a transaction, you are not left with an empty table if the INSERT fails. The command SET XACT_ABORT ON makes sure that the batch is aborted and rolled back in case of an error.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can I update data fields in a merged document ?

    Hi,
    I'm looking for a way to update the values of data fields in a merged document with a script just as you can do with the user interface.
    I don't find any method like "updateDataFields ()" in the DataMerge object.
    Si I try to invoke the menu action "Update Data Fields", but it fails. The script error message is: "Error 53762, the script is not active." On the contrary, the action works if I use the interface.
    Can anyone help me?
    Thanks in advance,
    FredIsnard
    PS : I work with CS5.5 and JavaScript.

    Hi!
    You might be looking for this one:
    DataMerge.mergeRecords (outputOversetReportFile: File )
    Merges records and produces an optional overset report.
    outputOversetReportFile: Data Type: File
    The path to the file in which to store the overset report. (Optional)
    Best regards,
    Andreas

  • Inserting/updating data in control block based on view

    Hi!
    I`ve created a block based on a view to display data.
    I want this block to be insertable and updateable, that is I will use a on-insert/update trigger to call an insert/update procedure located in the database.
    When trying to change/insert a value in the block, the error message "Error: Can not insert into or update data in a view" pops up. I`ve tried to get rid of this error, without success.
    How can I make a data block based on a view insertable and updateable?
    My guess is that this have something to do with locking the records(there is no rowid in the view)... but I'm not sure.
    Pls advise!!

    Morten
    As well as on-update, on-insert, on-delete triggers you also need an on-lock,
    (even though it might just contain null;) otherwise the form will try to lock the view and fail.
    Actually your terminology is wrong, the block being based on a table or view is not a control block. A control block is not based on anything and has no default functionality for communicating with the database. If it was a control block, the on- triggers would not fire.

Maybe you are looking for

  • How to connect 3g iphone Passive Antenna Adapter to phone?

    Having a hard time to finding solution to this question. I'm finding that there are antenna adapters for the iphone. However, I'm having a hard time finding articles, pictures, or video on how to use them. So can any one help me out? My goal is to in

  • Is a certain MAC recognizable by unwanted cookies, regardless of IP?

    Hi folks, I have been searching the web but I can´t seem to find a definitive answer to this quick question: If I visit a certain website (say a forum, like this) they most certainly log the I.P etc. But I hear all kind of horror stories that certain

  • What are the Best Practices for Optimizing Images in InDesign Files

    Is there a best practice for using images InDesign to optimize the document before converting to a PDF? Specifically, what I'm asking is, will the PDF file compress better if the images are cropped prior to placing them in Indesign? I'd like to know

  • Burn failures in iDVD

    I'm getting a very high rate of burn failures with iDVD. When I create a DVD the program rattles thru its various tasks but when it comes to 'burning' the drive keeps revving up but fails to 'get going' - after about half a dozen attempts the disc ej

  • I cannot open any video's or download a magazine or run a loop on a weather site.

    I am running Vista service pack 2. Have upgraded flash Player to 11.1.102.55 Have Java version 6 update 29. I can open videos that come in Windows video player. You tubes are dead in the water as a black screen. This web site sits dead in the water h