Updating a mysql table from several machines

Hi,
I have a big table with about 100,000 records (fileID, etc) and I need get the fileID from this table, then analyze the files, and making new tables based on the results.
Since the table is huge, I want to do the analysis on multiple machines.
Currently, I use "Limit start, offset" to select 1000 fileIDs per SELECT and do things with it in one machine.
The problem is that if I run the same code in another machine, it may select the duplicated records.
Is there a way that I can "Lock" the selected rows from other machines (not only lock the UPDATE, but also lock the READ so other machine will not do the redundant work)?
Thanks for your attention.
Iper

I think it would be better to multi-thread your processing solution instead of running on multiple solutions.
If you really must run on different machines then you'll have to come up with a better way. Something whereby you only fetch the result set from one machine and then divide it up from there would be one way.

Similar Messages

  • Update the z table from the header text of VF01 on save

    Hi All,
    I have a  Z table 'ZEXIM_LICDETAILS'. Whenever a billing doc. of type 'ZEXP' is created with tcode VF01, the Z table fields should also be updated. I have learned that we cannot include tabs in Billing Doc, so the licence number is put in the header text of the VF01.
    Is there any way that I can update my Z table from header text, when we save the VF01.
    Waiting for your repy in anticipation.
    Thanks a lot in advance,
    Anu

    Write code in USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)
    Reddy

  • Is it possible to export (expdp) oracle table from client machine ?

    Is it possible to export (expdp*) oracle table from client machine, without using Remote desk top connection ?*
    1) Database-10g server is in America
    2) client machine is in India
    3) Oracle client-10g software is installed in my machine
    4) I am able to connect to the server, could see all tables
    5) one table is with 35 million record, I wanted to export this table using data pump, is it possible?
    note: without using Remort desk top connection.

    Hi
    I used the following syntax , but I am getting error
    6) connect sys as sysdba
    create directory test_dir as '/dbusr1/exp_test'
    grant read, write on directory test_dir to user1;
    7) expdp user1/pwd1@xyz tables=test_1 directory=test_dir dumpfile=test_file.dmp logfile=test_file.log
    8) Errors
    In linux prompt I am getting this error
    -bash: expdp: command not found
    In windows cmd prompt I am getting this error
    ORA-39002: invalid operation
    ORA-39070: Unable to open the log file.
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE";, line 488
    ORA-29283: invalid file operation
    9) why ?
    -- Does the user ( "user1") should have any system level privilege ? to export his own table?
    -- This folder ('/dbusr1/*exp_test'*) has write privilege in os level.
    Thanks in advance
    sbmk_design
    Edited by: sbmk_design on Aug 24, 2009 12:06 AM

  • Updating a standard table from a custom tableq

    hi to all experts,
    My requirement is to update a standard table from the maintenance screens of the custom table whatever the data the user maintains in the custom table and save should automatically saved in the standard table
    for that i decided to use the table maintenance events (event 05 ) ( while saving data) how to capture the data from the screens to the form of the table maintenance events.

    Hi gautham,
    The requirement is like that actually user want to maintain value in z table ( with one extra field ) . the table updation of table is important

  • Accessing tables from remote machine

    I using the following code, to update the record from the emp table. This table is created locally in my machine.
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn;
    String db = "jdbc:odbc:NewDsn";
    String username = "test";
    String password = "test";
    String tableName = "emp";
    conn = DriverManager.getConnection(db, username, password);
    Statement stmt1 = conn.createStatement();
    String update = "update " + tableName +
    " set salary=salary+1000 where empid>200";
    stmt1.executeUpdate(update);
    I want my application to run on two different machine and the update should be made on a single table.
    Please help me, how the user from other machine can access this emp table created in my local machine?

    I completely agree with RPriya.
    jschell, If you think that it is not correct, could you please put some focus on your statementYou mean you want me to explain how database connections work in general and how jdbc drivers would use them?
    Do you know how a socket works? Do you know that it requires a client and a server?
    How does a socket work if there is no server?
    How do database connections work in C, C++, Perl, Ruby, Python, VB, etc, when absolutely none of those use a java type 4 driver?
    Do you know how the oracle oci driver work? It is not a type 4 driver.
    Do you know how the jdbc-odbc bridge works with oracle? With MS SQL Server? The jdbc-odbc bridge is not a type 4 driver.

  • Update or delete table from XML

    Is it possible to update or delete table's row from XML file?
    Thanks
    Prasanta De

    Hi Steve,
    Thanks for your reply but I could not find any example from the documentation for update-request or delete-request. I need your help in this regards.
    1. I have emp table with many rows and the simple structure like this
    DEPTNO NUMBER(2)
    EMPNO NUMBER(2)
    EMPNAME VARCHAR2(20)
    EMPSAL NUMBER(8,2)
    Key is defined on deptno and empno
    2. I have a xml file like this
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>1</DEPTNO>
    <EMPNO>11</EMPNO>
    <EMPSAL>1111.11</EMPSAL>
    </ROW>
    <ROW num="2">
    <DEPTNO>1</DEPTNO>
    <EMPNO>12</EMPNO>
    <EMPSAL>2222.22</EMPSAL>
    </ROW>
    <ROW num="3">
    <DEPTNO>1</DEPTNO>
    <EMPNO>13</EMPNO>
    <EMPSAL>3333.33</EMPSAL>
    </ROW>
    </ROWSET>
    3. I want that xsql servlet will read this xml file and update EMPSAL column depending upon the value of DEPTNO and EMPNO from xml file.
    Please let me know how I should use update-request in xsql page.
    Thanks
    Prasanta De
    null

  • How to rip CDs into iTunes from several machines, simultaneously

    I have about 300 CDs that I'm re-ripping into my library for two reasons (1) I had a hard drive failure that corrupted / lost some of the files and (2) I'm shifting from MP3 to Apple Lossless format.
    Setup: MacMini is linked to entertainment center for iTunes playback but I ahve 2 other Macbooks on network. iTunes library is on an external hardrive connected to mini via firewire --accessible to macbooks via network.
    Issue 1: Can I load the iTunes library from the external hard drive on each of the three machines, then have each of the three re-rip CDs simultaneously to overwrite the old files? After the CDs have been re-ripped, I'd just tell iTunes on the MacMini rebuild the library so that it knew the actual file types for the CDs imported by the macbooks.
    Issue 2: I want to overwrite existing songs (1) to avoid duplicate files and (2) I've misplaced / stored a couple hundred other CD's, so I can't just erase the old library, rip from three machines, then import into the mini b/c that would be a large loss of CDs.
    My plan would as follows, but I'm not certain if it will work or if it's the best way:
    1. Erase the iTunes library (not the files) on all three machines for a clean start.
    2. On Each machine, Preferences -> Advanced -> General: Set the iTunes music folder to the external drive where the current music files are located. Also set each computer to "Keep Music Folder Organized" and "Copy files to iTunes Music Folder..."
    3. on Each machine, select File -> Add to Libary: to add all of the current music files.
    4. Start simultaneously shoving my CDs into the three machines and re-importing using lossless / telling it to overwrite existing files when prompted.
    5. When done re-importing the CDs, erase the macbook libraries (I don't listen to music on them), tell the mac mini to erase it's library, then re-add all the newly ripped files and the preexisting/not-overwritten files to the library to rebuild it, so that the mini becomes aware of the files that were added / rewritten by the other two machines.
    While none of the three machines would be ripping the same CD or trying to overwrite the same music files at the same time, my concern is that all three machines would run into problems if trying to update / write to the same iTunes non-music file, for example the iTunes Libarary Database file of the iTunes Library.xml file on the external drive.
    Comments? Suggestions? Experiences?
    Thanks,
    mjc

    I have about 300 CDs that I'm re-ripping into my library for two reasons (1) I had a hard drive failure that corrupted / lost some of the files and (2) I'm shifting from MP3 to Apple Lossless format.
    Setup: MacMini is linked to entertainment center for iTunes playback but I ahve 2 other Macbooks on network. iTunes library is on an external hardrive connected to mini via firewire --accessible to macbooks via network.
    Issue 1: Can I load the iTunes library from the external hard drive on each of the three machines, then have each of the three re-rip CDs simultaneously to overwrite the old files? After the CDs have been re-ripped, I'd just tell iTunes on the MacMini rebuild the library so that it knew the actual file types for the CDs imported by the macbooks.
    Well, yeah, this wold work, in 1/3 the time. If you have changed ANYTHING about a song title, album title or artist, iTunes will not see it as a duplicate.
    Issue 2: I want to overwrite existing songs (1) to avoid duplicate files and (2) I've misplaced / stored a couple hundred other CD's, so I can't just erase the old library, rip from three machines, then import into the mini b/c that would be a large loss of CDs.
    So, some of the MP3's won't be AAC's in the end?
    My plan would as follows, but I'm not certain if it will work or if it's the best way:
    1. Erase the iTunes library (not the files) on all three machines for a clean start.
    Right Click/Duplicate first, just in case. OR (better method) hold the Option key while opening iTunes and choose create new library.
    2. On Each machine, Preferences -> Advanced -> General: Set the iTunes music folder to the external drive where the current music files are located. Also set each computer to "Keep Music Folder Organized" and "Copy files to iTunes Music Folder..."
    3. on Each machine, select File -> Add to Libary: to add all of the current music files.
    4. Start simultaneously shoving my CDs into the three machines and re-importing using lossless / telling it to overwrite existing files when prompted.
    If you have changed ANYTHING about a song title, album title or artist, iTunes will not see it as a duplicate.
    5. When done re-importing the CDs, erase the macbook libraries (I don't listen to music on them), tell the mac mini to erase it's library, then re-add all the newly ripped files and the preexisting/not-overwritten files to the library to rebuild it, so that the mini becomes aware of the files that were added / rewritten by the other two machines.
    On the three machines, hold the Option Key while opening iTunes and choose the original library, then delete the new library file you created for this adventure. Then do the same to create a new library on the MacMini. If you have created playlists, first export each playlist as a .xml file and import it when finished.
    While none of the three machines would be ripping the same CD or trying to overwrite the same music files at the same time, my concern is that all three machines would run into problems if trying to update / write to the same iTunes non-music file, for example the iTunes Libarary Database file of the iTunes Library.xml file on the external drive.
    They will each be creating their own unique library database, missing what the other two machines are adding to the iTunes Music Folder. They will not be re-writing the .xml file on the external hard drive. Each computer will have it's own .xml file on it's hard drive.
    Tracy

  • No. of containers not updating in QALS table from goods receipt

    Hi all,
    I am working on below requirement for client.
    I am releasing a process order and then saving it. With this, an inspection lot is created in QALS table automatically.
    Then I am doing Goods receipt through MIGO.
    While doing goods receipt, I am entering no. of containers in quantity tab on item level (GOITEM-ANZGEB), but the same is not getting updated in QALS table (QALS-ANZGEB).
    Is there any configuration setting needs to be done to activate the update of no. of containers in QALS table from MIGO transaction?
    P.S. - Sometimes we use MB31 also to do goods receipt. In that also, there is no. of containers field.
    Thanks in advance,
    Sachin

    Hi Sachin,
    what is the solution for this .? Can you explain?
    Ram

  • Updates to the table from the database level.

    Hi Dear All,
    If we do some updates to the table at the Database Level, like i deleted some records from the table at the Oracle level. But I'm still able to see the same deleted records from the Data Dictionary(SE11) at the application level.
    Can you pl explain the mechanism, that how it is possible and why.
    best regards
    Mahesh

    transparent tables store data directly....if you delete some data from transparent tables, the same is reflected in the database (oracle) but the reverse is not true...if you modify the database table contents directly...the dictionary table remains intact...
    transparent tables have a one-to-one relationship with the database tables....
    hope that clarifies a bit....
    (somebody correct me if i am horribly wrong)

  • Update Columns in Table from Other Table based on Fund Code

    Hello All!!
    Hope you are doing good!!!
    I like to update 5 columns in X Table based on fund_code. The Fund code and 5 column values come from Y Table. Please let me know how to wirte a sql statement to update all values for 5 columns in X Table. Please post me any template code.
    Thanks.

    I think you are looking for an updatable join,
    Please see the syntax below,
    UPDATE (SELECT b.col1
              FROM table1 b, table2 E
             WHERE b.col_pk = E.col_pk) T
       SET T.col1 = 0Thanks,
    G.

  • Export table from client machine

    Hi,
    I want to export a table ( using exp or expdp ) from client machine. Dump file should be created to client machine.
    Is this possible ? How to do this ?
    Thanks in advance,
    Viraj

    Hi,
    Yep as Nilet says you can use the old exp utility - it's not installed by default so you may have to do a full admin client install - or select the tools option from a custom install.
    Cheers,
    Rich

  • Optimize MySQL table from Java

    Hi everyone,
    I was wondering if it's possible to run the optimize command on a mysql database table from within java?
    If so, does anyone have any code?
    Thanks,
    BBB

    assuming you have a table called myTable the code should look like...
    Connection c =// from somewhere
    Statement s = c.createStatement();
    s.execute("OPTIMIZE TABLE myTable");
    s.close();please note all the following...
    1) MySQL will lock the table when you optimize the table so if there are open locks this could deadlock while waiting. Also all other queries to be performed on the table will wait, just a performance warning.
    2) The logged-in user must have both SELECT and INSERT permission on the table to execute an OPTIMIZE.

  • Need to update column in table from joining the two tables

    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_date
    Thanks

    Hi,
    Welcome to the forum!
    876466 wrote:
    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.Exactly!
    (   SELECT  a.deposit_date
        FROM    ...returns all deposit_dates.
    (   SELECT  MAX (a.deposit_date)
        FROM    ...would return only the latest one.
    Also, you need to correlate the sub-query to the main query, so that it only looks for rows with the same ban.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_datePerhaps you need something like this:
    UPDATE  table2     b
    SET     deposit_date     =
             (    SELECT  MAX (a.deposit_date)
                   FROM      table1           a
               WHERE      a.ban          = b.ban
               AND      a.deposit_date BETWEEN b.cy_start_date
                               AND     b.due_date
    ;Notice that table1 is the only table in the FROM clause of the sub-query, but the sub-query is correlated to table2, so we can reference columns from table2 in the sub-query.
    Whenever you have a problem, post CREATE TABLE and INSERT statements for your sample data.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using.
    Edited by: Frank Kulash on Aug 1, 2011 1:58 PM

  • How can I update a customized table from a text document?

    Hi,
    I am one sample file. The file is an text document. From this .txt file how can I update a customized table in SAP.
    How can I Update the fields in the Customized table.
    Thanks & Regards,
    NManohar.

    use the Function module GUI_UPLOAD or WS_UPLOAD and give the path and the file name from where the data has to be uploaded. in table parameter give the iternal table
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      =
      FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = ' '
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      tables
        data_tab                      =
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    and finally use insert command to update the database table with the data

  • Java connector to update an R3 table from XI

    Hi,
    Is it possible to use java connector to update an R3 table?
    For instance, an 850 was sent to XI from R3 . 
    XI will then update/create a new entry in the R3 table using the Purchase Order ID, Shipment ID and Material number obtained from the 850.
    I have tried using jco only to read a table but not to update a table.
    Thanks a ton!

    Hi,
    Use lookup and in the function module write ur code to update/crreate.
    Refer the below weblog:
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    chirag

Maybe you are looking for

  • Parallels 7 or boot camp on snow leopard

    I own a MacBook Pro 13 [mid 2009]. I've upgraded it to 8gb ram. My problem is I'm not able to decide if I should install windows 7 using parallels 7 or boot camp. Also will it slow down the machine. And I also need help in installing windows7.

  • Batch Monitor troubles - no progress

    I'd like to export a project from final cut pro (6.0.4) with compressor (3.0.4), as I did about 50 times before. Compressor opens, I choose my settings and click "send". Batch Monitor opens and that's it. No progress in Batch Monitor, no encoding, no

  • Where to keep the samples?

    I have run out of room on my primary hard drive and want to move my samples to a second hard drive. What do I have to do to make Logic find the samples in the new location?

  • Why is my mac a lot slower after updating to 9.2. ?

    Hi! My Mac is so much slower after updating it to 9.2., I installed Java but I read at some forums I should delete it, but I dont know how. Can somebody help me? My system review in Etrecheck is: Hardware Information:           MacBook Pro (13-inch,

  • Upgrade internal hard disk on ibook G4

    Hello, I am interested in upgrading the internal hard disk of my ibook G4 from 40GB to something better. Is there an Apple service centre in bangalore, India which will do the upgrade? what manufacturer/model# of HDD will be suitable for my 2005 iboo