Toplink locking oracle tables?

Does toplink ever issues a "Lock Table" or "Select xxx From xxx FOR UPDATE"?
I'm getting a oracle error: ORA-00060: deadlock detected while waiting for resource
When I query the v$locks table I can see
SID Type LMODE
252 TM 3
From what I've read this is a table lock. Is TM LMODE 3 a table lock? Or just a row exclusive lock?
http://rahulagarwal.wordpress.com/2006/03/27/locking-in-oracle-dml-locks/

TopLink never issues a Lock table but can issue a SELECT ... FOR UPDATE. The pessimistic locking SELECT ... FOR UPDATE requires the developer to configure its use on a query or through the UnitOfWork API.
Doug

Similar Messages

  • Locking oracle table data

    I have a 3 tables which contains some crucial accounting data. Now I want to lock the data in those tables for 1 financial year(within a period). Locking data refers to not being able to insert, update or delete the data. But i need to view them time to time and my crystal report use that table too. I can restrict the user in my application. But accidently it may happen sometime. You know sql, a single query can modify or delete the whole table. I just want to protect the data even if any accidents happened.
    Can I really do that.
    My oracle version is 8i.
    Thanks in advance

    1. If you are using 11g Release 1 then you can :
    alter table table1 read only;
    alter table table1 read write;
    2. Trigger
    Source:http://www.devx.com/tips/Tip/29396
    Despite that limitation, you can simulate a read-only table by simply preventing all table modifications using a trigger. To do that, create a trigger as follows.
    SQL> create or replace trigger emp_sal_read_only
    2 before insert or update or delete
    3 on emp_sal_tbl
    4 begin
    5 raise_application_error (-20001, 'Table EMP_SAL_TBL is read only,
    You cannot make changes to the data.');
    6 end;
    7 /
    Trigger created.
    Here's a test command that tries to alter the data, and the resulting output:
    SQL> DELETE FROM EMP_SAL_TBL;
    DELETE FROM EMP_SAL_TBL
    ERROR at line 1:
    ORA-20001: Table EMP_SAL_TBL is read only, You cannot make changes to the data.
    ORA-06512: at "SRIDHAR.EMP_SAL_READ_ONLY", line 2
    ORA-04088: error during execution of trigger 'SRIDHAR.EMP_SAL_READ_ONLY'
    HTH
    Girish Sharma

  • Lock a table with toplink

    Hello
    I would like to lock a table with a toplink instruction (ie select for update).
    How to lock the data ?
    Thank in advance.

    You can think of using pessimistic locking if you are wanting SELECT for UPDATE.
    Following documentation will help you in this regard -
    - http://oraclesvca2.oracle.com/docs/cd/B14099_19/web.1012/b15901/dataaccs008.htm
    There is a section on pessimistic locking in that URL.

  • Using OleDbDataAdapter Update with InsertCommands and getting blocking locks on Oracle table

    The following code snippet shows the use of OleDbDataAdapter with InsertCommands.  This code is producing many inserts on the Oracle table and is now suffering from contention... all on the same table.  How does the OleDbDataAdapter produce
    inserts from a dataset... what characteristics do these inserts inherent in terms of batch behavior... or do they naturally contend for the same resource. 
    oc.Open();
    for (int i = 0; i < xImageId.Count; i++)
    // Create the oracle adapter using a SQL which will not return any actual rows just the structure
    OleDbDataAdapter da =
       new OleDbDataAdapter("SELECT BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, " +
       "DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE FROM sysadm.PS_RI_INV_PDF_MERG WHERE 1 = 2", oc);
    // Create a data set
    DataSet ds = new DataSet("documents");
    da.Fill(ds, "documents");
    // Loop through invoices and write to oracle
    string[] sInvoices = invoiceNumber.Split(',');
    foreach (string sInvoice in sInvoices)
        // Create a data set row
        DataRow dr = ds.Tables["documents"].NewRow();
        ... map the data
        // Populate the dataset
        ds.Tables["documents"].Rows.Add(dr);
    // Create the insert command
    string insertCommandText =
        "INSERT /*+ append */ INTO PS_table " +
        "(SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, " +
        "EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) " +
        "VALUES (INV.nextval, :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME,  " +
        ":BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)";
    // Add the insert command to the data adapter
    da.InsertCommand = new OleDbCommand(insertCommandText);
    da.InsertCommand.Connection = oc;
    // Add the params to the insert
    da.InsertCommand.Parameters.Add(":BUSINESS_UNIT", OleDbType.VarChar, 5, "BUSINESS_UNIT");
    da.InsertCommand.Parameters.Add(":INVOICE", OleDbType.VarChar, 22, "INVOICE");
    da.InsertCommand.Parameters.Add(":ASSIGNMENT_ID", OleDbType.VarChar, 15, "ASSIGNMENT_ID");
    da.InsertCommand.Parameters.Add(":END_DT", OleDbType.Date, 0, "END_DT");
    da.InsertCommand.Parameters.Add(":RI_TIMECARD_ID", OleDbType.VarChar, 10, "RI_TIMECARD_ID");
    da.InsertCommand.Parameters.Add(":IMAGE_ID", OleDbType.VarChar, 8, "IMAGE_ID");
    da.InsertCommand.Parameters.Add(":FILENAME", OleDbType.VarChar, 80, "FILENAME");
    da.InsertCommand.Parameters.Add(":BARCODE_LABEL_ID", OleDbType.VarChar, 18, "BARCODE_LABEL_ID");
    da.InsertCommand.Parameters.Add(":DIRECT_INVOICING", OleDbType.VarChar, 1, "DIRECT_INVOICING");
    da.InsertCommand.Parameters.Add(":EXCLUDE_FLG", OleDbType.VarChar, 1, "EXCLUDE_FLG");
    da.InsertCommand.Parameters.Add(":DTTM_CREATED", OleDbType.Date, 0, "DTTM_CREATED");
    da.InsertCommand.Parameters.Add(":DTTM_MODIFIED", OleDbType.Date, 0, "DTTM_MODIFIED");
    da.InsertCommand.Parameters.Add(":IMAGE_DATA", OleDbType.Binary, System.Convert.ToInt32(filedata.Length), "IMAGE_DATA");
    da.InsertCommand.Parameters.Add(":PROCESS_INSTANCE", OleDbType.VarChar, 10, "PROCESS_INSTANCE");
    // Update the table
    da.Update(ds, "documents");

    Here is what Oracle is showing as blocking locks and the SQL that has been identified with each of the SIDS.  Not sure why there is contention.  There are no triggers or joined tables in this piece of code.
    Here is the SQL all of the SIDs below are running:
    INSERT INTO sysadm.PS_RI_INV_PDF_MERG (SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) VALUES (SYSADM.INV_PDF_MERG.nextval,
    :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME, :BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1150 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1156 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX3
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 6 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1726 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 2016 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX2

  • Oracle JDeveloper 10.1.3 Toplink Objects from Table Bug.

    i try this with updates and without them.
    toplink bug or toplink Wizzard Bug: I have create a conection to data base(MySQL) I use mysql-connector and everything works... i see the tables then i try to create "TOplink objects from Table " , choose connection ,for Schema i choose "none". When i choose AutoQuerry it shows the columns i add columns , I choose OK. When it ask for a name for the package i give him mypackage, when it ask for class name i also choose my package.Users(the table is Users) after which i have the following exception in MessageBox:
    "oracle.jdeveloper.cm.ds.db.InvalidNameException : Object must have a name."
    on details i get :
    oracle.toplink.addin.mappingcreation.MWProjectCreationException: oracle.jdeveloper.cm.ds.db.InvalidNameException: Object must have a name.
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:277)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:196)
         at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:416)
         at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: oracle.jdeveloper.cm.ds.db.InvalidNameException: Object must have a name.
         at oracle.jdeveloper.cm.ds.db.validators.AbstractValidator.validateName(AbstractValidator.java:54)
         at oracle.jdeveloper.offlinedb.validators.OfflineSchemaValidator.validateName(OfflineSchemaValidator.java:29)
         at oracle.jdeveloper.cm.ds.db.validators.AbstractValidator.validateObject(AbstractValidator.java:187)
         at oracle.jdeveloper.cm.ds.db.validators.AbstractValidator.validateObject(AbstractValidator.java:122)
         at oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider.validateObject(AbstractDBObjectProvider.java:822)
         at oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider.validateSchema(AbstractDBObjectProvider.java:858)
         at oracle.jdeveloper.offlinedb.OfflineDBObjectProvider.createSchema(OfflineDBObjectProvider.java:1954)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.updateOfflineDBandMWDatabaseWithTablesToMap(MappingCreatorImpl.java:450)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:242)
         ... 4 more
    in the messege log i get :
    Starting Java object generation...
    Creating offline database objects...
    A problem was encountered creating offline database objects.
    Aborted Java object generation.
    Message was edited by:
    JOKe
    Message was edited by:
    JOKe

    I have tried this out in the EA release of JDev, and have reproduced the problem you reported. However, trying out the latest development build, the problem does not occur, so this bug has been fixed. You'll pick up this fix when we next release the software on OTN.

  • Deadlock issue in while inserting in oracle table.

    I have written a procedure which copy data in to oracle tables.Other user can also start inserting in that table so to prevent these intervention.
    i have applied locks on these two tables and assume that my procedure will wait for other users to finish and it will apply lock on the tables and other users will now wait till this procedure finishes.
    My Procedure looks like:--
    lock table table1 in exclusive mode;
    lock table table2 in exclusive mode;
    update table1 set where rownum < x;
    forall .....insert in table 2.
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_printline(SQLERRM)
    commit;
    END;
    But my problem is i am still receiving oracle error as below and the above procedure fails in between:-
    ORA-00060: deadlock detected while waiting for resource
    Any hint ??
    Can we get this error if i execute a SELECT statement on some table which is not locked by me and some other other is updating/deletig/inserting in that table ?
    *Select statement is without update clause.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    user620101 wrote:
    I have written a procedure which copy data in to oracle tables.Other user can also start inserting in that table so to prevent these intervention.
    i have applied locks on these two tables and assume that my procedure will wait for other users to finish and it will apply lock on the tables and other users will now wait till this procedure finishes.
    My Procedure looks like:--
    lock table table1 in exclusive mode;
    lock table table2 in exclusive mode;
    update table1 set where rownum < x;
    forall .....insert in table 2.
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_printline(SQLERRM)
    commit;
    END;
    But my problem is i am still receiving oracle error as below and the above procedure fails in between:-
    ORA-00060: deadlock detected while waiting for resource
    Any hint ??But if you successfully lock TABLE1 (in session #1) and another session (session #2) is holding a lock against TABLE2 (say it's currently updating a row) then session #1 has to wait when you issue the Lock table command for table2. So session #1 is waiting, and then session #2 tries to do ANY modification to TABLE1 (which session #1 still has locked, and is still waiting to obtain the lock on TABLE2)... whamo, deadlock.
    user620101 wrote:
    Can we get this error if i execute a SELECT statement on some table which is not locked by me and some other other is updating/deletig/inserting in that table ?
    *Select statement is without update clause.No, writes (and locks) do not block reads. So a simple select statement (unless you issued a FOR UPDATE clause) would not cause this issue.
    What does your actual code look like, and what are you actually attempting to do? Why do you think you need to lock the tables, is this a one time operation, a continual operation of the system? Please explain in much more detail what you've got going on here.

  • ORA-00054 error when loading Oracle table using Data Services

    Hello,
    we are facing ORA-00054 error when loading Oracle table using BO Data services
    (Oracle 10g database, BODS Xi 3.2 SP3)
    Test Job performs
    1- truncate table
    2- load table (tested in standard and bulk load modes)
    Scenario when issue happens is:
    1- Run loading Job
    2- Job end in error for any Oracle data base error
    3- When re-running the same Job, Job fails with following error
         ORA-00054: resource busy and acquire with NOWAIT specified
    It seems after first failure, Oracle session for loading the table stays active and locks the table.
    To be able to rerun the Job, we are forced need to kill Oracle session manually to be able to run the Job again.
    Expected behaviour would be : on error rollback modifications made on table and BODS stops Oracle session in a clean way.
    Can somebody tell me / or point me to any BODS best practice about Oracle error handling to prevent such case?
    Thanks in advance
    Paul-Marie

    the ora-0054 can occure depending how the job failed before. If this occures you will need the DBA to release the lock on the table in question
    Or
           AL_Engine.exe on The server it creates the Lock. Need to Kill Them. Or stop it..
    This Problem Occurs when we select The Bulkloading Option in orclae  We also faced the same issue,Our admin has Killed the session. Then everything alright.

  • Shrink Oracle Table after Deletion

    A few database tables are very big. An Oracle table still holds the disk space occupied by deleted records according to http://stackoverflow.com/questions/6540546/oracle-10g-table-size-after-deletion-of-multiple-rows. Re: shrink table after delete teaches the following commands to release the idle space from the table.
    ALTER TABLE TABLE1 DEALLOCATE UNUSED;
    ALTER TABLE TABLE1 ENABLE ROW MOVEMENT;
    ALTER TABLE TABLE1 SHRINK SPACE;
    ALTER TABLE TABLE1 MOVE;
    1. Are the commands feasible?
    2. Are they safe?
    3. What will be the impacts of running the commands?
    4. Is there any other workable safe approach shrinking a table?

    Hi,
    I advise using shrink table operation.
    The tablespace which belong to your table must be in ASSM (Automatic segment space management) to use shrink.
    Shrink is safe but you need to run two commands :
    1)ALTER TABLE TABLE1 SHRINK SPACE COMPACT; (This is long operation which moves data, but can be done online)
    2)ALTER TABLE TABLE1 SHRINK SPACE; (this is quick if you run SHRINK SPACE COMPACT before, it only shift the High Water Mark. Be carreful if you don't run SHRINK SPACE COMPACT before your table will be locked for a long time)
    Another point, is that execution plans are calculed using the HWM so SHRINK the table (The 2nd command) will invalidate all the cursors in shared pool where the table is in. So execution plan need to be recalculated (often not a problem).
    Regards,

  • Problem related to locking the table

    Hi all,
    i am facing a problem while applying locks on the oracle table.my intention is stop the accessing of table to other users, if the table is locked by one user.
    for this i wrote the code as follows
    Class.forName("oracle.jdbc.driver.OracleDriver");       con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.2.123:1521:xe",         "root", "paridb");   con.setAutoCommit(false);             System.out.println("Successfully connected to " +           "Oracle server using TCP/IP..."); String lock="lock table report@xe in exclusive mode";-------------------------------------->1  query to lock the table Statement stmt1=con.createStatement(); stmt1.executeUpdate(lock); System.out.println("lock is applied"); Statement stmt=con.createStatement();                 for(int i=0;i<6;i++)         {         sql="insert into report values(1921682123,'device','host')";         stmt.executeUpdate(sql);         }
    after locking i inserted some data into table, after insertion i am not commiting it because if i commit,the lock will be release.next i am trying to insert data into that table from another system,acutually the data don't insert.but data is inserted. how it is happening like that ??
    in another scenario, if execute the locking query on the database directly then trying to insert into database through java application, at that time it is not giving permission to access table.
    plz guide me
    thanks&regards,
    nagaraju

    Hi! Thank you so much for your reply. Yes, I´m using ADF. I attach you the iterator´definition from the page definition:
    <iterator id="MovimientosCtbView3Iterator" RangeSize="10"
    Binds="MovimientosCtbView3" DataControl="AppModuleDataControl"/>
    If I set the RangeSize to 11, the problem is solved, but my project manager want to find out why this situation happens with RangeSize=10.
    Thank you so much and sorry for bothering you

  • Lock the table by user with grant only for select

    Hallo.
    It is possible that the user has rights only for SELECT, do not lock the table? Now, where do "SELECT * FROM table FOR UPDATE", does not make the change, but it locks the entire table, and another user to get into it.
    Thanks

    And here is the "evidence" ;)
    SQL> select * from v$version ;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> create user u1 identified by u1 ;
    User created.
    SQL> grant connect to u1 ;
    Grant succeeded.
    SQL> connect hr/hr
    Connected.
    SQL> create or replace view v_t1 as select username, user_id, created from t1 group by username, use
    r_id, created with read only ;
    View created.
    SQL> grant select on v_t1 to u1 ;
    Grant succeeded.
    SQL> connect u1/u1
    Connected.
    SQL> select * from hr.v_t1 where rownum = 1 for update ;
    select * from hr.v_t1 where rownum = 1 for update
    ERROR at line 1:
    ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc.
    SQL> select * from hr.v_t1 where rownum = 1
      2  ;
    USERNAME                          USER_ID CREATED
    AK                                     36 08-MAY-00

  • Renaming Oracle Tables in Production

    If you need to rename Oracle tables in Production, then which process is most effective:
    A.
    LOCK TABLE xxx IN EXCLUSIVE MODE
    RENAME xxxTO new_name;
    Table renamed.
    B. dbms_redefinition
    C. other ...
    THANK YOU !!

    All we can say is that dmbs_redefinition is an option to consider. Only the OP knows his environment, what kind of window the work will have to be done in, and the timing issues between the renames and moving in new code. Such as in the case where you need the new object names in place to perform java compiles to move in new classes.
    At my current job we would take a window and shut the database down, bring it up in restricted mode, perform the renames of the tables (and associated indexes for standard purposes), move the code into place, and then test. Full testing might require unrestricting the system or we might be able to just grant restricted session to a few users. Once we are satisified we would fire up our daemon processes and then release the batch schedule.
    IMHO -- Mark D Powell --

  • Jython error while updating a oracle table based on file count

    Hi,
    i have jython procedure for counting counting records in a flat file
    Here is the code(took from odiexperts) modified and am getting errors, somebody take a look and let me know what is the sql exception in this code
    COMMAND on target: Jython
    Command on source : Oracle --and specified the logical schema
    Without connecting to the database using the jdbc connection i can see the output successfully, but i want to update the oracle table with count. any help is greatly appreciated
    ---------------------------------Error-----------------------------
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 45, in ?
    java.sql.SQLException: ORA-00936: missing expression
    ---------------------------------------Code--------------------------------------------------
    import java.sql.Connection
    import java.sql.Statement
    import java.sql.DriverManager
    import java.sql.ResultSet
    import java.sql.ResultSetMetaData
    import os
    import string
    import java.sql as sql
    import java.lang as lang
    import re
    filesrc = open('c:\mm\xyz.csv','r')
    first=filesrc.readline()
    lines = 0
    while first:
    #get the no of lines in the file
    lines += 1
    first=filesrc.readline()
    #print lines
    ## THE ABOVE PART OF THE PROGRAM IS TO COUNT THE NUMBER OF LINES
    ## AND STORE IT INTO THE VARIABLE `LINES `
    def intWithCommas(x):
    if type(x) not in [type(0), type(0L)]:
    raise TypeError("Parameter must be an integer.")
    if x < 0:
    return '-' + intWithCommas(-x)
    result = ''
    while x >= 1000:
    x, r = divmod(x, 1000)
    result = ",%03d%s" % (r, result)
    return "%d%s" % (x, result)
    ## THE ABOVE PROGRAM IS TO DISPLAY THE NUMBERS
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number( "#lines ") where load_audit_key=418507"
    sqlstring.executeQuery(sqlstmt)
    sourceConnection.close()
    s0=' \n\nThe Number of Lines in the File are ->> '
    s1=str(intWithCommas(lines))
    s2=' \n\nand the First Line of the File is ->> '
    filesrc.seek(0)
    s3=str(filesrc.readline())
    final=s0 + s1 + s2 + s3
    filesrc.close()
    raise final

    i changed as you adviced ankit
    am getting the following error now
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 37, in ?
    java.sql.SQLException: ORA-00911: invalid character
    here is the modified code
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number('#lines') where load_audit_key=418507;"
    result=sqlstring.executeUpdate(sqlstmt)
    sourceConnection.close()
    Any ideas
    Edited by: Sunny on Dec 3, 2010 1:04 PM

  • Best Practice to fetch SQL Server data and Insert into Oracle Tables

    Hello,
    I want to read sqlserver data everry half an hour and write into oracle tables ( in two different databases). What is the best practice for doing this?
    We do not have any database dblinks from oracle to sqlserver and vice versa.
    Any help is highly appreciable?
    Thanks

    Well, that's easy:
    use a TimerTask to do the following every half an hour:
    - open a connection to sql server
    - open two connections to the oracle databases
    - for each row you read from the sql server, do the inserts into the oracle databases
    - commit
    - close all connections

  • Insert /delete data from SAP Z table to Oracle table and opposite

    Hi,
    Can u help me write this FM from the SAP side?
    So, I have two tables ZTABLE in SAP and Oracle table ORAC.
    Let's put three columns in each of them, for example
    TEL1
    TEL2
    ADRESS
    NAME
    where TEL field is primary from ZTABLE to ORAC...
    (in FM there shoud be abap code for writing data in ZTABLE after we press some pushbutton made in sap screen painter..)
    for example, when we write new record in ZTABLE
    00
    112233
    Street 4
    Name1
    this data shoud be inserted in Oracle table ORAC.
    when we write new record in Oracle table for example
    01
    445566
    New Street
    Name2
    this data shoud be inserted in ZTABLE.
    Field TEL1 can be only of two values 01 or 02, other combination is not valid...
    I must have all data from Oracle table ORAC in ZTABLE and opposite.
    It should be the same scenario for DELETE...
    And this communication should be online between sap and table in oracle database...
    Can u help me from sap side? and give idea how to configure on oracle side??
    Thanks a lot,
    Nihad

    I dont know if we can directly connect to a oracle database ( wait for the answers from others on this )
    but in XI we have the JDBC adaptor to insert and retrieve data.
    so for the outbound from SAP the flow can be something like this (with XI in landscape):
    1) You have a screen to maintain a new entry / delete an entry
    2) On save , this record gets saved or deleted from the Ztable in SAP
    3)) In the same screen you can call a proxy class-method (generated using SPROXY transaction ) to send the record to XI.
    4) XI to format it and insert into the oracle table
    Mathews

  • XML file to Oracle Table

    Hello friends,
    Can you please help me with the following requirements?
    I have a xml structure like this
    <?xml version="1.0"?>
    <data>
    <var name="document">
    <string>Sales Order</String>
    </var>
    <var name="results">
    <recordset rowcount="2">
    <field name="sales_num">
    <string>12345</string>
    <string>A0192</string>
    </field>
    <field name="ord_qty">
    <string>10</string>
    <string>50</string>
    </field>
    </recordset>
    </var>
    </data>
    I have to read this xml file and copy the data to the Oracle table
    Sales Table
    CREATE TABLE SALES
    SALES_NUM VARCHAR2(20 BYTE),
    ORD_QTY NUMBER(4)
    Expected Result
    x. Sales Num Ord Qty
    1. 12345 10
    2. A0192 50
    I tried to follow the approach provided in this link http://www.oracle-base.com/articles/9i/ParseXMLDocuments9i.php . But it doesn't work with the XML structure I have.
    Thanks,
    Mahesh

    please let me know the solution as well. i need this

