Problem in Updating records...

Hi all,
I want to understand how exactly do we update the records in oaf?
In my case,
I am fetching one row from EO into VO using setwhereclause, where value of parameter to whereclause depend on the value selected from a dropdown menu on the page.
Columns of this VO are mapped to messageTexInput fields on the page.
When page renders for the first time, a default row is fetched in VO. I can successfully update the data for this row. (I change data of any of the field on page and click Apply button which triggers getTransaction().commit)
When I change dropdown choice, VO gets a new row based on this dropdown choice (I have used PPR here).
I try to update data now, but irrespective of the row fetched in VO, for which data is displayed on page, the row whose data is displayed when the page renders for the first time gets updated.
Can you please help me on this...
Can you give me the working code snnipet for update which I can refer...
Thanks,
Harsh

Hi
Here is the code snippet for update:
public void UpdateRecords(OAPageContext pageContext, OAWebBean webBean,String id,String client)
String where="Id="+id;
EOVOImpl thvo=getEOVO1();
VOImpl mpvo = getVO1();
if ((OAMessageLovInputBean)webBean.findChildRecursive("Client")!=null)
OAMessageLovInputBean Clientbean=(OAMessageLovInputBean)webBean.findChildRecursive("Client");
Clientbean.setValue(pageContext,client);
try {
thvo.setWhereClauseParams(null);
thvo.setWhereClause(where);
thvo.executeQuery();
int r = thvo.getRowCount();
r = mpvo.getRowCount();
catch (Exception e)
Debug.log(pageContext," Exception","Error "+e.getMessage(),1);
else
Debug.log(pageContext,"Client Bean","Client bean is null ",1);
Regards
Meher Irk
Edited by: Meher Irk on Dec 2, 2010 6:12 PM

Similar Messages

  • Problems with Update Record behavior

    I am sorry to ask this question again since I have not resolved the issue yet.
    When I am using the Dreamweaver Update Record behavior,  I am not able to get the form validation to work.  I implemented the form validation by inserting  onsubmit="return someFormValidation(this);" into the update form created by Dreamweaver.
    When I hit the submit button the JavaScript validation function is not even invoked.
    However when I use the same method for form validation with Insert Record behavior I have no problems.  Is this difference I am observing between the Insert and Update behaviors the way Dreamweaver supposed to work?  If yes how can I do my form validation during an Update Record?
    Note that the pages involved are all php pages, therefore we are talking about server side validation here.
    If anyone can help I will be grateful as I am really stuck...

    I am closing this even though I got no answers as the weird behaviour has disappeared....

  • Problem with update record, then link to file

    Environment:
    Dreamweaver 8, MySQL, PHP.
    I have a repeating record from my database. I added an Update
    Record server behavior for each search result for the result table.
    I added a button to the form and changed "submit" to "view".
    Pressing "view" is supposed to allow the user to view the detailed
    record information.
    The Update Record server behavior is supposed to do two
    things:
    1) add 1 to the 'numViews' filed of the record's database
    entry when the "view" button is pressed
    2) After updating the numViews field, the form is supposed to
    redirect the user to the detailed record
    I found that depending on how I create the record, I an do
    one of the above 2 behaviors, but not both. HELP!
    To add 1 to the numViews field, I created a form variable
    called incNumViews, which does the following:
    <?php echo $row_rsSearchResults['recipeNumViews']+1; ?>
    Very simple.
    The Update Record ends up changing the form action to the
    following:
    <?php echo $editFormAction; ?>
    Looking at the code for this, I ee the following:
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" .
    htmlentities($_SERVER['QUERY_STRING']);
    But when the "view" (ie: submit" button for the form is
    pressed, I get redirected back to the same repeating record search
    result page, not to the record detail page.
    However, the numViews field in the record is getting properly
    incremented.
    I tried to get around this by changing the Update Record
    behavior "After updating, go to:" field to point to the record
    detail page, and tried passing a parameter tot he recordID I want
    to see details of, as a URL parameter, but that does not work.
    If I change the Update Record form action from
    <?php echo $editFormAction; ?>
    to
    record_detail.php?recordID=<?php echo
    $row_rsSearchResults['recordID']; ?>
    Then I am able to link to the detail page, but NOT update the
    numViews field.
    HOW can I fix this to both update the record, then jump to
    the detail page with a URL parameter being passed, when I click the
    "view" (submit) button o the form??
    Thanks in advance.

    If the user's computer doesn't know what to do with a TIFF file, I guess that Open button would be missing.  Tiff is not a web normal file format, or even a common one for graphics applications....

  • Problem while updating record in WLS 6.1 sp4

    We have been using toplink in our application with Weblogic 6.1. We have not faced any problems after migrating to TopLink oracle release 9.0.3 while deploying on WLS 6.1 sp1 or sp2. However when we deploy on WLS 6.1 sp4, we get a 'invalid column name' exception when trying to update a record. The search query does not throw any exception, only the update query is throwing exception. We use external transaction controller. the stack trace is below -
    2002-11-27 11:56:25,763 ERROR com.pws.ubiquity.pr.business.TransactionTypeFacade - Error while commiting transaction (creating TransactionType):LOCAL EXCEPTION STACK:
    EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904
         at oracle.toplink.exceptions.DatabaseException.sqlException(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.insertObject(Unknown Source)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown Source)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(Unknown Source)
         at oracle.toplink.jts.AbstractSynchronizationListener.beforeCompletion(Unknown Source)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:982)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1506)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:215)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    INTERNAL EXCEPTION STACK:
    java.sql.SQLException: ORA-00904: invalid column name
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at weblogic.jdbc.jts.Statement.executeUpdate(Statement.java:503)
         at weblogic.jdbc.rmi.internal.PreparedStatementImpl.executeUpdate(PreparedStatementImpl.java:66)
         at weblogic.jdbc.rmi.SerialPreparedStatement.executeUpdate(SerialPreparedStatement.java:57)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeNoSelect(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(Unknown Source)
         at oracle.toplink.internal.queryframework.CallQueryMechanism.insertObject(Unknown Source)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.insertObject(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown Source)
         at oracle.toplink.queryframework.InsertObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedWrite(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.performUserDefinedInsert(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.insertObjectForWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.executeCommit(Unknown Source)
         at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.executeWrite(Unknown Source)
         at oracle.toplink.queryframework.WriteObjectQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.internal.sessions.CommitManager.commitAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.Session.writeAllObjects(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.commitToDatabase(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.issueSQLbeforeCompletion(Unknown Source)
         at oracle.toplink.jts.AbstractSynchronizationListener.beforeCompletion(Unknown Source)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:551)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:88)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:982)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1506)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:215)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    --------------- nested within: ------------------
    weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=oracle.toplink.jts.wls.WebLogicSynchronizationListener@373d4a
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904 - with nested exception:
    [EXCEPTION [TOPLINK-4002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.DatabaseException
    EXCEPTION DESCRIPTION: java.sql.SQLException: ORA-00904: invalid column name
    INTERNAL EXCEPTION: java.sql.SQLException: ORA-00904: invalid column name
    ERROR CODE: 904]
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1490)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:265)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
         at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:247)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:584)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    2002-11-27 11:56:25,793 DEBUG com.pws.framework.common.MessageSourceFactory - Get MessageSource for error message.:
    2002-11-27 11:56:25,793 DEBUG com.pws.framework.common.MessageSourceFactory - Get MessageSource for error message.:
    com.pws.framework.exception.GeneralException: There was an unexpected error. Please contact your system administrator.
         at com.pws.framework.exception.GeneralException.create(GeneralException.java:111)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade.addTransactionType(TransactionTypeFacade.java:588)
         at com.pws.ubiquity.pr.business.TransactionTypeFacade_ocr0a6_EOImpl.addTransactionType(TransactionTypeFacade_ocr0a6_EOImpl.java:271)
         at com.pws.ubiquity.pr.web.action.AddTransactionTypeAction.doExecute(AddTransactionTypeAction.java:120)
         at com.pws.ubiquity.common.web.action.SecureAction.perform(SecureAction.java:240)
         at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:262)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:198)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2637)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2359)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    The SQL statement generated by TopLink is as follows -
    UPDATE PR_SUPP SET CNTC_PRSN_NAME = ''
    , REMK = 'Remark 123 !', LAST_CHNG_DTTM = {ts '2002-11-29 10:59:56.0'} WHERE ((S
    UPP_CODE = 'A0001') AND (LAST_CHNG_DTTM = {ts '2002-11-29 10:46:01.0'}))
    The coloumn name in the generated statement conform to the coloumn names in the table. The exception is being thrown for all 'update' queries for all objects in the application.

  • Problem while updating record in the database

    I have created an entity object, view object and a form to show that. whenever i update some field in the form and try to commit the change, exception is thrown stating that-
    (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for Countries
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) [DataDirect][SQLServer JDBC Driver][SQLServer]FOR UPDATE cannot be specified on a READ ONLY cursor.

    I'm getting the same problem. Did you manage to fix this?

  • Problem with updating records in database

    Hello everyone,
    I have a question, i have a database and in the database I want to update some records.
    Now, in my database I have refnr, vnr, etc� it is possible that I have 3 the same refnr (example)
    98765A     001     
    98765A     002
    98765B     003
    Now, the program must compare the records between 2 databases and than update al the records flag (example) after comparing
    98765A     001     A
    98765A     002     A
    98765B     003     A
    Now my question is, in the first code 1 example I search all the records and after a IF statement the program send the refnr and the vnr object to updateRecordsFlag(String refnr, String vnr) now In the example above you see I have for example 3 records and these 3 must updated with a A
    Sow, I have made a FOR statement that gets the highest vnr and count to 1 (Teller--), how can I make a FOR statement that send each time an object to updateRecordsFlag(String refnr, String vnr). Now it�s just the highest record that updates.
    I use preparedstatement. For read, etc�
    code 1
    try {
    rowBeheerRefvolgnrs = datasender.readBeheerRefvolgnrs();
    } catch (Exception ex) {
    ex.printStackTrace();
    String refnr = "";
    String vnr = "";
    String code = "";
    int i = 0;
    while (i < rowBeheerRefvolgnrs.length) {
    refnr = rowBeheerRefvolgnrs.substring(0,27);
    vnr = rowBeheerRefvolgnrs[i].substring(27,30);
    code = rowBeheerRefvolgnrs[i].substring(14,15);
    if (code.compareTo("A") == 0) {
         int Teller = Integer.parseInt(vnr);
         updateRecordPersonA(refnr, vnr);
              for (int j = 1; Teller >= j; Teller--) {
              updateRecordsFlag(refnr, vnr);
              vnr = new Integer(Teller).toString();
    if (code.compareTo("B") == 0) {
    //updateRecordPersonB(refnr, vnr);
    i++;
    logger.debug("update end ");
    private void updateRecordsFlag(String refnr, String vnr) {
    Here i have my code to update the flag

    declare @table nvarchar(128)
    declare @idcol nvarchar(128)
    declare @sql nvarchar(max)
    --initialize those two values
    set @table = 'Table_name'
    set @idcol = 'some id to recognize the row'
    set @sql = 'select ' + @idcol +' , (0'
    select @sql = @sql + ' + isnull(datalength(' + name + '), 1)'
    from sys.columns where object_id = object_id(@table)
    set @sql = @sql + ') as rowsize from ' + @table + ' order by rowsize desc'
    PRINT @sql
    exec (@sql)
    You can try this query. Too many varchar columns of big sizes can cause the row size to be bigger than what a row can hold, but its weird that it just went off in retry.
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Problem  for updating records in to data targets

    Murali/sreenivas.
    my processchain is working fine ..but upto Persistent Staging Area data is getting updated perfectly but after that daily i need to run
    DTP manually , to avoid this what sholud i do??? i.e.
    selecting particular info source and then Persistent Staging Area and then selecting particular request in PSA and selecting
    update with scheduler.... by rightcliking on that... and then
    after selecting this and then selecting immediate update...then Persistent Staging Area  data is getting updated in to particular data targets...
    i want to the data to be updated immediately once data is succefully reached Persistent Staging Area
    Edited by: ganandkumar on Sep 13, 2010 7:15 AM
    Edited by: ganandkumar on Sep 13, 2010 7:16 AM

    Hi,
    Are you using BW 3.5 or BI 7.0.
    If you are in BW ,then please in the infopackage make the setting psa and data target in parallel.
    If you are in BI 7.0,then include the step DTP.
    Thanks,
    Saveen Kumar

  • Update Record probem

    Hi,
    I am having problem with UPDATE RECORD in DW/MX2004, I am
    using JSP/Oracle DB.
    I created a search page, result page and update page. When
    the condition found, the result page displayed the result with the
    link to the right record, which opened the record data; however,
    when I made changes and click "Update Record" button, nothing got
    updated in the database.
    Does anyone know what went wrong? Appreciate your help.
    Regards.
    Attached is the update file code.
    // *** Edit Operations: declare variables
    // set the form action variable
    String MM_editAction = request.getRequestURI();
    if (request.getQueryString() != null &&
    request.getQueryString().length() > 0) {
    String queryString = request.getQueryString();
    String tempStr = "";
    for (int i=0; i < queryString.length(); i++) {
    if (queryString.charAt(i) == '<') tempStr = tempStr +
    "&lt;";
    else if (queryString.charAt(i) == '>') tempStr = tempStr
    + "&gt;";
    else if (queryString.charAt(i) == '"') tempStr = tempStr +
    "&quot;";
    else tempStr = tempStr + queryString.charAt(i);
    MM_editAction += "?" + tempStr;
    // connection information
    String MM_editDriver = null, MM_editConnection = null,
    MM_editUserName = null, MM_editPassword = null;
    // redirect information
    String MM_editRedirectUrl = null;
    // query string to execute
    StringBuffer MM_editQuery = null;
    // boolean to abort record edit
    boolean MM_abortEdit = false;
    // table information
    String MM_editTable = null, MM_editColumn = null, MM_recordId
    = null;
    // form field information
    String[] MM_fields = null, MM_columns = null;
    %>
    <%
    // *** Update Record: set variables
    if (request.getParameter("MM_update") != null &&
    request.getParameter("MM_update").toString().equals("fr_update")
    request.getParameter("MM_recordId") != null) {
    MM_editDriver = MM_webtrain_db_DRIVER;
    MM_editConnection = MM_webtrain_db_STRING;
    MM_editUserName = MM_webtrain_db_USERNAME;
    MM_editPassword = MM_webtrain_db_PASSWORD;
    MM_editTable = "WEBTRAIN.COURSE_NAME";
    MM_editColumn = "C_NAME";
    MM_recordId = "'" + request.getParameter("MM_recordId") +
    MM_editRedirectUrl = "search_page.jsp";
    String MM_fieldsStr =
    "C_NAME|value|C_DESC|value|MODULE1|value|MOD1_LOC|value|QUIZ1_NAME|value|QUIZ1_LOC|value" ;
    String MM_columnsStr =
    "C_NAME|',none,''|C_DESC|',none,''|MODULE1|',none,''|MOD1_LOC|',none,''|QUIZ1_NAME|',none ,''|QUIZ1_LOC|',none,''";
    // create the MM_fields and MM_columns arrays
    java.util.StringTokenizer tokens = new
    java.util.StringTokenizer(MM_fieldsStr,"|");
    MM_fields = new String[tokens.countTokens()];
    for (int i=0; tokens.hasMoreTokens(); i++) MM_fields
    = tokens.nextToken();
    tokens = new java.util.StringTokenizer(MM_columnsStr,"|");
    MM_columns = new String[tokens.countTokens()];
    for (int i=0; tokens.hasMoreTokens(); i++) MM_columns =
    tokens.nextToken();
    // set the form values
    for (int i=0; i+1 < MM_fields.length; i+=2) {
    MM_fields[i+1] = ((request.getParameter(MM_fields
    )!=null)?(String)request.getParameter(MM_fields):"");
    // append the query string to the redirect URL
    if (MM_editRedirectUrl.length() != 0 &&
    request.getQueryString() != null) {
    MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') ==
    -1)?"?":"&") + request.getQueryString();
    %>
    <%
    // *** Update Record: construct a sql update statement and
    execute it
    if (request.getParameter("MM_update") != null &&
    request.getParameter("MM_recordId") != null) {
    // create the update sql statement
    MM_editQuery = new StringBuffer("update
    ").append(MM_editTable).append(" set ");
    for (int i=0; i+1 < MM_fields.length; i+=2) {
    String formVal = MM_fields[i+1];
    String elem;
    java.util.StringTokenizer tokens = new
    java.util.StringTokenizer(MM_columns[i+1],",");
    String delim = ((elem = (String)tokens.nextToken()) != null
    && elem.compareTo("none")!=0)?elem:"";
    String altVal = ((elem = (String)tokens.nextToken()) != null
    && elem.compareTo("none")!=0)?elem:"";
    String emptyVal = ((elem = (String)tokens.nextToken()) !=
    null && elem.compareTo("none")!=0)?elem:"";
    if (formVal.length() == 0) {
    formVal = emptyVal;
    } else {
    if (altVal.length() != 0) {
    formVal = altVal;
    } else if (delim.compareTo("'") == 0) { // escape quotes
    StringBuffer escQuotes = new StringBuffer(formVal);
    for (int j=0; j < escQuotes.length(); j++)
    if (escQuotes.charAt(j) == '\'') escQuotes.insert(j++,'\'');
    formVal = "'" + escQuotes + "'";
    } else {
    formVal = delim + formVal + delim;
    MM_editQuery.append((i!=0)?",":"").append(MM_columns
    ).append(" = ").append(formVal);
    MM_editQuery.append(" where
    ").append(MM_editColumn).append(" = ").append(MM_recordId);
    if (!MM_abortEdit) {
    // finish the sql and execute it
    Driver MM_driver =
    (Driver)Class.forName(MM_editDriver).newInstance();
    Connection MM_connection =
    DriverManager.getConnection(MM_editConnection,MM_editUserName,MM_editPassword);
    PreparedStatement MM_editStatement =
    MM_connection.prepareStatement(MM_editQuery.toString());
    MM_editStatement.executeUpdate();
    MM_connection.close();
    // redirect with URL parameters
    if (MM_editRedirectUrl.length() != 0) {
    response.sendRedirect(response.encodeRedirectURL(MM_editRedirectUrl));
    return;
    %>
    <%
    String rs_update__MMColParam = "1";
    if (request.getParameter("C_NAME") !=null)
    {rs_update__MMColParam = (String)request.getParameter("C_NAME");}
    %>
    <%
    Driver Driverrs_update =
    (Driver)Class.forName(MM_webtrain_db_DRIVER).newInstance();
    Connection Connrs_update =
    DriverManager.getConnection(MM_webtrain_db_STRING,MM_webtrain_db_USERNAME,MM_webtrain_db_ PASSWORD);
    PreparedStatement Statementrs_update =
    Connrs_update.prepareStatement("SELECT * FROM WEBTRAIN.COURSE_NAME
    WHERE C_NAME = '" + rs_update__MMColParam + "'");
    ResultSet rs_update = Statementrs_update.executeQuery();
    boolean rs_update_isEmpty = !rs_update.next();
    boolean rs_update_hasData = !rs_update_isEmpty;
    Object rs_update_data;
    int rs_update_numRows = 0;
    %>

    $colname_rs = "-1";
    if (isset($_SESSION['username'])) {
    $colname_rs = $_SESSION['username'];
    $colname2_rs = "-1";
    if (isset($_SESSION['password'])) {
    $colname2_rs = $_SESSION['password'];
    mysql_select_db($database_connDB, $connDB);
    $query_rs = sprintf("SELECT * FROM company WHERE username =
    %s and password = %s LIMIT 1", GetSQLValueString($colname_rs,
    "text"),GetSQLValueString($colname2_rs, "text"));
    $rs = mysql_query($query_rs, $connDB) or die(mysql_error());
    $row_rs = mysql_fetch_assoc($rs);
    $totalRows_rs = mysql_num_rows($rs);
    if ($row_rs['cid'] != "") {
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" .
    htmlentities($_SERVER['QUERY_STRING']);
    $updateSQL = sprintf("UPDATE company SET loggedin=%s WHERE
    cid=%s",
    GetSQLValueString(0, "int"),
    GetSQLValueString($row_rs['cid'], "int"));
    mysql_select_db($database_connDB, $connDB);
    $Result1 = mysql_query($updateSQL, $connDB) or
    die(mysql_error());
    }

  • Mapping problem with compressed key update record

    Hi, could you please advise?
    I'm getting the following problem:
    About a week ago replicat abened with "Error in mapping" error. I found in discard file some record looking like:
    filed1 = NULL
    field2 =
    field3 =
    field4 =
    field5 =
    datefield = -04-09 00:00:00
    field6 =
    field8 =
    field9 = NULL
    field10 =
    Where filed9 = @GETENV("GGHEADER", "COMMITTIMESTAM"), field10 = = @GETENV("GGHEADER", "COMMITTIMESTAM"), others are table fields mapped by USEDEFAULTS
    So I got Mapping problem with compressed key update record at 2012-06-01 15:44
    I guess I need to mention that extract failed in 5 minuts before it with: VAM function VAMRead returned unexpected result: error 600 - VAM Client Report <[CFileInfo::Read] Timeout expired after 10 retries with 1000 ms delay, waiting to read transaction log or backup files. To increase the number of retries, use SETENV (GGS_CacheRetryCount = n) in Extract parameter file. To control retry delay time, use SETENV (GGS_CacheRetryDelay = n). handle: 0000000000000398 ReadFile GetLastError:997 Wait GetLastError:997>.
    I don't know if it has ther same source as data corruption, could you tell me if it is?
    Well, I created new extract, starting 2012-06-01 15:30 to check if there was something with extract at the time, but got the same error.
    If I run extract beging at 15:52 it starts and works.
    But well, I got another one today. Data didn't look that bad, but yet one column came with null value:( And I'm using it as a key column, so I got Mapping problem with compressed key update record again:(
    I'm replicating from SQL Server 2008 to Oracle 11g.
    I'm actually using NOCOMPRESSUPDATES in Extract.
    CDC is enabled for all tables replicated. The only thing is that it is enabled not by ADD TRANDATA command, but by SQL Server sys.sp_cdc_enable_table, does it matter?
    Could you please advise why does it happen?

    Well, the problem begins somewhere in extract or before extract, may be in transaction log, I don't know:(
    Here are extract parameters:
    EXTRACT ETCHECK
    TRANLOGOPTIONS MANAGESECONDARYTRUNCATIONPOINT
    SOURCEDB TEST, USERID **, PASSWORD *****
    exttrail ./dirdat/ec
    NOCOMPRESSUPDATES
    NOCOMPRESSDELETES
    TABLE tst.table1, COLS (field1, field2, field3, field4, field5, field6, field7, field8 );
    TABLE tst.table2, COLS (field1, field2, field3, field4 );
    Data pump:
    EXTRACT DTCHECK
    SOURCEDB TEST, USERID **, PASSWORD *****
    RMTHOST ***, MGRPORT 7809
    RMTTRAIL ./dirdat/dc
    TABLE tst.table1;
    TABLE tst.table2;
    Replicat:
    REPLICAT rtcheck
    USERID tst, PASSWORD ***
    DISCARDFILE ./dirrpt/rtcheck.txt, PURGE
    SOURCEDEFS ./dirdef/sourcei.def
    HANDLECOLLISIONS
    UPDATEDELETES
    MAP tst.table1, t.table1, COLMAP (USEDEFAULTS , filed9 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed10= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (field3);
    MAP dbo.TPROCPERIODCONFIRMSTAV, TARGET R_019_000001.TPROCPERIODCONFIRMSTAV, COLMAP (USEDEFAULTS , field5 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed6= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (filed1, field2, field3);
    Rpt file for replicat:
    Oracle GoldenGate Delivery for Oracle
    Version 11.1.1.1 OGGCORE_11.1.1_PLATFORMS_110421.2040
    Windows x64 (optimized), Oracle 11g on Apr 22 2011 00:34:07
    Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
    Starting at 2012-06-05 12:49:38
    Operating System Version:
    Microsoft Windows Server 2008 R2 , on x64
    Version 6.1 (Build 7601: Service Pack 1)
    Process id: 2264
    Description:
    ** Running with the following parameters **
    REPLICAT rtcheck
    USERID tst, PASSWORD ***
    DISCARDFILE ./dirrpt/rtcheck.txt, PURGE
    SOURCEDEFS ./dirdef/sourcei.def
    HANDLECOLLISIONS
    UPDATEDELETES
    MAP tst.table1, t.table1, COLMAP (USEDEFAULTS , filed9 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed10= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (field3);
    MAP dbo.TPROCPERIODCONFIRMSTAV, TARGET R_019_000001.TPROCPERIODCONFIRMSTAV, COLMAP (USEDEFAULTS , field5 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed6= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (filed1, field2, field3);
    CACHEMGR virtual memory values (may have been adjusted)
    CACHEBUFFERSIZE: 64K
    CACHESIZE: 512M
    CACHEBUFFERSIZE (soft max): 4M
    CACHEPAGEOUTSIZE (normal): 4M
    PROCESS VM AVAIL FROM OS (min): 1G
    CACHESIZEMAX (strict force to disk): 881M
    Database Version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    Database Language and Character Set:
    NLS_LANG = "AMERICAN_AMERICA.CL8MSWIN1251"
    NLS_LANGUAGE = "AMERICAN"
    NLS_TERRITORY = "AMERICA"
    NLS_CHARACTERSET = "CL8MSWIN1251"
    For further information on character set settings, please refer to user manual.
    ** Run Time Messages **
    Opened trail file ./dirdat/dc000000 at 2012-06-05 12:49:39
    2012-06-05 12:58:14 INFO OGG-01020 Processed extract process RESTART_ABEND record at seq 0, rba 925 (aborted 0 records).
    MAP resolved (entry tst.table1):
    MAP tst.table1, t.table1, COLMAP (USEDEFAULTS , filed9 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed10= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (field3);
    2012-06-05 12:58:14 WARNING OGG-00869 No unique key is defined for table table1. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
    Using the following default columns with matching names:
    field1=field1, field2=field2, field3=field3, field4=field4, field5=field5, field6=field6, field7=field7, field8=field8
    Using the following key columns for target table R_019_000001.TCALCULATE: field3.
    2012-06-05 12:58:14 WARNING OGG-01431 Aborted grouped transaction on 'tst.table1', Mapping error.
    2012-06-05 12:58:14 WARNING OGG-01003 Repositioning to rba 987 in seqno 0.
    2012-06-05 12:58:14 WARNING OGG-01151 Error mapping from tst.table1 to tst.table1.
    2012-06-05 12:58:14 WARNING OGG-01003 Repositioning to rba 987 in seqno 0.
    Source Context :
    SourceModule : [er.main]
    SourceID : [er/rep.c]
    SourceFunction : [take_rep_err_action]
    SourceLine : [16064]
    ThreadBacktrace : [8] elements
    : [C:\App\OGG\replicat.exe(ERCALLBACK+0x143034) [0x00000001402192B4]]
    : [C:\App\OGG\replicat.exe(ERCALLBACK+0x11dd44) [0x00000001401F3FC4]]
    : [C:\App\OGG\replicat.exe(<RCALLBACK+0x11dd44) [0x000000014009F102]]
    : [C:\App\OGG\replicat.exe(<RCALLBACK+0x11dd44) [0x00000001400B29CC]]
    : [C:\App\OGG\replicat.exe(<RCALLBACK+0x11dd44) [0x00000001400B8887]]
    : [C:\App\OGG\replicat.exe(releaseCProcessManagerInstance+0x25250) [0x000000014028F200]]
    : [C:\Windows\system32\kernel32.dll(BaseThreadInitThunk+0xd) [0x000000007720652D]]
    : [C:\Windows\SYSTEM32\ntdll.dll(RtlUserThreadStart+0x21) [0x000000007733C521]]
    2012-06-05 12:58:14 ERROR OGG-01296 Error mapping from tst.table1 to tst.table1.
    * ** Run Time Statistics ** *
    Last record for the last committed transaction is the following:
    Trail name : ./dirdat/dc000000
    Hdr-Ind : E (x45) Partition : . (x04)
    UndoFlag : . (x00) BeforeAfter: A (x41)
    RecLength : 249 (x00f9) IO Time : 2012-06-01 15:48:56.285333
    IOType : 115 (x73) OrigNode : 255 (xff)
    TransInd : . (x03) FormatType : R (x52)
    SyskeyLen : 0 (x00) Incomplete : . (x00)
    AuditRBA : 44 AuditPos : 71176199289771
    Continued : N (x00) RecCount : 1 (x01)
    2012-06-01 15:48:56.285333 GGSKeyFieldComp Len 249 RBA 987
    Name: DBO.TCALCULATE
    Reading ./dirdat/dc000000, current RBA 987, 0 records
    Report at 2012-06-05 12:58:14 (activity since 2012-06-05 12:58:14)
    From Table tst.table1 to tst.table1:
    # inserts: 0
    # updates: 0
    # deletes: 0
    # discards: 1
    Last log location read:
    FILE: ./dirdat/dc000000
    SEQNO: 0
    RBA: 987
    TIMESTAMP: 2012-06-01 15:48:56.285333
    EOF: NO
    READERR: 0
    2012-06-05 12:58:14 ERROR OGG-01668 PROCESS ABENDING.
    Discard file:
    Oracle GoldenGate Delivery for Oracle process started, group RTCHECK discard file opened: 2012-06-05 12:49:39
    Key column filed3 (0) is missing from update on table tst.table1
    Missing 1 key columns in update for table tst.table1.
    Current time: 2012-06-05 12:58:14
    Discarded record from action ABEND on error 0
    Aborting transaction on ./dirdat/dc beginning at seqno 0 rba 987
    error at seqno 0 rba 987
    Problem replicating tst.table1 to tst.table1
    Mapping problem with compressed key update record (target format)...
    filed1 = NULL
    field2 =
    field3 =
    field4 =
    field5 =
    datefield = -04-09 00:00:00
    field6 =
    field8 =
    field9 = NULL
    field10 =
    Process Abending : 2012-06-05 12:58:14

  • Mapping problem with compressed key update record (target format)...

    Hi Guys,
    Getting below error while replication from Source to target. Source table is having NOT NULL Column, but on target replicat process giving error about some NULL value ??
    How to overcome this issue, any idea...
    2011-08-04 10:35:04 INFO OGG-00995 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: REPLICAT RMASTRK starting.
    2011-08-04 10:35:05 INFO OGG-00996 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: REPLICAT RMASTRK started.
    2011-08-04 10:35:06 WARNING OGG-00869 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: OCI Error ORA-01407: cannot update ("INFRA"."CUST"."CODE") to NULL (status = 1407), SQL <UPDATE "INFRA"."CUST" SET "ORD_ID" = :a2,"DP_ID" = :a3,"EXCHNG_CODE" = :a4,"ORD_QTY" = :a5,"ORD_PRICE" = :a6,"CODE" = :a7,"MKRT_CODE" = :a8,"CHANN>.
    2011-08-04 10:35:06 WARNING OGG-01004 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: Aborted grouped transaction on 'INFRA.CUST', Database error 1407 (ORA-01407: cannot update ("INFRA"."CUST"."SCRP_CODE") to NULL).
    2011-08-04 10:35:06 WARNING OGG-01003 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: Repositioning to rba 44132192 in seqno 68708.
    2011-08-04 10:35:06 *WARNING OGG-01154 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: SQL error 1407 mapping INFRA.CUST to INFRA.CUST OCI Error ORA-01407:* *cannot update ("INFRA"."CUST"."SCRP_CODE") to NULL (status = 1407), SQL <UPDATE "INFRA"."CUST" SET "ORD_ID" = :a2,"DP_ID" = :a3,"EXCHNG_CODE"=:a4,"ORD_QTY"*
    *= :a5,"ORD_PRICE" = :a6,"SCRP_CODE" = :a7,"MKRT_CODE" = :a8,"CHANN>.*
    2011-08-04 10:35:06 WARNING OGG-01003 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: Repositioning to rba 44132192 in seqno 68708.
    2011-08-04 10:35:06 ERROR OGG-01296 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: Error mapping from INFRA.CUST to INFRA.CUST.
    2011-08-04 10:35:06 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, rmastrk.prm: PROCESS ABENDING.
    Oracle GoldenGate Delivery for Oracle process started, group RMASTRK discard file opened: 2011-08-04 10:35:05
    Current time: 2011-08-04 10:35:06
    Discarded record from action ABEND on error 1407
    OCI Error ORA-01407: cannot update ("INFRA"."CUST"."SCRP_CODE") to NULL
    (status = 1407), SQL <UPDATE "INFRA"."CUST" SET "ORD_ID" = :a2,"MKRT_CODE" = :a8,"CHANN>
    Aborting transaction on ./dirdat/pm beginning at seqno 68708 rba 44132192
    error at seqno 68708 rba 44132192
    Problem replicating INFRA.CUST to INFRA.CUST
    *Mapping problem with compressed key update record (target format)...*
    ORD_QTY = 500
    ORD_PRICE = 37430
    SCRP_CODE =
    MKRT_CODE = N
    Oracle GoldenGate Delivery for Oracle process started, group RMASTRK discard file opened: 2011-08-
    04 10:35:05
    Current time: 2011-08-04 10:35:06
    Discarded record from action ABEND on error 1407
    OCI Error ORA-01407: cannot update ("INFRA"."CUST"."SCRP_CODE") to NULL
    (status = 1407), SQL <UPDATE "INFRA"."CUST" SET "ORD_ID" = :a2,"MKRT_CODE" = :a8,"CHANN>
    Aborting transaction on ./dirdat/pm beginning at seqno 68708 rba 44132192
    error at seqno 68708 rba 44132192
    Problem replicating INFRA.CUST to INFRA.CUST
    Mapping problem with compressed key update record (target format)...
    ORD_QTY = 500
    ORD_PRICE = 37430
    SCRP_CODE =
    MKRT_CODE = N
    Any inputs / help would be appreciated.
    Regards,
    Manish

    The SCRP_CODE column has a NOT NULL constraint. The ORA-01407 error is telling you that you cannot update or set a value for this column to null because of the constraint. This has absolutely nothing to do with an index. You can use a marker/sentinel value in lieu of using NULL. For a numeric field, where everything is positive, a negative value (-1) can be decoded as meaning null. For a character field, a code such as NA can represent NULL.
    This also has nothing to do (directly) with GoldenGate failing because of this error. The underlying SQL statement will fail everywhere, regardless of the tool or application. It is not a case of failing only in GoldenGate.

  • Problem in UPDATE statement In Multiple Record Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count 0 THEN
    LOOP
    IF :SYSTEM.last_record 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
    :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    As you do a loop over all the records in the block, of course every record is updated.
    Also, what you do is not the way is intended to be used. In general, you base a block on a table,then there is no need at all for writing INSERT's or UPDATE's. Forms also know's then, which records to be updated and which not.

  • Problem In Update Statement In Multiple Record Data Block

    Hi Friends,
    I have problem in update Statement for updating the record in multiple record data Block.
    I have two data Block the master block is single Record block and the 2nd data block is Multiple Record data Block.
    I am inserting the fields like category,and post_no for partiular job in single data block
    Now in second Multiple Record Data Block,i am inserting the multiple record for above fileds like no. of employees work in the position
    There is no problem in INSERT Statement as it is inerting all record But whenever i want to update particular Record (in Multiple Block) of employee for that category and Post_no
    then its updating all the record.
    my code is Bellow,
    IF v_count <> 0 THEN
    LOOP
    IF :SYSTEM.last_record <> 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
    VALUES(g_post_no, g_roster_no, g_category, :POST_HISTORY_MULTIPLE.idcode, :POST_HISTORY_MULTIPLE.joining_post_dt,
    :POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    next_record;
    ELSIF :SYSTEM.last_record = 'TRUE' THEN
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    IF SQL%NOTFOUND THEN
    INSERT INTO post_history(post_no,roster_no,category,idcode,joining_post_dt,leaving_post_dt,entry_gp_stage)
         VALUES (g_post_no,g_roster_no,g_category,:POST_HISTORY_MULTIPLE.idcode,
              :POST_HISTORY_MULTIPLE.joining_post_dt,:POST_HISTORY_MULTIPLE.leaving_post_dt,:POST_HISTORY_MULTIPLE.entry_gp_stage);
    END IF;
    EXIT;
    END IF;
    END LOOP;
    SET_ALERT_PROPERTY('user_alert',ALERT_MESSAGE_TEXT, 'Record Updated successfuly' );
    v_button_no := SHOW_ALERT('user_alert');
    FORMS_DDL('COMMIT');
    CLEAR_FORM(no_validate);
    Please Guide me
    Thanks in advence

    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;
    UPDATE post_history
    SET idcode = :POST_HISTORY_MULTIPLE.idcode,
    joining_post_dt = :POST_HISTORY_MULTIPLE.joining_post_dt,
    leaving_post_dt = :POST_HISTORY_MULTIPLE.leaving_post_dt,
    entry_gp_stage = :POST_HISTORY_MULTIPLE.entry_gp_stage
    WHERE post_no = :POST_HISTORY_SINGLE.post_no
    AND category = :POST_HISTORY_SINGLE.category
    AND roster_no = :POST_HISTORY_SINGLE.roster_no;
    AND idcode = :POST_HISTORY_MULTIPLE.idcode;These update statements are without where clause, so it will update all records.
    If it is specific to oracle forms then u may get better help at Forms section.

  • Problems - Update Record/Conditional regions

    Hi,
    I am building an admin interface in ASP VBScript, and have
    built an 'edit' page which has a load of text fields, with initial
    values bound to the data in a database, and which are hidden or
    shown depending on whether there is data in those fields in the
    database. Then there is the Update Record behaviour to update the
    info in the database.
    However, when I go to the edit page on the web, and click the
    udate button, it returns an error - i.e.
    'there was a problem processing the requested URL'.
    Is this because there are fields on the page which, since
    they have not been displayed, are not being included in the Update
    Record?
    How can I get the update record to work?
    Please help!
    thanks
    Ian
    Using DW8 on Mac
    Server: Win2000

    Ian
    If you are simply hiding fields by setting their type to
    hidden then this
    should not cause an update script to fail. However if you are
    simply not
    writing them to page then this will cause an issue.
    I suggest that you turn off friendly http errors (in tools:
    Internet Options
    : Advanced) and then post exactly what the error is.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "iandobie" <[email protected]> wrote in
    message
    news:e6ji55$i8t$[email protected]..
    > Hi,
    > I am building an admin interface and have built an
    'edit' page which has a
    > load of text fields, with initial values bound to the
    data in a database,
    > and
    > which are hidden or shown depending on whether there is
    data in those
    > fields in
    > the database. Then there is the Update Record behaviour
    to update the info
    > in
    > the database.
    > However, when I go to the edit page on the web, and
    click the udate
    > button, it
    > returns an error - i.e.
    > 'there was a problem processing the requested URL'.
    > Is this because there are fields on the page which,
    since they have not
    > been
    > displayed, are not being included in the Update Record?
    > How can I get the update record to work?
    > Please help!
    > thanks
    > Ian
    >
    > Using DW8 on Mac
    > Server: Win2000
    >

  • Update Record Problems

    Hello! I want to start off by saying that I usually
    use the wizards for things, and am not so great at PHP. I have
    David Powers fantastic book and am using it as a bible of sorts.
    However, it's not helping here.
    I'm using DW CS3 - I have a PHP MySQL database set-up and
    everything else seems to be working fine.
    I have a section of my site that is password protected. I
    have used the Dreamweaver Developer's Toolkit to create the
    protected folder. That works great. I have a page in which my
    site's users can "Manage Their profiles." I set up the links to the
    various pages with different profiles as dynamic links with the URL
    showing the user ID. That works.
    I even set up so that the "Change Password" link has a
    dynamic field on it that shows the users User ID - just so I know
    that the information is being passed correctly. And it is. I've set
    up a recordset for this page - and it can grab the appropriate
    information from the users record, and only that users record. I've
    tried the Update Record wizard and just about everything else I can
    think of here - and NOTHING is working. The password field is never
    updating. It's remaining the same. HELP!
    I have spent WAY too much time trying to figure this out and
    need to launch this part of the site very soon. Can anyone help me?
    Is the DW Developer's Toolkit folder security thing interfering?
    Thanks!
    Carlene

    puppet_factory wrote:
    > I have spent WAY too much time trying to figure this out
    and need to launch
    > this part of the site very soon. Can anyone help me? Is
    the DW Developer's
    > Toolkit folder security thing interfering?
    Without seeing the code, it's impossible to say what's wrong.
    I don't
    know enough about ADDT to comment on the effect it might be
    having.
    There's a separate forum dedicated to ADDT. You might get
    better help there.
    In the meantime, though, you can do some debugging yourself
    by using
    echo to display what's happening. For example:
    if ($_POST) {
    echo 'The $_POST array contains values<br />';
    Use echo to display the UPDATE SQL query.
    Staring at code does little to solve problems. Displaying
    messages to
    show what the code is doing helps isolate problem areas.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Error in updating records brought by LOV

    Hi everybody
    I am using Oracle 10 g
    when fetching data from the database by choosing a specific record from LOV then trying to make "save" means "commit" I have this error
    FRM-40509: Oracle error: unable to update record
    I think there is a problem in mapping btw the record in the form and the cursor pointing to that record in the database because when i execute "next_recod" button after choosing one in LOV it go to the record next the one specified before choosing from LOV
    knowing that updating process working correctly when choosing by ("first_record, previous_record, next_record or last_record)
    so what is the solution
    please help
    thank you very much

    yes please
    I didn't know what do you mean by customized or default menu
    I build LOV using the wizard and bind it by a query to a table then make Show_LOV from the form
    so when I choose one of the rows and they brought to the text boxes assigend to them after that when I make "Commit" I got that error
    thank you for help
    and sorry for bieng late in reply, I don't have enternet after 2:00 pm

Maybe you are looking for

  • My iPhone 4 is stuck in recovery mode after attempt to upgrade iOS.

    Help, I have tried to update my iPhone 4 iOS to iOS7 and the iPhone is stuck in recovery mode. I tried to hold the home button and the power button and restart it as it was written in may support forums but it did not help. When I connected the iPhon

  • Connecting Macbook Pro to Dell1704FPT

    Hi- I have a brand new Macbook Pro I'm trying to connect to a Dell1704FPT monitor.  I'm using a Mini DisplayPort to VGA adapter.  When I plug the adapter in, my Macbook recognizes the monitor but the monitor doesn't recognize my Mac.  The monitor has

  • Dependancy between Datasource and Application

    Hi, For our application we have created a new datasource in the JDBC Connector. The datasource connects to MS SQL server. I have observed that in NW the data sources are shown as application under the Deploy service. Hence I concluded that datasource

  • Turkish characters in Bex reports

    Hello Experts, I have a problem viewing Turkish characters in Bex reports. In place of Turkish characters I get some invaild characters. This problem is only with Bex reporting (Via excel). Web reporting, RSRT (Bex) everywhere it is showing properly,

  • Can you boot / run an Intel iMac from an external hard drive? Built-in drive is dead.

    Hello, Have a six? year old, 2.16 GHz Core 2 Duo iMac that has a dead internal HD. The drive has 16,000 hours on it (per SMART Utility) and no longer shows up on desktop. Disk Utility, Disk Warrior and SMART say it's toast. I'm backed up to Flash dri