Alternatives to using update to flag rows of data

Hello
I'm looking into finding ways of improving the speed of a process, primarily by avoiding the use of an update statement to flag a row in a table.
The problem with flagging the row is that the table has millions of rows in it.
The logic is a bit like this,
Set flag_field to 'F' for all rows in table. (e.g 104million rows updated)
for a set of rules loop around this
Get all rows that satisfy criteria for a processing rule. (200000 rows found)
Process the rows collected data (200000 rows processed)
Set flag_field to 'T' for those rows processed (200000 rows updated)
end loop
Once a row in the table has been processed it shouldn't be collected as part of any criteria of another rule further down the list, hence it needs to be flagged so that it doesn't get picked up again.
With there being millions of rows in the table and sometimes rules only processing 200k rows, i've learnt recently that this will create a lot of undo to be written and will thus take a long amount of time. (any thoughts on that)
Can anyone suggest anything other then using an update statement to flag each row to avoid it being processed again?
Appreciate the help

With regard to speeding up the process, the answer is
"it depends". It all hinges on exactly what you mean
by "Process the rows collected data". What does the
processing involve?the processing involved is very straight forwards.
data in these large tables stay unchanged. for sake of this example, i'll call this table orig_data_table, the rules are set by users who have their own tables built (for this example we'll call it target_data_table).
the rules are there to take rows from the orig_data_table and insert them into the target_data_table.
e.g
update orig_data_table set processed='F';rule #1 states : select * from orig_data_table where feature_1 = 310;this applies to 3000 rows in orig_data_table.
these 3000 rows get inserted to target_data_table.
final step is to flag these 3000 rows in the orig_data_table so that they are not used by another rule proceeding rule 1 : update orig_data_table.processed='T' where feature_1 = 310;
commit;rule #2 states :select * from orig_data_table where feature_1=310 and destination='Asia' and orig_data_table.processed = 'F'so it won't pick the 3000 rows that were processed as part of rule #1
once rule #2 has got the rows from orig_data_table (e.g 400000 rows)
those get inserted to the target_data_table, followed by them being flagged to avoid being retrieved again
update orig_data_table.processed='T' where destination='Asia';
commit;continue onto rule #3...
- Is the process some kind of transformation of the
~200,000 selected rows which could possibly be
achieved in SQL alone, or is it an extremely complex
transformation which can not be done in pure SQL?its not at all complex, as i say the data in orig_data_table is unchanged bar the processed field which is initially set to 'F' for all rows and then set to 'T' after each rule for those rows fulfilling the criteria of each rule.
- Does the FLAG_FIELD exist purely for the use of
this process or is it referred to by other
procedures?the flag_field is only for this purpose and not used elsewhere
Having said that, as a first step to simply avoid the
update of the flag field, I would suggest that you
use bulk processing and include a table of booleans
to act as the indicator for whether a particular row
has been processed or not.could you elaborate a bit more on this table of booleans for me, it sounds an interesting approach for me to test...
many thanks again
Sandip