Maybe you are looking for

  • I can't get my Dynamic PDF Widget to work in Captivate 7

    Hello all, I've been trying to get my Dynamic PDF to work in my Captivate 7 project. I have created a button on the final slide where I want the user to open the PDF, I have named it correctly to correspond with the Dynamic PDF. I have also updated e

  • Javax.servlet.* Not Found Error - Please help

    I am having a great deal deal of trouble trying to compile a program using javax.servlet and javax.servlet.hhtp.*. I have setup the JAVA_HOME and the CLASSPATH variables as per the Installation instructions. I appear to have hit a brick wall and I am

  • Data display

    Hi, When user runs the report R5800073 (Ver WAL0001) for the document number 338405,he will get the csv output,In the CSV output, there is one column problem details2 in which data is appearing in the second line instead of appearing in the current l

  • Query on Multiprovider

    Hi, I build a query on a Multiprovider which contains 3 InfoCubes. In my Query I have only one Key Figure and several characteristics. I know from which InfoCube my Key Figure come from, therefore I add the characteristic Infoprovider to the Filter a

  • A3 Can't import GPX Data from MacGPS Pro

    I'm on a trip trying out A3 for the first time. I have a Garmin 76CSx and normally import my track logs into MacGPS Pro 8.6.0 I same the track logs as GPX files and then import them into A3. Early in the trip, I could see the track in the Map in A3,