Delete row in Error DTP

Hi,
We are using Error DTP's.
Is it possible to delete a single record from an Error DTP?
Can somebody tell me how?
Regards,
Jos.

Once data fails you can see those records in error stock
open that errostock and select the record which one you dont to delete and then click on save button
later execute the error dtp
now it will only process the records which are you not deleted,
Regards
Srini

Similar Messages

  • Database, Dataset, Table Adaptors Error "Unable to load, Update requires a valid DeleteCommand when passed DataRow collection with deleted row"

    Microsoft Visual Basic 2010 Express.
    I am new to Visual Basic programing and i am trying to understand the relationships between Datasets, database, table Adaptors. I have to following code that is is giving me the following error" Unable to load, Update requires a valid DeleteCommand
    when passed DataRow collection with deleted rows". 
    I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    It seems that i can delete the data on the DataGridView Table and it only displays the correct data. but my database is not updating, even though the data grid displays differently.I can determine this because, when i save the offset database, i have all
    the previous uploads and all the rows that i wanted to delete are still there.
    My final goal is to be able to import offset data from a CSV file, save this data on the pc, send a copy of this data to a NuermicUpDown so the customer can modify certain numbers. From here they download all the date to a controller.  IF the customer
    needs to modify the imported data, they can go to a tab with a data grid view and modify the table. They will also have to option to save the modified data into a csv file.  
    Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    CODE:
    Private Function LoadOffSetData()
            Dim LoadOffsetDialog As New OpenFileDialog 'create a new open file dialog and setup its parameters
            LoadOffsetDialog.DefaultExt = "csv"
            LoadOffsetDialog.Filter = "csv|*.csv"
            LoadOffsetDialog.Title = "Load Offset Data"
            LoadOffsetDialog.FileName = "RollCoaterOffset.csv"
            If LoadOffsetDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then  'show the dialog and if the result is ok then
                Try
                    Dim myStream As New System.IO.StreamReader(LoadOffsetDialog.OpenFile) 'try to open the file with a stream reader
                    If (myStream IsNot Nothing) Then 'if the file is valid
                        For Each oldRow As MaterionOffsetDataSet.OffsetTableRow In MaterionOffsetDataSet.OffsetTable.Rows
                            oldRow.Delete()                       
    'delete all of the existing rows
                        Next
                        'OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        Dim rowvalue As String
                        Dim cellvalue(25) As String
                        'Reading CSV file content
                        While myStream.Peek() <> -1
                            Dim NRow As MaterionOffsetDataSet.OffsetTableRow
                            rowvalue = myStream.ReadLine()
                            cellvalue = rowvalue.Split(","c) 'check what is ur separator
                            NRow = MaterionOffsetDataSet.OffsetTable.Rows.Add(cellvalue)
                            Me.OffsetTableTableAdapter.Update(NRow)
                        End While
                        Me.OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        MainOffset.Value = OffsetTableTableAdapter.MainOffsetValue          'saves all the table offsets
    to the offset numericUpDown registers in the main window
                        StationOffset01.Value = OffsetTableTableAdapter.Station01Value
                        StationOffset02.Value = OffsetTableTableAdapter.Station02Value
                       myStream.Close() 'close the stream
                        Return True
                    Else 'if we were not able to open the file then
                        MsgBox("Unable to load, check file name and location") 'let the operator know that the file wasn't able to open
                        Return False
                    End If
                Catch ex As Exception
                    MsgBox("Unable to load, " + ex.Message)
                    Return False
                End Try
            Else
                Return False
            End If
        End Function

    Hello SaulMTZ,
    >>I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    This error usually shows that you do not initialize the
    DeleteCommand object, you could check this
    article to see if you get a workaround.
    >> Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    If you are working CSV file, you could use OleDB to read it which would treat the CSV file as a Table:
    http://www.codeproject.com/Articles/27802/Using-OleDb-to-Import-Text-Files-tab-CSV-custom
    which seems to be easier (in my opinion).
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I manually added two rows in error. How do i delete them?

    Help, I manually added two rows, but cannot find out how to delete them without deleting all the responses!

    Hi;
    You can delete a single, or multiple rows in the Response Table by clicking on the row (or selecting multiple rows by clicking on the first row and then Shift+Click on the last row you want to select) and either using the right click context menu item "Delete Row/s" or clicking the arrow that appears when you mouse over the left side of the row/s and selecting "Delete Row/s" from the menu:
    Thanks,
    Josh

  • How to delete the requests in DTP?

    hi all,
    here i am unable to delete the requests in DTP...
    when i am going to delete the request in DTP it simply showing the error:
    *cannot lock request DTPR_488BDVJVHQPUUTT3R383DJ55Q OF TABLE 0MATERIAL for deletion*
    could you plz help me on this.....

    Hi Kiran,
    Please go through this thread. Here the same problem has been discussed it detail.
    /message/4419400#4419400 [original link is broken]
    Following are the steps mentioned in this thread
    1. RSA1 -->Info provider >0Material>Right Click-->Display
    2. One screen will come , Select the monitor icon to view that (not the one when you go with Manage of 0Material_attr).
    3. In the monitor screen you will see Refresh icon , Refresh that
    screen , Now the status will change , after 2 -3 refreshes you
    will see the request turning to red.
    4. Now go back to the manage tab of the 0Material attribute , You
    can delete now.
    Regards,
    Praveen

  • Error DTP Urgent

    Hi Gurus,
    This proplem is on production system so, any help is appreciated.
    One error appeared while executing the DTP. The error handling for the dtp is Valid Records Update, No Reporting (Request Red).
    I corrected the error in the error stack and I created an error DTP. I executed the DTP and it has status green.
    The problem is that the status of the previous DTP (the normal delta one) remaines RED. therefore, when I try to run it again, I get the well known error message:
    "Data has to be updated to the data target of
    this DTP in serialPrevious request has status
    ''Red''This request must be deleted or repaired
    before a new request can be started "
    Is there any other action that I should take? I have read KJ's blog and I cannot find anything else.
    thanks a lot!
    Andreea

    HI Roberto,
    Thanks for the suggestion. Unfortunately I am loading Master data so I don't believe deleting the request is an option. The red status DTP has loaded all the records in the PSA minus one (the errore). I was able to load the corrected record but the status of the previous DTP is still red.
    I wouldn't like to change the update mode because the DTP was created by another colleague and i don't know what might have been the reasons for his choice.
    Is there any other way to slve this problem?
    Thanks a lot!
    Andreea

  • How to delete row by row comparing to first collumn?

    Hello!
    I have a problem - I need to delete row by row , but the problem is, that I know that first COLUMN of any table is a PK.
    To retrieve COLUMN NAME I use:
    SELECT column_name, table_name FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = c1.tmp_table_name;
    But this somehow doesn't work.
    Below you can see my script (not worked for now):
    declare
    xxx varchar2(100);
    begin
    for c1 in (select table_name, tmp_table_name from tmp_tables) loop
    EXECUTE IMMEDIATE
    ' SELECT column_name into '|| xxx ||' FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = ' ||''''||c1.tmp_table_name||'''';
    execute immediate
    'begin
    for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
    insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name || ' where ' || xxx ||' = c2.'||xxx ||'; exception when others then null; end; end loop; end;';
    end loop;
    end;
    P.S. Inserts work perfect. I have a problem with delete rows that are in c1.table_name, from c1.tmp_table_name (this two tables have the same structure, PK, always), because I have different column names in another tables tables that are PK. (for example: K, ID, NS and so on) please help me to write correct script.
    For example for first fetched row it will be like:
    begin
    for c1 in (select table_name, tmp_table_name from tmp_tables) loop
    execute immediate
    'begin for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
    insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name ||' where K = c2.K; exception when others then null; end; end loop; end;';
    end loop;
    end;
    That script works perfect. But I have many others tables with different PK - not K.

    Solution with error-logging table
    -- create the error-logging table
    CREATE TABLE tbl_MergeErrors (
        Stamp       TIMESTAMP(3),
        TableName   VARCHAR2(30),
        KeyColumn   VARCHAR2(30),
        KeyValue    VARCHAR2(4000),
        ErrorCode   NUMBER(5),
        ErrorMsg    VARCHAR2(4000),
      CONSTRAINT pk_MergeErrors
          PRIMARY KEY (TableName, Stamp)
          USING INDEX
    -- procedure to insert errors
    CREATE OR REPLACE
    PROCEDURE LogMergeError (pTableName  IN VARCHAR2,
                             pKeyColumn  IN VARCHAR2,
                             pKeyValue   IN VARCHAR2)
    IS PRAGMA AUTONOMOUS_TRANSACTION;
        -- you couldn't insert SQLCODE or SQLERRM directly into a table (ORA-00984)
        nSQLCODE   NUMBER(5)      := SQLCODE;
        vcSQLERRM  VARCHAR2(4000) := SQLERRM;
    BEGIN
      INSERT INTO tbl_MergeErrors
             (Stamp, TableName, KeyColumn, KeyValue, ErrorCode, ErrorMsg)
          VALUES (SYSTIMESTAMP, RTrim( SubStr( pTableName, 1, 30)),
                  RTrim( SubStr( pKeyColumn, 1, 30)), SubStr( pKeyValue, 1, 4000),
                  nSQLCODE, vcSQLERRM);
      COMMIT WORK;
    -- if an error occured here, then just roll back the autonomous transaction
    EXCEPTION
      WHEN OTHERS THEN   ROLLBACK WORK;
    END LogMergeError;
    -- create the tables and insert test-data
    CREATE TABLE TMP_TABLES (
        TABLE_NAME       VARCHAR2(200),
        TMP_TABLE_NAME   VARCHAR2(200),
      CONSTRAINT TMP_TABLES_X PRIMARY KEY (TABLE_NAME)
    CREATE TABLE TMP_KL002 (
        K   VARCHAR2(40),
        N   VARCHAR2(200)
    CREATE TABLE TMP_TABLE1 (
        NS   VARCHAR2(40),
        N    VARCHAR2(200)
    CREATE TABLE KL002 (
        K VARCHAR2(40),
        N VARCHAR2(200),
      CONSTRAINT PK_KL002 PRIMARY KEY (K)
    CREATE TABLE TABLE1 (
        NS   VARCHAR2(40),
        N    VARCHAR2(200),
      CONSTRAINT PK_TABLE1 PRIMARY KEY (NS)
    INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('kl002','tmp_kl002');
    INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('table1','tmp_table1');
    INSERT INTO tmp_KL002 (K, N) VALUES ('00', 'none');
    INSERT INTO tmp_KL002 (K, N) VALUES ('07', 'exists');
    INSERT INTO tmp_KL002 (K, N) VALUES ('08', 'not assigned');
    INSERT INTO tmp_table1 (NS, N) VALUES ('2000', 'basic');
    INSERT INTO tmp_table1 (NS, N) VALUES ('3000', 'advanced');
    INSERT INTO tmp_table1 (NS, N) VALUES ('4000', 'custom');
    COMMIT WORK;
    -- to test, if it works correct when primary key values exists before
    INSERT INTO KL002 VALUES ('07', 'exists before');
    COMMIT WORK;
    -- check the data before execution
    SELECT * FROM TMP_KL002 ORDER BY K;
    SELECT * FROM KL002 ORDER BY K;
    SELECT * FROM TMP_TABLE1 ORDER BY NS;
    SELECT * FROM TABLE1 ORDER BY NS;
    -- empty the error-logging table
    TRUNCATE TABLE tbl_MergeErrors DROP STORAGE;
    -- a solution
    DECLARE
        PLSQL_BLOCK  CONSTANT VARCHAR2(256) := '
    BEGIN
      FOR rec IN (SELECT * FROM <0>) LOOP
        BEGIN
          INSERT INTO <1> VALUES rec;
          DELETE FROM <0> t WHERE (t.<2> = rec.<2>);
        EXCEPTION
          WHEN OTHERS THEN
              LogMergeError( ''<1>'', ''<2>'', rec.<2>);
        END;
      END LOOP;
    END;';
    BEGIN
      FOR tabcol IN (SELECT t.Tmp_Table_Name, t.Table_Name, c.Column_Name
                     FROM Tmp_Tables t,
                          User_Tab_Columns c
                     WHERE     (c.Table_Name = Upper( t.Tmp_Table_Name))
                           AND (c.Column_ID = 1)
                ) LOOP
        EXECUTE IMMEDIATE Replace( Replace( Replace( PLSQL_BLOCK,
                                   '<0>', tabcol.Tmp_Table_Name),
                                   '<1>', tabcol.Table_Name),
                                   '<2>', tabcol.Column_Name);
      END LOOP;
    END;
    -- check the data after execution ...
    SELECT * FROM TMP_KL002 ORDER BY K;
    SELECT * FROM KL002 ORDER BY K;
    SELECT * FROM TMP_TABLE1 ORDER BY NS;
    SELECT * FROM TABLE1 ORDER BY NS;
    -- ... and also the error-logging table
    SELECT * FROM tbl_MergeErrors ORDER BY Stamp, TableName;
    -- of couse you must issue an COMMIT (the ROLLBACK is only for testing
    ROLLBACK WORK;
    -- drop the test-tables
    DROP TABLE TABLE1 PURGE;
    DROP TABLE KL002 PURGE;
    DROP TABLE TMP_TABLE1 PURGE;
    DROP TABLE TMP_KL002 PURGE;
    DROP TABLE TMP_TABLES PURGE;
    -- you shouldn't drop the error-logging table, but I use it to free up my db
    DROP TABLE tbl_MergeErrors PURGE;Greetings, Niels

  • Delete  row  internal  bank  problem

    Hi,
    i  wasn't  able  to   delete   row  of   my  internal  bank,  despite  i   delete  this  bank   in  my   BP  account and   in  all  payment  method.
    Also   i   delete   all  the  information  in  internal  banck  account  (  branch,  count  number,  iban,etc)  but  when  i  delete  the  row  the  system  give  me  this  messagge  error
    bank account is currently in use and therefore can not be eliminated  705-20 
    i   currently  use   2007A   SP  01   patch  level  7
    how  can  i  resolve  this   problem?  thanks  a  lot

    Hi,
    thanks   a   lot,   but   this  bank   is  not   linked   to  any  one  field  in  Sap  B1
    1)  in  initial  details  there   isn't
    2)   in  payment   methods  there  isn't 
    3)  in  registry  BP  there   isn't
    where  can  i   has   to   find   it????
    By  copy  espress  i   had  copied  all  payment  methods  (  with  this  bank),  and  after   i   deleted   this   payment   methods  without   using  this  payment  method   in  anyone   Sap  b1  documents....and here the strange thing

  • B1SO2B1SO Update Documents scenario. Cannot delete row.

    Hi all,
      I've created an integration scenario that replicate Quotation creation and update from a SAP B1 System to another One.
    The scenario is ok for Document creation and even for updates of header data and update of existing row data. It works fine even for Document_LInes addition but it doesn't work for Document_Lines deletion.
    In detail the scenario doesn't give me any error and the message goes well in success list but the deleted rows in the destination System remains.
    Is it a normal behavior or can it be a Bug, or an error in xsl?
    thank you all for any help.
    Edited by: luca tassi on Dec 14, 2011 10:05 AM

    Seems that no one could help me so I reply to myself....
    I've installed the last version of B1iSN ( 8.8 PL09) and unfortunately for this issue nothing is changed .
    SAP Business one installation  is  still in the version 8.8 PL07: someone knows for certain if this issue exists using a new version of DI api whith B1iSN?

  • Deleting rows in a table with a button

    Good Day All;
    I seemed to have run into a snag with trying to add a delete button in a table that will delete a row. Let me expain.
    The form has 1 table that has 7 cells made up of text fields and drop downs. This table is in its own subform.
    There is a button to add rows as the user requires. The code I am using to add rows: psl_list_subform.instanceManager.addInstance(1);
    I have been asked to add a delete button so a user can delete rows. I have added this to the end of the table. SO each time a row gets repeated, there is a delete button. The code I am “trying” to use is;
    Table4.Row1.instanceManager.removeInstance(this.parent.index);
    When I click on the button to delete, nothing happens. I brought up the JavaScript debugger, there are no errors.
    Any ideas what I missed.
    Thanks All
    Chomp

    Hi,
    from my understanding of your form, you adding new instances of the subform "psl_list_subform" which contains a single table row.
    The hierarchy that will look like "psl_list_subform.Table4.Row1.RemoveButton".
    To remove an instance of the subform, from a button within the table row the script needs to refer to the 3rd parent of the remove button.
    this.parent.parent.parent.instanceManager.removeInstance(this.parent.parent.parent.index);
    Explaination: this = RemoveButton, 1st parent = Row1, 2nd parent = Table4, 3rd parent = psl_list_subform

  • How to handle the error stag(error DTP)

    Hi Friends, i got some records in the error stag while loading data from Dayta source to Master data target and this is in the production. we didn't created the Error DTP in the production. How to delete the error reocrds from the error stag if we dont want to update it to the target.And the request is showing in yellow due to that iam not able to delete the dtp request from the target.
    any help...to proceed with this error.
    thanks in advance.

    HI
    You are not able to delete the DTP from target?
    Change the request to RED
    Double clicking on theTrafic signal... then manually change the request to RED and Then you will be able to delete it.
    Hope this help...
    Dev

  • Deadlock when delete rows with blob.

    Hello
    I have the following issue. I try to clean a table that contains a BLOB column.
    To do this I use SQLDBC I create a statement that contains the LOB column, I fetch the line, load the Blob. and before fetching the next line, I send a delete request. and I fall in the deadlock.
    If I fetch the next line before sending the delete request there is no deadlock, there is also no deadlock if i do not request le LOB column in the select.
    In fact when I made select with LOB, there is the follwing line in DOMAIN.LOCKS
    SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;
    295513;                4290;438;ESKDBADM;2010-06-17;12:05:46;ly-delorme-u..1674;?;tab_share;?;5748;LY-DELORME.esker.corp;?;?;?;0000800000046919;0;?;?
    when i send the delete request the following lock appears in DOMAIN.LOCKS. A exclusif lock on the column I want to delete. It's ok
    SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;
    295521;                4287;167;ESKDBADM;2010-06-17;12:05:49;ly-delorme-u..1674;         5;row_exclusive;write;5748;LY-DELORME.esker.corp;ESKDBADM;ESKDBADM;DBM350_AUTOTESTXML;0000000000000934;5;00C51133800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
    BUT there is a dead lock , I think because of the following entry in DOMAIN.LOCK_WAITS
    TABLENAME;TABLEID;H_TERMID;H_PROCESS;H_APPLPROCESS;H_APPLNODE;H_ROWIDHEX;H_ROWID;H_LOCKMODE;H_DATE;H_TIME;H_LOCKTIMEOUT;R_TERMID;R_PROCESS;R_APPLPROCESS;R_APPLNODE;R_ROWIDHEX;R_ROWID;R_REQMODE;R_DATE;R_TIME;R_REQTIMEOUT;
    ?;0000800000046919;ly-delorme-u..1674;438;5748;LY-DELORME.esker.corp;?;?;tab_share;2010-06-17;12:05:46;?;ly-delorme-u..1674;167;5748;LY-DELORME.esker.corp;?;?;tab_exclusive;2010-06-17;12:05:49;      3585
    The database request a tab_exclusive lock on tableid 0000800000046918 but there is already a tab_share lock on this.
    Do you why there is a lock on the table :  tableid 0000800000046918 ?
    How to avoid this lock using SQLDBC ?
    Thanks for you help.
    Yann.

    this is the same reply as previous reply, this carriage return. I hope.
    Hello,
    Here is code that explain my issue.
    I create a table like this :
    create table "ESKDBADM"."DBM350_AUTOTESTXML"( "MSN" INTEGER not null, "DIST_FILE" BLOB, constraint SYSPRIMARYKEY primary key ("MSN"))
    And then I try to delete row with the following program. I do not understand why the request SELECT Msn, DIST_FILE FROM DBM350_AUTOTESTXML set a share lock on the tableid : 000080000004691D.
    I do not find this tableid in the "SYSINFO"."FILES" table.
    SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;
    295697; 5220;172;ESKDBADM;2010-06-21;11:01:40;ly-delorme-u..1CDC;?;tab_share;?;7388;LY-DELORME.esker.corp;?;?;?;000080000004691D;0;?;?
    // SQLDBC.cpp : Defines the entry point for the console application.
    // YOU MUST CHANGE CONNECTION SETTINGS.
    #include "stdafx.h"
    #include <stdio.h>
    #include <tchar.h>
    #include <comdef.h>
    #include <iostream>
    #include "SQLDBC.h"
    using namespace SQLDBC;
    static void parseArgs(int argc, wchar_t **argv);
    static SQLDBC_Connection *connectDB(SQLDBC_Environment * env = NULL);
    static char* convertToUCS2(char *src);
    static void usage();
    SQLDBC_Environment *g_env;
    typedef struct ConnectArgsT {
      bstrt username;
      bstrt password;
      bstrt dbname;  
      bstrt host;    
      bstrt request;    
    } ConnectArgsT;
    ConnectArgsT connectArgs;
    void exitOnError(SQLDBC_ErrorHndl &err);
    int _tmain(int argc, _TCHAR* argv[])
       parseArgs(argc, argv);
       SQLDBC_Connection *conn = connectDB();
       //* Create a new statment object and execute it.
       SQLDBC_PreparedStatement *stmt = conn->createPreparedStatement();
       // FREEZE
       if (connectArgs.request.length() == 0)
               connectArgs.request = "SELECT Msn, DIST_FILE FROM DBM350_AUTOTESTXML";     
       /* NO FREEZE
       if (connectArgs.request.length() == 0)
               connectArgs.request = "SELECT Msn FROM DBM350_AUTOTESTXML";
       char command = (char)((LPCWSTR)(connectArgs.request));
        //* Executes the UNICODE encoded SQL command.
       SQLDBC_Retcode ret = stmt->prepare((const char*)command, SQLDBC_StringEncodingType::UCS2Swapped);
       exitOnError(stmt->error());
       stmt->execute();
       exitOnError(stmt->error());
       // * Get the resultset.  
       SQLDBC_ResultSet *result;
       result = stmt->getResultSet();
       exitOnError(stmt->error());
       // * Fetch the row from the resultset.     
       result->next();
            SQLDBC::SQLDBC_RowSet* pRowset =  result->getRowSet();
         ret = pRowset->fetch();          
       exitOnError(result->error());
       wchar_t szString[30];
       SQLDBC_Length ind;
    Get a string value from the column.
       result->getObject(1, SQLDBC_HOSTTYPE_UCS2_SWAPPED, szString, &ind, sizeof(szString)); // Retreive MSN.
       // Delete de line.
       // Create a new connection for delete
       SQLDBC_Connection *conn2 = connectDB(g_env);
       //* Create a new statment object and execute it.
       SQLDBC_PreparedStatement *stmt2 = conn2->createPreparedStatement();
         std::wstring st = L"DELETE FROM DBM350_AUTOTESTXML WHERE MSN=";
         st +=  szString;
         stmt2->prepare((char*)st.c_str(), SQLDBC_StringEncodingType::UCS2Swapped);
        //* Executes the UNICODE encoded SQL command.
         ret = stmt2->execute();
       exitOnError(stmt->error());
       printf("%s\n", szString);
       return 0;
    static char *convertToUCS2(char *src)
      int len = strlen(src);
      wchar_t w=(wchar_t)calloc(len, sizeof(wchar_t));
      int nc = mbstowcs(w, src, len);
      if ((size_t)-1 == nc) {
        fprintf(stderr, "Conversion to UCS2 failed. Execution stopped.\n");
        exit(1);
      short s=(SQLDBC_Int2)calloc(nc+1, sizeof(SQLDBC_Int2));
      int i;
      for(i=0; i<nc; i++) {
        s<i> = w<i>;
      free(w);
      return (char*)s;
    static char* strupper(char *str)
        char *p=str;
        while(*p) {
            p=toupper(p);
            ++p;
        return str;
    static wchar_t *argv0;      
    #ifdef WIN32
    #define STRICMP _stricmp
    #else
    #define STRICMP strcasecmp
    #endif
    SQLDBC_Connection *connectDB(SQLDBC_Environment * env)
      char errorText[200];
      SQLDBC_Retcode rc;
      if (g_env == NULL)
    Every application has to initialize the SQLDBC library by getting a
    reference to the ClientRuntime and calling the SQLDBC_Environment constructor.
           SQLDBC_IRuntime *runtime;
           runtime = SQLDBC::GetClientRuntime(errorText, sizeof(errorText));
           if (!runtime) {
              fprintf(stderr, "Getting instance of the ClientRuntime failed %s\n", errorText);
              usage();
           env = new SQLDBC_Environment(runtime);
           g_env = env;
    Create a new connection object and open a session to the database.
      SQLDBC_Connection *conn = env->createConnection();
      printf("Connecting to '%s' on '%s' as user '%s'\n",
             (char)connectArgs.dbname, (char)connectArgs.host, (char*)connectArgs.username);
      rc = conn->connect(connectArgs.host, connectArgs.dbname,
                         connectArgs.username, connectArgs.password);
      if(SQLDBC_OK != rc) {
        fprintf(stderr, "Can't connect to '%s'.\nERROR: %d:'%s'\n",
                connectArgs.dbname, conn->error().getErrorCode(), conn->error().getErrorText());
        exit(1);
      return conn;
    static void parseArgs (int argc, wchar_t **argv)
      argv0 = wcsdup(argv[0]);
    setting defaults for demo database
      connectArgs.username = "ESKDBADM";
      connectArgs.password = "DELORME";
      connectArgs.dbname = "EDP350";
      connectArgs.host = "ly-delorme";
    use values from command line
      if (argc > 5) {
        connectArgs.request = argv [5];
      if (argc > 4) {
        connectArgs.host = argv [4];
      if (argc > 3) {
        connectArgs.dbname = argv [3];
      if (argc > 2) {
        connectArgs.password = argv [2];
      if (argc > 1) {
        if (!wcsicmp(argv [1], L"-h"))
          usage();
        else {
          connectArgs.username = argv [1];
      strupper(connectArgs.username);
      strupper(connectArgs.password);
    void exitOnError(SQLDBC_ErrorHndl &err)
      if(err) {
        fprintf(stderr, "Execution stopped %d:'%s'", err.getErrorCode(), err.getErrorText());
        exit(1);
    static void usage()
      wchar_t *s = wcsrchr(argv0, L'/');
      if (!s)
        s = wcsrchr(argv0, L'
      if (s)
        *s = '\0';
      printf("Syntax: %s [-h] | [<connect_options>]\n"
             "\tconnect_options :: \n"
             "\t\t[ <username> \n"
             "\t\t[ <password>\n"
             "\t\t[ <database_name>\n"
             "\t\t[ <database_server> ]]]]\n"
               "\t\t[ <request> ]]]]\n"
             "\tCalling %s without any arguments will use user '%s','%s'\n"
             "\t\ton database '%s' at server '%s'\n",
             argv0, argv0,
             connectArgs.username, connectArgs.password,
             connectArgs.dbname, connectArgs.host);
      exit(1);

  • Deleting Row Before Throwing JhdJboException

    I am using JHeadstart to develop UIX pages. Once a form is submitted on one of the pages, it creates a row in one of the database tables and begins to execute a java file we wrote. In the java file, there are certain times when a JhdJboException may be thrown. If the error is thrown, I want to delete the row that was created by submitting the form. I have tried locking the rows before I do the remove(), but I still get the same results.
    After the error is thrown, I go to check if the row has been deleted and it is still there. Is it possible that when the error is thrown, it is rolling back the remove() and restoring the row? Any advice on how to delete the row either before or after the error is thrown would be greatly appreciated. Thanks.
    -Susan
    Here's an example of the code I am using.
    Row periodRow = service.findViewObject("PeriodClosingsView1")
    .getCurrentRow();
    periodRow.remove();
    throw new JhdJboException("JHD-00104");
    This is what gets written in the OC4J log when I call the remove() method.
    06/05/17 10:19:17 Deleting row
    06/05/17 10:19:17 [20181] QueryCollection.afterRemove(2341) QueryCollection: afterRemove(0)
    06/05/17 10:19:17 [20182] ViewRowCache.removeReference(521) ViewRowCache: removeReference, vr id = 450
    06/05/17 10:19:17 [20183] server.QueryCollection(java) Column count: 9
    06/05/17 10:19:17 [20184] ViewObjectImpl.getPreparedStatement(7570) ViewObject: BilledMealTransactions1 Reusing defined prepared Statement
    06/05/17 10:19:17 [20185] ViewRowSetImpl.bindParameters(1629) Bind params for ViewObject: BilledMealTransactions1
    06/05/17 10:19:17 [20186] ViewRowSetImpl.bindParameters(1658) Binding param 1: 1
    06/05/17 10:19:17 [20187] ViewRowSetImpl.bindParameters(1658) Binding param 2: 1
    06/05/17 10:19:17 [20188] ViewRowSetImpl.bindParameters(1658) Binding param 3: 538
    06/05/17 10:19:17 Deleted row

    Susan,
    If I understand what you want: you insert a new row and commits, and remove the row and commits if your processing throws and exception.
    Probably you just forgot to commit after the remove() call. I don't know in which class you're implementing this method, but you should get the transaction and call commit. If you're inside an action method (which is not recommended):
    periodRow.remove();
    daContext.getBindingContainer().getDataControl().getApplicationModule().getTransaction().commit();
    throw new JhdJboException("JHD-00104");Where daContext is an instance of DataActionContext class.
    The best solution for your case (if you can) is simply not commit that new row until your business method finish processing without throwing an exception.
    Inserting and commiting, removing and commiting is not elegant. You should use your database capabilities of rolling back an uncommited transaction.
    Eduardo

  • Deleting rows with child records

    Hi,
    I want to delete some records from master table based on where condition. But I want all the corresponding child record should also delete from the respective child tables..
    Can anyone tell me how to go about it with example( eg emp & dept table of scotts)
    Regards

    I have been to slow for posting...
    Please note that I hate doing this
    SCOTT@LSC01> select count(*) from emp;
      COUNT(*)
            14
    SCOTT@LSC01> delete dept where deptno=10;
    <font color=red>1 row deleted.</font>
    SCOTT@LSC01> select count(*) from emp;
      COUNT(*)
            11the risk is that someone is not aware of deleting rows, and instead of getting
    SCOTT@LSC01> delete dept where deptno=10;
    delete dept where deptno=10
    ERROR at line 1:
    ORA-02292: integrity constraint (SCOTT.FK_DEPTNO) violated - child record foundhe is deleting rows in other tables and will never be aware of that deletion ...

  • Cannot commit delete row from VO

    I have a VO that I have no problem create new row, update existing row and commit. But I can't commit deleted row to database. no exception or error message etc... and All other VOs are working fine,
    anybody has any idea why? is that an option or something on VO? or is it an BC4J bug?
    Thanks,
    -Ming
    Edited by: user715460 on Oct 16, 2008 3:40 PM

    You are in the wrong forum. Try your question JDeveloper and ADF .
    And please consider this too (copied from this thread Concerned in delayed response
    a) Use a good subject line that briefly describes the issue. This will attract those familiar with that area to come and help.
    b) Tell us what database version you are using. Not just saying e.g. "10g" but more specifically "10.2.0.3"
    c) Describe the issue clearly stating what you have tried, and what you are trying to achieve.
    d) Don't use txt spk because this is a professional forum, not a chat room and not everyone can follow it.
    e) Don't USE CAPITAL LETTERS IN YOUR DESCRIPTION as this is considered shouting and agressive.
    f) Provide sample data for us to use if necessary either with the CREATE TABLE and INSERT statements to create it or providing a WITH clause that we can use. This saves us from having to type in and format the sample data for ourselves and is more likely to attract us to help.
    g) Show the code that you have already tried (if you haven't tried any code yet then why not? have a go yourself and only ask for help when you get stuck).
    h) Show us any error messages you are getting, in full, and with information of the line numbers where the error is occurring
    i) Wherever you provide data or code remember to use the tag before and after or the [code] tag before and the [/code] tag after, so that it keeps it's layout and is clear to read.
    j) Perhaps one of the most important things of all... never suggest that you need a solution "urgently" or that your issue is "urgent". This implies that your issue is somehow more important than the issues posted by other people. Everybody would like an answer to their issue promptly, but it just depends when people are online who can answer the question and nobody is being paid to answer it, so it is arrogant and rude to demand urgent attention to your own. If something is that urgent then you should raise it through oracle metalink as a priority issue or pay for someone with the necessary skills to come and do the work for you.
    Timo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Deleted Rows Flashback : unable to read data - table definition has changed

    Hi All,
    Its Really Important.
    I Unfortunately truncated a table using
    Trancate table mytable;
    and Made a alter table to decrease data pricision length.
    But i Need the tabla data back,
    i used the below command to get deleted rows, it shows error.
    query : select * from pol_tot versions between timestamp systimestamp-1 and systimestamp;
    error : ORA-01466: unable to read data - table definition has changed
    query : flashback table pol_tot to timestamp systimestamp - interval '45' minute;
    error : ORA-01466: unable to read data - table definition has changed
    Kindly Share your ideas How Can i Get thoose Deleted Records.
    Edited by: 887268 on Jul 8, 2012 12:26 AM

    BluShadow wrote:
    Khayyam wrote:
    Flashback dont works after DDL. Truncate command is DDL. Only recover from backup can help.Please don't spread untrue statements.Working of flashback after Drop command is so clear to say. I mean such DDL commands as CREATE, ALTER, TRUNCATE and so on...
    "Remember that DDLs that alter the structure of a table (such as drop/modify column, move table, drop partition, truncate table/partition, and add constraint) invalidate any existing undo data for the table. If you try to retrieve data from a time before such a DDL executed, you will get error ORA-1466. DDL operations that alter the storage attributes of a table (such as PCTFREE, INITRANS, and MAXTRANS) do not invalidate undo data."
    [http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm#BJFJHDAG]

Maybe you are looking for

  • How to determine the system color and set them for my app?

    Hi, I'd like to set the colors of my application to the system's colors. Especially the backgrounds of my JPanels, JButtons and so on should look like in the operating system. If you change the systems color scheme, my application looks really wierd

  • Why won't my itouch sync with my windows computer?

    So recently I updated from IOS 4.2.1 to IOS 5.0.1 and found my windows xp computer would not sync with my ipod touch as i kept on getting an error. Well i download itunes on my windows 7 computer and it worked fine. Now when i try to plug in my ipod

  • Max no of execute threads in 4.5

    Hi, We have set the no of execute threads in 4.5.1 to >700. During start up of the weblogic server, we get the following message: !!!!!!!!!!!!!!!!!!!!!Property weblogic.system.executeThreadCount has value: 775 > max: 400 setting value to 400 Does Web

  • Forecast Transfer to R/3 in Daily/Weekly buckets

    Hi, We have 2 planning areas in DP - Weekly and daily planning area. For the first 3 weeks, the forecast will be transferred to R/3 in daily buckets and for the remaining 2 weeks, the forecast will be transferred in weekly buckets. I have created 2 s

  • Mass Closure of PO through an ABAP development

    Hi , I have a requirement of a mass closure of Purchase Orders supplied through an upload file , by marking the 'Delivery Complete Indicator ' for all line items in each PO . Is there any BAPI or Function Module for the same ? BAPI_PO_CHANGE does not