Similar Messages

  • How to update a single row of data table

    How we can update a single row of the data table by clicking the button in the same row.
    Thanks in Advance.

    Hi!
    What do You mean 'update'? Get fresh data from DB or change data and commit it in DB?
    If commit, try to read here:
    http://developers.sun.com/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    Thanks,
    Roman.

  • Using singleton to store rows of data

    Hello,
    I'm working on a web project involving struts.
    I have a jsp page, action class, action form, and a session ejb.
    I'm getting rows from database.
    What I would like to do is to use SIngleton approach to store rows of data for users.
    Does anyone know how to implement that approach?
    Thank you.

    Hello,
    I'm working on a web project involving struts.
    I have a jsp page, action class, action form, and a
    session ejb.
    I'm getting rows from database.
    What I would like to do is to use SIngleton approach
    to store rows of data for users.
    Does anyone know how to implement that approach?
    This would be a very very very bad design since the singleton would be shared between ALL users of the JSP and they would therefore interfere with each other.

  • Using Update data action to update data in job data component

    hi, I'm trying to update data in job component using CI_JOB_DATA, im setting action as updatedata. but i'm getting error.
    "UPDATEDATA - updating existing keyed child records
    Example - updating an existing row of data by using the key value(s) and enough child fields to single out the distinct record. "
    Is the above statement correct?

    For example ExceltoCi uses ComponentInterfaces to load data.
    Snipet from PeopleBooks:
    PeopleBooks > PeopleTools 8.52: PeopleSoft Component Interfaces > Using the Excel-to-Component Interface Utility
    UpdateData.
    Use this option to update specific non-key values that already exist. The system uses the keys to locate the row, and when a match is found, the row is updated with new data. If a key match is not found by the system, it displays an error message indicating which collection was missing a key match.
    When using the UpdateData action, you must provide all keys for the collection for the system to modify the data.
    Note. If you want to insert an effective-dated collection at Level 1 containing a child collection at Level 2, you may need to use UPDATE to insert the parent row at level 1 and then use UPDATEDATA to insert the child row at level 2. This is because child rows are copied forward from the current effective-dated collection as a result of the insertion of a new effective-dated parent row. These child rows will be updated by the component processor with the new effective date, and may have the same level 2 keys as the Level 2 child row that you are trying to submit from ExcelToCI.

  • How to update  the restricted rows that were selcted using fetch

    Hi
    I have to fetch  one row at a time from my staging table using JDBC Sender Adapter,  which is configured against AS400 DB2 and push it to R/3.
    The select  SQL looks like this in JDBC Sender Adapter
         <b>select  jedata, oxruns from fxjrnep2 where oxsts=' '   fetch first 1 rows only</b>
                                       and
    update sql is
         <b>update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS=' ' </b>
    The problem here is my select gets one row, which is what i want, but my update actually updates all the rows that satisfied the where condition oxsts=' ' instead of one.
      I couldn't  use <b>fetch first 1 rows only</b> at the end of the update sql to update the selected row. DB2 does not allow  fetch in update sql.
    Can anyone suggest solution here or recommend alternative?
    Best Regards
    Venkat

    check for update query where u can club the select stmt u had used with udpate like:
    update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS = (select jedata, oxruns from fxjrnep2 where oxsts=' ' fetch first 1 rows only
    just need to try combinations of this type.
    if still this is not working use a bpm and get all the records where OXSTS is null and process record one by one within a block

  • Updating one row of data using CMP

    Hi,
    How should I update a single row mapped with a CMP persitence, should I write a differetnt method for update , pl clarify in detail.

    Hi,
    How should I update a single row mapped with a CMP
    P persitence, should I write a differetnt method for
    update , pl clarify in detail.Hi,
    You can just find that particular Row using the findByPrimaryKey method the entity.
    This method actually returns the Remote Interface for the Entity which contains taht particular row of record.
    Use The setters of the Remote interface to update your existing Row.

  • How to update all the rows of table using stored procedures

    Hi,
    I want to update all the rows of a table of a specific column
    sp_a  male
    sp_b female
    sp_c  male
    sp_d female
    in above table 
    gender of all the columns has to be interchanged.

    Sir table is like this detail(name varchar(10),gender varchar(10))
    Where Details  are like this 
    Name  Gender
    sp_a 
    male
    sp_b
    female
    sp_c 
    male
    sp_d
    female
    I want to create a stored procedure which automtically updates gender from male to female and female to male
    for all the rows . i.e., all the rows are updated for column gender by just running a stored procedure.
    So after execution of stored proc the above table looks
    Name  Gender
    sp_a 
    female
    sp_b
    male
    sp_c 
    female
    sp_d
    male

  • Cursor only updates every second row

    Hello Helpful Peoples
    I have a table with a set of delivery dates, and am wanting to add a date on which a reminder flag should be raised by the system. The delivery dates are already populated and I'm wanting to add functionality where the end user can set how many days prior they are reminded.
    I've opened a cursor to retrieve all the current due dates from my source table. When I loop through this cursor and update the reminder date and reminder text, my code is only updating every second row.
    I can't work out why this code seems to skip a row every time it updates a record. Is anyone able to assist?
    declare
    v_date rep_delivery.reminderdate%type;
    v_rownum number;
    CURSOR reminder_cur
    IS
    SELECT DEL.DUEDATE
    FROM REP_DELIVERY DEL
    WHERE DEL.REP_ID = :P212_REP_ID:
    FOR UPDATE OF DEL.REMINDERDATE;
    begin
    FOR x IN reminder_cur LOOP
    FETCH reminder_cur INTO v_date;
    EXIT WHEN reminder_cur%NOTFOUND;
    v_date := v_date - to_number(:P212_REMDAYS);
    UPDATE REP_DELIVERY DEL2
    SET DEL2.REMINDERDATE = v_date
    WHERE CURRENT OF reminder_cur;
    UPDATE REP_DELIVERY DEL3
    SET DEL3.REMINDERTEXT = :P212_DESCRIPTION
    WHERE CURRENT OF reminder_cur;
    END LOOP;
    commit;
    end;

    Oolite,
    Use this code:
    DECLARE
       v_date   rep_delivery.reminderdate%TYPE;
       CURSOR reminder_cur
       IS
          SELECT        ROWID, duedate
                   FROM rep_delivery
                  WHERE rep_id = :p212_rep_id
          FOR UPDATE OF reminderdate;
    BEGIN
       FOR x IN reminder_cur
       LOOP
          v_date := x.duedate;
          v_date := v_date - TO_NUMBER (:p212_remdays);
          UPDATE rep_delivery del2
             SET del2.reminderdate = v_date,
                 del2.remindertext = :p212_description
           WHERE ROWID = x.ROWID;
       END LOOP;
       COMMIT;
    END;and it will work for you.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Results not updating for every row in BIpublisher

    Hi all I have a Bi publisher report that is updating the results for the first row and in the second row to update the results it is picking the values from the first column itself and using the same values for all the other rows.
    Here is my report format
    Month saves Total, for 30,60,90,120
    Jan
    feb
    Mar
    Total are the enrolls by each month and days shows after 30,60,90,120 how many are still active. Following eg should give an idea of exactly whats happening
    Eg:
    Total 30days 60days 90days 120days 150days 180days 210days
    ------------------------------------------------------------------------------------------------------------------------------------------------------------ Jan saves 330 287 274 270 263 262 259 257
    Feb saves 298 255 242 238 231 230 227 225
    Mar saves 291 248 235 231 224 223 220 218
    So what is happening is lets say for example there are a total of 330 enrolls in january and after 30days 287 are still active and after 60days 274 are still active after 90 270...... etc
    Am getting the January active values correctly.
    BUt going forward when I see the values for february The total enrolls for february is 298 and after 30 days which are active is not giving me the correct.
    It is substracting the same amount as jan. looking at the numbers it is substracting
    -43, -13,-4,-7,-1,-3,-2 for Jan which are the cancels after the consecutive days
    It is substracting the same amount for feb also but my actual cancels for feb are different it should be 45,12,8,9,2,2,
    It is doing the same for all the months.
    There should be a change in the code. Following is the XSL code am using in
    <?xdoxslt:set_variable($_XDOCTX, 'v_SavesCanceled', SAVES_CANCELED_COUNT)?>
    <?xdoxslt:set_variable($_XDOCTX, 'v_RtSaves', xdoxslt:get_variable($_XDOCTX, 'v_RtSaves') - xdoxslt:get_variable($_XDOCTX, 'v_SavesCanceled'))?>
    <?xdoxslt:get_variable($_XDOCTX, 'v_RtSaves')?>
    Actually the cancels should be updated for each row but its picking the same cancels for every month.
    Hope it is clear let me know if you need any further info
    Any help is appreciated.
    Thanks

    Thank you very much for your help. The rtf file sent worked and updating results as required.Thank you
    Thanks

  • Using a ommand to generate more than one row of data in utl file

    Hi Guys
    This might be a pretty long one. But I require help with regards to using outer and inner loops within my code.
    Here is the task:
    Each account involved with the DCA Allocation has an entry in the DCAACCOUNTALLOCATION table to track its progress. The STATUS value of the entry shows the position of the account in the DCA Allocation process.
    The status entry being tested is 3.
    Below is the code:
    create or replace
    PROCEDURE DCA_BMW_OUT
    IS
    -- Declare all variables as reference
    v_out_file UTL_FILE.FILE_TYPE;
    v_row_Count NUMBER;
    r_bmw NUMBER;
    v_out_directory all_directories.directory_path%type;
    v_out_filehandle UTL_FILE.FILE_TYPE := NULL;
    v_out_buffer varchar2 (32767);
    v_records NUMBER;
    body_output varchar2(32759 BYTE);
    dictionary_guarantorsexist varchar2 (1 Char);
    -- Text required within this part of the procedure
    v_body varchar2(32767 BYTE);
    v_header VARCHAR2(32759 BYTE);
    BEGIN
    FOR r_bmw IN
    ( SELECT *
    FROM dcaadditionaldata
    WHERE directory_name IS NOT NULL
    ) LOOP
    BEGIN
    -- Output file to be added into the directory specified
    v_out_file := utl_file.fopen (r_bmw.directory_name, 'DCAExport_1_' || TRIM(TO_CHAR(SYSDATE,'DDMMYYYY_HH24MISS')) || '.txt', 'W');
    -- The Header data which will be outputted to the file
    v_header := 'KennzeichenBrgschaftsforderungGesamtforderung|Währung|Übergabedatum|DifferenzierungAnwalts-oderInkassofall|MainMarktpartnernummer|
    MainAnrede|MainTitel|MainName|MainVorname|MainStraße|MainHausnummer|MainPLZ|MainOrt|MainLand|MainGeburtsdatum|MainTelefonnr.Schuldner|G1Marktpartnernummer
    G1Anrede      G1Titel      G1Name      G1Vorname      G1Straße      G1Hausnummer      G1PLZ      G1Ort      G1Land      G1Geburtsdatum      G1Telefonnr.Schuldner      G2Marktpartnernummer      G2Anrede      G2Titel
    G2Name|G2Vorname|G2Straße|G2Hausnummer|G2PLZ|G2Ort|G2Land|G2Geburtsdatum|G2Telefonnr.Schuldner|G3Marktpartnernummer|G3Anrede|G3Titel|G3Name|G3Vorname|
    G3Straße|G3Hausnummer|G3PLZ|G3Ort|G3Land|G3Geburtsdatum|G3Telefonnr.Schuldner|G4Marktpartnernummer|G4Anrede|G4Titel|G4Name|G4Vorname|G4Straße|G4Hausnummer|
    G4PLZ|G4Ort|G4Land|G4Geburtsdatum|G4Telefonnr Schuldner|G5Marktpartnernummer|G5Anrede|G5Titel|G5Name|G5Vorname|G5Straße|G5Hausnummer|G5PLZ|G5Ort|G5Land|
    G5Geburtsdatum|G5Telefonnr.Schuldner|Kundennr.|Bestandsnr.|Finanzierungsnr.|KennzeichenFinanzierung/Leasing|Kennzeichenprivat/gewerblich|
    reguläresVertragsende|Laufzeit|Vertragsdatum|Vertragsstatus|Ratenbetrag|Filiale/Gebiet|Finanzierungstyp|BankverbindungKonto|BankverbindungBLZ|
    RSVKennzeichen|Kündigungsdatum|Modell|Fahrgestellnummer|KFZKennzeichen|KFZZulassungsdatum|CoD1Marktpartnernummer|CoD1Anrede|CoD1Titel|CoD1Name|
    CoD1Vorname|CoD1Straße|CoD1Hausnummer|CoD1PLZ|CoD1Ort|CoD1Land|CoD1Geburtsdatum|CoD1Telefonnr.Schuldner|CoD2Marktpartnernummer|CoD2Anrede|CoD2Titel|
    CoD2Name|CoD2Vorname|CoD2Straße|CoD2Hausnummer|CoD2PLZ|CoD2Ort|CoD2Land|CoD2Geburtsdatum|CoD2Telefonnr.Schuldner|CoD3Marktpartnernummer|CoD3Anrede|
    CoD3Titel|CoD3Name|CoD3Vorname|CoD3Straße|CoD3Hausnummer|CoD3PLZ|CoD3Ort|CoD3Land|CoD3Geburtsdatum|CoD3Telefonnr.Schuldner|CoD4Marktpartnernummer|
    CoD4Anrede|CoD4Titel|CoD4Name|CoD4Vorname|CoD4Straße|CoD4Hausnummer|CoD4PLZ|CoD4Ort|CoD4Land|CoD4Geburtsdatum|CoD4Telefonnr.Schuldner|
    CoD5Marktpartnernummer|CoD5Anrede|CoD5Titel|CoD5Name|CoD5Vorname|CoD5Straße|CoD5Hausnummer|CoD5PLZ|CoD5Ort|CoD5Land|CoD5Geburtsdatum|
    CoD5Telefonnr.Schuldner Y|Y|5830,99|EUR|20/08/2009|DCA|4|123456|Herr||Mueller|Rainer|Messigasse|33|84432|Filz|Deutschland|01/07/1957|08912345|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||||||||||||||76543|5000234567||Lease|Privat|12/12/2013|60|12/12/2008||250,50|US|Rate|1234567890|32343450|N||BMW 320 i|W34567890PA34567|M-H-3456|09/12/2008||||||||||||||||||||||||
    N|450,80|EUR|20/08/2009|DCA|4|987654|Frau||Meier|Heide|Beinstr.|44|86353|Laus|Deutschland|03/06/1949|08987654|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||87654||8765675585|Loan|Gewerblich|14/03/2012|72|14/03/2006||500,01|DF|Select|976579657|32343450|N||BMW 500 sl|W94567890PA34568|M-H-3457|10/03/2006|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345
    Y|33970,50|EUR|20/08/2009|Lawyer|4|64646464|Frau||Schmidt|Susanne|Hueftgasse|55|89363|Maus|Deutschland|23/08/1933|08934567|34343434|Herr|Dipl|Meier|Rudolf|Heislestr.|69|85433|Maus|Deutschland|28/05/1945|08934567|234567|Frau|Dr|Mueller|Rita|Messigasse|33|84432|Filz|Deutschland|13/12/1955|08912345|||||||||||||||||||||||||||||||||||||98757|5000785675||Lease|Privat|11/11/2009|48|11/11/2005||380,70|GH|Zielrate|234567899|32343450|Y||BMW 380 s|W54567890PA34569|M-H-3458|07/11/2005||||||||||||||||||||||||
    N|10040,20|EUR|20/08/2009|Lawyer|4|4865465|Herr||Schulz|Karl|Nasenweg|77|83354|Schuh|Deutschland|18/01/1965|08972545|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||46789|50004765787||Lease|Privat|16/09/2012|60|16/09/2007||1234,56|OS|ZUS|98765432|32343450|Y||BMW 280 i|W74567890PA34570|M-H-3459|12/09/2007||||||||||||||||||||||||';
    utl_file.PUT_LINE(v_out_file,v_header,TRUE);
    -- Below will output a row of data which satisfy the requirements.
    FOR body_output IN
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 3
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    LOOP
    UTL_FILE.PUT_LINE (v_out_file,
    body_output.CUSTOMERNUMBER|| '|' || body_output.ACCOUNTNUMBER|| '|' ||body_output.CDTITLE|| '||' ||body_output.CDFIRSTNAME || '|||||' ||
    body_output.CDLASTNAME|| '||||' || body_output.ACCOUNTTYPE|| '|' ||body_output.ORIGINALCONTRACTENDDATE|| '||||' ||body_output.CONTRACTTERM || '|||||' ||
    body_output.CONTRACTENDDATE|| '|' || body_output.BRANCHAREA|| '||' ||body_output.PRODUCTTYPE|| '||' ||
    body_output.HOUSEBANKACCOUNT|| '|||' || body_output.CARMODEL|| '||||' ||body_output.CARLICENCE|| '|' ||
    body_output.ARREARSBALANCE|| '||||' || body_output.CODEBTOR|| '|' ||body_output.GUARANTORnumber);
    END LOOP;
    UTL_FILE.fclose (v_out_file);
    EXCEPTION
    WHEN OTHERS THEN
    UTL_FILE.put_line (v_out_file, 'failed');
    -- If any errors occur when closing the file, then we close the opened file.
    IF utl_file.is_open(v_out_file) THEN
    UTL_FILE.fclose (v_out_file);
    END IF;
    END;
    UPDATE DebtEpisodes
    SET handoverdate = null
    WHERE DCAORLAWYER = 'DCA'
    AND accountid IN
    ( SELECT accountid
    FROM Dcaaccountallocation
    WHERE Dcaaccountallocation.status = 3
    AND Dcaaccountallocation.dcaid = 41
    END LOOP;
    END DCA_BMW_OUT;
    Currently, the above codes issue is that although many rows of data have been inputted in all the tables, with regards to the select criteria above (in italics), it only produces one row of data when i expect more than one to appear.
    If the query only outputs one row but you're expecting it to produce more than one row, then you need to dissect the statement to find out where the output is being unduly restricted
    I was told maybe an outerloop or an inner loop would do the trick, but really stuck on how and where to put it.
    Hope this makes sense guys and I would really appreciate your time.
    Thanks

    if i run this particular code
    ( SELECT
    AccountDetails.CUSTOMERNUMBER, AccountDetails.ACCOUNTNUMBER, CUSTOMERDETAILS.CDTITLE, CUSTOMERDETAILS.CDFIRSTNAME, CUSTOMERDETAILS.CDLASTNAME, AccountDetails.ACCOUNTTYPE,
    AccountDetails.ORIGINALCONTRACTENDDATE, AccountDetails.CONTRACTTERM, AccountDetails.CONTRACTENDDATE, AccountDetails.BRANCHAREA, AccountDetails.PRODUCTTYPE,
    AccountDetails.HOUSEBANKACCOUNT, AccountDetails.CARMODEL, AccountDetails.CARLICENCE, AccountDetails.ARREARSBALANCE, AccountDetails.CODEBTOR, AccountDetails.GUARANTORNUMBER
    FROM AccountDetails
    JOIN CUSTOMERDETAILS ON AccountDetails.CUSTOMERNUMBER = CUSTOMERDETAILS.CUSTOMERS1
    WHERE EXISTS
    ( SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 2
    AND DebtEpisodes.DCASentDate IS NULL
    AND Dcaaccountallocation.ACCOUNTID = AccountDetails.ACCOUNTNUMBER
    AND DebtEpisodes.DCAORLAWYER = 'DCA'
    This returns 1 row of data
    However if i run a small part of the above code...
    SELECT *
    FROM Dcaaccountallocation
    JOIN DebtEpisodes ON DebtEpisodes.ACCOUNTID = Dcaaccountallocation.ACCOUNTID
    WHERE Dcaaccountallocation.dcaid = 41
    AND Dcaaccountallocation.status = 2
    It returns a lot of rows with a status of 2
    Now i presume what I am going to do is to ensure that all the fields provide satisfactory requirements, with regards to the above code. Although I have many records in all the stated tables already.
    :(

  • Flex updates at a row level in a grid

    I needs to updates row level in a grid for frequent basis, Also i don't want to Refresh the Grid.
    Is there any method i can use ?
    Using flex Grid -> updates at a row level in a grid

    I mean DataGrid. I am trying to change the data rows based on realtime data feed.
    First time i'll add all the Employees in the Grid. Later i'll get indivual request will change only Status column.
    Is there is any other way i can update with out refresh in datagrid.
    <mx:DataGrid 
    id="dg" height="260" width="900" x="0" y="20">
    <mx:columns>
    <mx:DataGridColumn headerText="EmpID" dataField="EmpID" width="10" visible="false"/>
    <mx:DataGridColumn headerText="Emp Name" dataField="Emp Name" width="110"/>
    <mx:DataGridColumn headerText="Status" dataField="Status" width="80"/>
    </mx:columns>   
    </mx:DataGrid>

  • Using CL_RSR_WWW_MODIFY_TABLE to remove rows completely from output!

    Hello All,
    I have a problem I am trying to work thru and I need some assistance.
    Here is the issue...
    I have a report, in which I want to completely remove uneeded rows (depending on the contents of the row).
    I have had a look thru the how-to papers on the TAble interface (so please don't post links to those, they are not what I am searching for as they only describe things like not displaying cell contents, and like I stated, I want to not show rows...ie, delete them from output.)
    Does anyone have some code to show me how to accomplish this?
    Here is my scenerio...
    I have a query, from the 0IC_C03 infocube (I understand the IM scenerio, so don't post links to the SAP help for How-to on this subject), and in the query, I have storage location and material. As we all already know, the infocube does not give a good solution to provide values only on Storage location. But, to get around this, you can have a report with Material in the rows, and do a calculation (Price * Qty) to get the totals by storage location. But, I do not want to show the materials. (Yes, I know there is yet another how to paper on realizing inventory on storage location level, but that does not produce correct results).
    The query is doing exactly what I want...here is the results.
    STORLOC____MATERIAL_____VALUE
    <b>LOC1________RESULT_______$200000</b>
    LOC1________MATNR1_______$150000
    LOC1________MATNR2_______$50000
    <b>LOC2________RESULT_______$2500</b>
    LOC2________MATNR3_______$1500
    LOC2________MATNR4_______$1000
    <b>LOC3________RESULT_______$500</b>
    LOC3________MATNR5_______$500
    You get the idea...
    Anyway, I want to turn the above, into the following..
    STORLOC____MATERIAL_____VALUE
    <b>LOC1________RESULT_______$200000
    LOC2________RESULT_______$2500
    LOC3________RESULT_______$500</b>
    Essentially, removing everything but the results rows...
    Now, I have read a few other questions out here on something similiar (someone else was trying to accomplish the same thing) but nobody has ever posted a reasonable answer to the above question, so I am hoping, some of you have a solution, either via defining my own CL_RSR_WWW_MODIFY_TABLE solution or via Javascript.
    If someone has accomplished this with the table interface, which method and how did you change the table?
    If someone has accomplished this with javascript or something else, I would like the details of that as well.
    Note: I was able to read the table, and was able to use a temp table, and remove the rows I did not want, but, I was not able to update the table passed by the interface.
    This code works to get the right rows, but, it doesn't allow me to update the passing table.
    DATA:wa_y_axis_data LIKE LINE OF
      I_r_data_set->n_sx_version_20a_1-axis_data,
      wa_cell_data LIKE LINE OF
      I_r_data_set->n_sx_version_20a_1-cell_data,
      set LIKE LINE OF wa_y_axis_data-set,
      TUPLE_ORDINAL like set-TUPLE_ORDINAL,
      l_counter TYPE i,
      l_index TYPE sy-index,
      l_trade_fvalue LIKE wa_cell_data-formatted_value.
    * prerequesite in example: 1 key figure and 1 calc. key figure column
    LOOP AT I_r_data_set->n_sx_version_20a_1-axis_data INTO wa_y_axis_data
      WHERE AXIS = 1.
      LOOP at wa_y_axis_data-set into set.
       l_index = sy-index.
       if set-chanm = 'A0MAT_PLT' AND set-chavl NE 'SUMME'.
         delete wa_y_axis_data-set where tuple_ordinal = set-tuple_ordinal.
       ENDIF.
      ENDLOOP.
    ENDLOOP.
    Any similiar experiences or feedback is appreciated.
    Cheers!
    /smw

    Hi Steve,
    just want to know why the material has to be present in this report - when not shown in the end - just to have it in the column or why wonder?
    regards, Johannes

  • Alternative to using dynamic variable / NOW () in Content FILTER

    Good morning all,
    Could someone suggest an alternative to using NOW () in the WHERE clause of LTS? Using ExpirationDate>NOW() works, but unfortunately, this request can't be cached (because reports using dynamic statements using NOW () and TODATE () don't get cached).
    I've identified a possible solution - creating a variable that would use first day of current month with this Initialization block:
    SELECT LAST_DAY (ADD_MONTHS (CAST(SUBSTR(SYSDATE,1,10) AS DATE), -1))+1 FROM TIMEDIM_TABLE WHERE CAST(SUBSTR(SYSDATE,1,10) AS DATE)=CALENDAR_DATEAs a result the variable is showing: TIMESTAMP '2009-05-01 00:00:00' in Default Initializer field. This seems to be working - I'm just not sure why not all he reports get cached.
    My question is - is this valid way for this and is there a better way to accomplish this?

    Hy Wildmight,
    Here an article :
    Why a Query is Not Added to the Cache ?
    http://gerardnico.com/wiki/dat/obiee/bi_server/cache/obiee_bi_server_why_no_cache
    If you use a repository variable, the cache work and the entry will be deleted next time you update it.
    Success
    Nico

  • INSERT or UPDATE with multiple rows

    Hi there!
    I want to ask what I should do in the following case: I have to handle mutliple rows of data to insert OR to update into the database.
    The first question is about how to decide whether I should take INSERT or UPDATE. I read here in the forum that I could take a SELECT-statement before, and, if it isn't null, I could update the resultset..if it is null I can make an INSERT-statement.
    But now I a have multiple rows to update or to insert which I want to handle as a transaction (with a batch), so I don't want to check each row the way I described above. Does anyone has a hint ?
    Thanks a lot in advance.

    This is not a problem with java but rather a problem
    with databases in general. The solution generally
    depends on the data that is being operated on.
    If there is a primary key involved, and most records
    were expected to NOT be in the database, then you
    could just insert them in blocks (transaction/batch).
    Each block would fail when a primary key duplicate.
    Then you can process each block as individual
    l statements. The ones that fail are done as
    inserts.
    The reverse of the above is used if you expect most
    records to be in the database. Do updates and the
    break out the blocks with failures to locate the
    inserts.
    Keep in mind that queries for keys probably will be
    faster, but that requires that your keys are ordered.
    If you keys are ordered then you can get a range from
    the initial data. Use that to query the database for
    keys between that range (only return the keys.)
    Using the returned keys you can decide whether each
    h record needs to be an update or insert (presort the
    data into each group and batch each group for more
    speed.)
    If the data is really mixed and the database supports
    it then you can write a stored proc (MySQL does not)
    which decides whether an insert/update is needed.
    Finally if you have large amounts of data, bulk
    operations especially inserts are better done with
    tools supplied by the database vendor. Instead of
    using JDBC to do the insert/updates you write the
    output to a file and pass the file to the tool. You
    might use JDBC (again with the ordered key query) to
    decide which operation to do. Although faster for
    large sets this is problematic due to the error
    handling that you have to add.
    Thanks for this, jschell. I look for your answers, because they're on the money and written well. I learn a lot from them. - MOD

  • Sql server if the row exist it update if the row new won't update

    I am
    working with Asp.net and C# and using SQl Server, I insert a row in one plase and works fine but when I try to update the same row it woudn't do anything, I
    try to update an existing row it works with the same code but not if I just
    insert new row.
    my code as
    below:
    String companyName = txCompany.Text.ToString();
    SqlConnection con =
    new
    SqlConnection(conString);
    SqlCommand cmd =
    new
    SqlCommand("INSERT
    INTO DocUp (CompanyName)VALUES (@CompanyName)", con);
    cmd.Parameters.AddWithValue("@CompanyName", companyName);
    try
    con.Open();
    cmd.ExecuteNonQuery();
    catch (Exception
    er)
    Response.Write("<script language='javascript'>alert('Connection Problem On Insert');</script>");
    finally
    con.Close();
    string strQuery =
    "UPDATE DocUp SET 
    QuoteFileName=@QuoteFileName, ContentType=@ContentType, QuoteFileData=@Data WHERE CompanyName=@Company";
    SqlCommand cmd =
    new
    SqlCommand(strQuery);
    cmd.Parameters.Add("@QuoteFileName",
    SqlDbType.VarChar).Value = filename;
    cmd.Parameters.Add("@ContentType",
    SqlDbType.VarChar).Value =
    "application/pdf";
    cmd.Parameters.Add("@Data",
    SqlDbType.Binary).Value = bytes;
    cmd.Parameters.Add("@Company",
    SqlDbType.VarChar).Value = companyName;
    InsertUpdateData(cmd);
    private
    Boolean InsertUpdateData(SqlCommand
    cmd)
    String strConnString = System.Configuration.ConfigurationManager
    .ConnectionStrings["S7V001_11022014ConnectionString1"].ConnectionString;
      SqlConnection con =
    new
    SqlConnection(strConnString);
    cmd.CommandType = CommandType.Text;
    cmd.Connection = con;
    try
    con.Open();
    cmd.ExecuteNonQuery();
    return
    true;
          catch (Exception
    ex)
    Response.Write(ex.Message);
    return
    false;
    finally
    con.Close();
    con.Dispose();

    Please use the  "Insert code block" button to insert *readable* code blocks 
    try{
    con.Open();
    cmd.ExecuteNonQuery();
    return true;
    You have not shared what query/functions that you are using to insert data. Please share. 
    Also it looks like more like a .Net related questions, (and if you agree,  ) I would recommend posting the question in .Net forum
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
    Also I would recommend you to read "How to ask questions in Technical Forums" from the below link
    Satheesh
    My Blog |
    How to ask questions in technical forum

Maybe you are looking for

  • How do I add my old ipod to a new Itunes account?

    I have an old ipod that has a ton of music on it and i'm trying to sync it to my account for my iphone but have NO idea how to do it.  HELP!!!!

  • CTRL + any other chracter

    In the following simple swing test case, import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFrame; import javax.swing.JTextField; public class MySwingDemo extends JFrame implements KeyListener public MySwingDemo()

  • Safe boot after software updates

    when i install updates from software updates and restart my mac mini, it always goes into safe boot mode. i then have to log in and restart. after restarting everything is back to normal. this problem has been happening since i did a clean install of

  • IDOC Segment Version

    Hi, My requirement is that I need to post an IDOC with segment version 3.1H. I have imported metadata for 6.40 ( I have no choice of picking up the Segment Version while importing in IDX2). I configured receiver IDOC Adapter with Segment Version opti

  • Installing CS2 Production Studio Premium on Windows 7?

    I have CS2 Production Studio Premium. I'm wondering if it will install on Windows 7 - Anyone know?