OWB won't generate an UPDATE statement

I have a mapping which I am attempting to do a MERGE (UPDATE/INSERT) statement on. The mapping validates, however, when I generate the SQL for the mapping, it does not generated the MERGE statement SQL. It is like the portion of the mapping does not even exist. I went ahead and tried to do a simple UPDATE statement, and the same problem exists...it will not generate the portion of the mapping that I try to do the UPDATE statement on. I can do an insert statement and the code will be generated, but the UPDATE is a problem.

I have the same problem.
I use one source table and one target table (ID filled by a sequence, another column is the unique key)
I want to use the INSERT/UPDATE as loading type, but OWB creates only an INSERT statement (without an update) and no MERGE-statement.
If I use the UPDATE/INSERT as loading type, OWB creates two cursors (update and insert).
What's going wrong?
And why doesn't OWB create a merge-statement??
I've created mappings like this one and that worked fine.
Is it a bug in OWB?
(And when I delete the sequence, still the same (wrong) result)
Regards,
Maurice

Similar Messages

  • Topink 9.0.4 not generating an update statement, if the object was changed.

    I have 2 tables T_Objects and T_Categories.
    T_Objects stores images as a BLOB field. T_Categories stores the details of an article category and references the pictogram in T_Objects via a FK.
    I have 2 webpages. One which is used to load the pictogram in T_Objects and the other which is used to maintain details of the category in T_Categories. As soon as the image is uploaded and is displayed on the screen, user fills in the category details and saves them.
    Each of these operations is performed in a seperate HTTP Request (and consequently seperate UOW). The idea is that the user first uploads an image, checks the image on the screen and the decides to associate it with a category.
    The database is Oracle 9i. Driver used is OCI 8. Binary Steam Binding is enabled for BLOB fields. DatabasePlatform is Oracle9Platform.
    The descriptors of both the tables use SoftCacheWeakIdentity and the cache size is 100. Both tables use Optimistic Locking based on a version field using TimestampLockingPolicy.
    Coming to the problem, if the delay between the upload of the image and saving of the category details is large (say 20 seconds or so) Toplink generates a Update query to update the details in T_Categories. If the delay is smaller than that then Toplink fails to generate an update query even if the object was changed. Upon debugging I find that just before the commit, the BO being committed has all the correct details including the new PK of the uploaded image.
    Assuming that the BO pointing to T_Objects may not be in Cache (owing to images of size 200+ KB) I did an explicit read of this object before attempting to save details to T_Categories. Even that does not seem to help.
    Any ideas on what is happening here?

    Chris. Thanks for your reply. I did not get your point. However these are the steps being done.
    Can you please go through the code and check what could be wrong?
    Steps
    1) createContent(VmTObjectsVO vo) is called to insert into VM_T_OBJECTS.
    This internally calls create ( Object obj, UnitOfWork uow, boolean commitChanges )
    2) update( VmSubcategoriesVO vo ) is called to update a sub-category details to VM_T_SUBCATEGORIES.
    This internally calls save( Object bo, UnitOfWork uow, boolean commitChanges )
    In the save method at the time of uow.commitAndResume() no update statement is getting generated.
    These core methods are used for almost all tables in the application and all of them work.
    It is only in this use case I have a problem.
    * Creates a new entry for storing the image/document in VM_T_OBJECTS.
    * @param vo the content to be stored.
    * @return the sequence assigned to this object.
    public Long createContent(VmTObjectsVO vo){
    VmTObjectsVO voSaved = null;
    Long lnContentId = null;
    if(vo != null){
    VmTObjectsBO bo = new VmTObjectsBO();
    /* copy the properties from the VO to the BO. */
    ObjectAssembler.vo2bo((BaseVO)vo, bo);
    /* Create the content */
    lnContentId = create(bo);
    return lnContentId;
    * updates a subcategory to VM_T_SUBCATEGORIES
    * @param vo VmSubcategoriesVO to update.
    * @ return updated VmSubcategoriesVO
    public VmSubcategoriesVO update( VmSubcategoriesVO vo ) {
    VmSubcategoriesBO boSaved = null;
    VmSubcategoriesVO voSaved = null;
    VmSubcategoriesBO bo = new VmSubcategoriesBO( );
    /* Copy the properties in the VO to the BO */
    ObjectAssembler.vo2bo( vo, bo );
    /* Save the changed object */
    save( bo );
    return voSaved;
    * Stores the new object in the database and
    * returns the primary key identifier with which it was created.
    * @param obj The object to be created.
    * @param uow Use this unit of work for performing the insert.
    * @param commitChanges Should commit changes upon insertion?
    * If the client wants to perform the commit operation across several others
    * operations, then the value should be set to false.
    * @return Primary key of the object created.
    public Long create ( Object obj, UnitOfWork uow, boolean commitChanges ) {
    Object cacheObj = null;
    Long lnSequenceAssigned = null;
    if ( obj == null ) {
    throw new ObjectNotFoundException( null, null, null, null );
    try {
    if (uow == null) {
         /* create a new unit of work if necesasry */
         uow = getUnitOfWork( dbSession );
    /* Assign a sequence number */
    uow.assignSequenceNumber( obj );
    /* Get the descriptor associated with this object */
    Descriptor descriptor = uow.getDescriptor(obj);
    /* Get the sequence assigned */
    lnSequenceAssigned = (Long)descriptor.getObjectBuilder().getBaseValueForField(descriptor.getSequenceNumberField(),obj);
    /* Register the object */
    uow.registerObject( obj );
    if(commitChanges){
    /* Commit the changes */
    uow.commitAndResume();
    } finally {
    return lnSequenceAssigned;
    * Saves changes to an existing object to the data store.
    * Has only been tested for flat-objects. Objects that reference other
    * persistent objects have not been tested.
    * @param bo The object to be saved.
    * @param uow The UnitOfWork to use for saving the object.
    * @param commitChanges whether the changes should be committed.
    * If the client wants to perform the commit operation across several others
    * operations, then the value should be set to false.
    public void save( Object bo, UnitOfWork uow, boolean commitChanges ) {
    if ( bo == null ){
    throw new IllegalArgumentException(
    "Object is invalid" );
    try {
    /* Register the object supposed to be existing */
    Object clone = uow.registerExistingObject( bo );
    /* This object does not exist */
    if ( clone == null ) {
    throw new ObjectNotFoundException( "object not found", "dao", bo.getClass().getName(), bo.toString());
    /* Copy the properties from the object to the clone, to ensure that
    * the intended properties have not been overwritten in the object from
    * the cache
    ObjectAssembler.copy( bo, clone );
    /* Commit the changes. */
    if(commitChanges){
    uow.commitAndResume();
    } finally {
    dbSession.release( );
    }

  • Generate update statement from select results

    I'm trying to generate an update statement based off select statement results.  A very basic example,
    SELECT ListID FROM DListing WHERE Status = 2
    Results return 3 rows.
    1234
    2345
    3456
    How can I take those results and turn them into WHERE criteria for UPDATE statement?
    Generated UPDATE statement should look like this.
    UPDATE DListing SET Status = 1 WHERE ListID IN (1234,2345,3456)
    I have started by creating a temp table to hold my SELECT results, but I don't know how to get those results into format for IN condition.  Right now I get 3 UPDATE statements with 1 ListID in each IN condition.
    CREATE TABLE #TempStatusUpdate(ListID INT)
    INSERT INTO #TempStatusUpdate
    SELECT ListID FROM DListing WHERE Status = 2
    SELECT 'UPDATE DListing SET Status = 1 WHERE ListID IN (' + CONVERT(VARCHAR(30),ListID) + ') AND Status = 2'
    DROP TABLE #TempStatusUpdate

    So what wrong with
    UPDTATE DListing
    SET     Status = 1
    WHERE   ListID IN (SELECT ListID FROM #TempStatusUpdate)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Errors while running BPEL and incorrect UPDATE statement

    Hi,
    I installed following software.
    1. Oracle Database 10g Release 2
    2. SOA Suite 10g Release 3
    3. Oracle JDeveloper (10.1.3.4)
    I developed a BPEL process to lock a userid in PeopleSoft.
    I have two issues.
    a) I am getting error as shown below
    b) its generating incorrect UPDATE statement, even though its assigning correct values in XML (UPDATE PSOPRDEFN SET LASTUPDOPRID = ?, OPRID = ? WHERE (ACCTLOCK = ?) i.e instead of setting OPRID in where clause its setting ACCTLOCK in where clause
    <messages><input><Invoke_1_update_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PsoprdefnCollection"><PsoprdefnCollection xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/UpdateUserProfile">
    <Psoprdefn>
    <oprid>snagulapalli</oprid>
    <version/>
    <oprdefndesc/>
    <emplid/>
    <emailid/>
    <oprclass/>
    <rowsecclass/>
    <operpswd/>
    <encrypted/>
    <symbolicid/>
    <languageCd/>
    <multilang/>
    <currencyCd/>
    <lastpswdchange/>
    <acctlock>1</acctlock>
    <prcsprflcls/>
    <defaultnavhp/>
    <failedlogins/>
    <expent/>
    <oprtype/>
    <useridalias/>
    <lastsignondttm/>
    <lastupddttm/>
    <lastupdoprid>Laptop BPEL</lastupdoprid>
    <ptallowswitchuser/>
    </Psoprdefn>
    </PsoprdefnCollection>
    </part></Invoke_1_update_InputVariable></input><fault><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>17002</code>
    </part><part name="summary"><summary>file:/D:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_Sandbox_9.0_882edce22e996c64b48ea25cbe023033.tmp/Update_User_Profile.wsdl Update_User_Profile_ptt::update(PsoprdefnCollection) - WSIF JCA Execute of operation 'update' failed due to: DBWriteInteractionSpec Execute Failed Exception.
    update failed. Descriptor name: http://UpdateUserProfile.Psoprdefn. Caused by: Io exception: Connection reset by peer: socket write error
    ; nested exception is:
    ORABPEL-11616
    DBWriteInteractionSpec Execute Failed Exception.
    update failed. Descriptor name: http://UpdateUserProfile.Psoprdefn. Caused by: Io exception: Connection reset by peer: socket write error
    Caused by Exception TOPLINK-4002 (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Io exception: Connection reset by peer: socket write errorError Code: 17002
    Call:UPDATE PSOPRDEFN SET LASTUPDOPRID = ?, OPRID = ? WHERE (ACCTLOCK = ?)
    bind => Laptop BPEL, snagulapalli, 1
    Query:UpdateObjectQuery(<Psoprdefn 1 />).
    </summary>
    </part><part name="detail"><detail>
    Internal Exception: java.sql.SQLException: Io exception: Connection reset by peer: socket write errorError Code: 17002
    Call:UPDATE PSOPRDEFN SET LASTUPDOPRID = ?, OPRID = ? WHERE (ACCTLOCK = ?)
    bind => Laptop BPEL, snagulapalli, 1
    Query:UpdateObjectQuery(<Psoprdefn 1 />)</detail>
    </part></remoteFault></fault></messages>
    Regards,
    Shanti Nagulapalli.

    What version of SOA Suite are you using, SOA Suite 10g Release 3 is not enough information. Make sure that it is the same as your JDev version if it isn't then either downgrade the JDev or upgrade the SOA Suite.
    If you are still on SOA 10.1.3.1 then I would upgrade as there are many bugs in this release.
    These kind of strange errors are generally caused by incompatibility between design time (JDev) and run time (SOA Suite)
    cheers
    James

  • ? Q : Photoshop CC won´t update, states it´s a transmission failure (49) "try again" - I´ve tried again at intervals about 8 times, getting same message..

    Photoshop CC won´t update, states it´s a transmission failure (49) "try again" - I´ve tried again at intervals about 8 times, getting same message..
    Anyone have any good ideas/suggestions ? Much appreciated, thanks !

    Malou please see Error downloading Creative Cloud applications - http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html which discusses error 49.

  • Doubt about UPDATE STAT COLUMN

    Hi,
    I have a doubt of when to execute update stat:
    i create this SQL to generate an SQL script to generate update stat for all my tables:
    select 'UPDATE STAT ' || schemaname || '.' || tablename || ' ESTIMATE SAMPLE 20 PERCENT' from tables where schemaname = 'DBUSER' and not tablename like 'JDBC%' AND type = 'TABLE'
    and created this SQL to generate an SQL script for update stat for all columns.
    select 'UPDATE STAT COLUMN(*) FOR ' || schemaname || '.' || tablename || ' ESTIMATE SAMPLE 20 PERCENT' from tables where schemaname = 'DBUSER' and not tablename like 'JDBC%' AND type = 'TABLE'
    my doubt is i really need run that second script? or the UPDATE STAT for table dont UPDATE STAT for all columns?
    thanks for any insight
    Clóvis

    > my doubt is i really need run that second script? or the UPDATE STAT for table dont UPDATE STAT for all columns?
    Hi Clovis,
    hmm... good question.
    There are a few things to know about the UPDATE STAT command here.
    1) It will always generate statistics for key or indexed columns.
    2) The optimizer won't be able to generate a better plan when there are column statistics for non-indexed columns present.
    3) The command will also collect column statistics for all columns that already have statistics.
    The direct effect of 3) is that by running your second command just once - all column statistics will always be collected.
    Since you can easily change the default sample size for your tables via
    ALTER TABLE SAMPLE SIZE 20 PERCENT
    I would say: drop your script and just use
    UPDATE STAT DBUSER.* ESTIMATE
    This single command would lead to the same statistics as your script does.
    And if you really, really want to leave out the JDBC tables - then just set their default sample size to 0 and they will be ignored by the UPDATE STAT command.
    regards,
    Lars

  • Running an update statement on two dependent attributes

    Dear All,
    I have a repair_job table that contains values for work_cost, parts_cost and total_cost which is the sum of the work and parts cost values. I want to run an update statement that doubles the work cost and, naturally, updates the value of total cost as well. I tried to run it as:
    update repair_job
    set work_cost = 2 * work_cost, total_cost = work_cost + parts_cost
    where licence in (
    select licence from car
    where year = to_char(sysdate,'YYYY')
    thinking that because the update of work_cost is first on the list, the updated value of total cost would be correct. It seems however that the update of total cost happens first and then the work cost is been updated; not sure what the reason is for that and it happens no matter what the order is in the update statement.
    I know that I can do it in two separate statements, or use a trigger or PL/SQL to do it but I am curious as to why it has this behaviour. Also, is there a way to do it in a single SQL statement - i.e. forcing the update of the work_cost attribute first and then that of total_cost?
    I look forward to hearing from you soon.
    Regards,
    George

    Welcome to the forum!
    >
    thinking that because the update of work_cost is first on the list, the updated value of total cost would be correct. It seems however that the update of total cost happens first and then the work cost is been updated; not sure what the reason is for that and it happens no matter what the order is in the update statement.
    I know that I can do it in two separate statements, or use a trigger or PL/SQL to do it but I am curious as to why it has this behaviour. Also, is there a way to do it in a single SQL statement - i.e. forcing the update of the work_cost attribute first and then that of total_cost?
    >
    The update to all columns of the row happen at the same time - there is no order involved.
    You don't need two statements but you do need to do the updates based on the current value of the columns.
    set work_cost = 2 * work_cost, total_cost = 2 * work_cost + parts_cost----------
    In addition to sb92075's comments in 11 g you could also just define a virtual column for total_cost and then just query it like you do now.
    total_cost   NUMBER GENERATED ALWAYS AS (work_cost + parts_cost) VIRTUAL,See this Oracle-base article for an example
    http://www.oracle-base.com/articles/11g/virtual-columns-11gr1.php
    Edited to supplement sb92075's reply by mentioning virtual columns

  • How to use the updated value in the same update statement

    Hello,
    I just wonder how to use the updated new value of other column in the same udpate statement. I am using Oracle 11.2, and want to update the two columns with one update statement as following:
    create table tb_test (id number(5), tot number(5), mon_tot number(5));
    update tb_test set (tot = 15, mon_tot = tot *15) where id = 1;
    ...I would like to update both tot and mon_tot column, the value of mon_tot shall be determinted by the new value of tot.
    Thanks,
    Edited by: 939569 on 1-Feb-2013 7:00 AM

    Edit: example added
    SQL> create table tb_test
      2  ( id number(5)
      3  , tot number(5)
      4  , mon_tot number generated always as (tot*15) virtual
      5  );
    Table created.
    SQL> insert into tb_test (id, tot) values (1, 5);
    1 row created.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1          5         75
    1 row selected.
    SQL> update tb_test
      2  set    tot = 15
      3  where  id = 1;
    1 row updated.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1         15        225
    1 row selected.

  • Performance degradation in Update statement

    Hi
    I have a table t1 with 3 of the columns as :- c1 ,c2,c3.
    there is a non unique index on c2 ,c3.
    I am using an update statement as : update t1 set c1="value" where c2="some_value" and c3="some_value2" ;
    this works fine in case the number of rows for the same c2 and c3 are less (~100) but takes a large time when ~30,000.
    And it has to be run many times in my application (time out is occuring now)
    Can anybody suggest a solution ?
    Thanks
    Message was edited by:
    user580975

    First off, setting a table to NOLOGGING does not affect the rate of redo generation unless you are also doing direct-path inserts (which is obviously not the case here and which come with their own set of issues). Note that the amount of redo being generated in these two examples is quite similar.
    SCOTT @ jcave102 Local> create table all_obj_cpy as select * from all_objects;
    Table created.
    Elapsed: 00:00:10.78
    SCOTT @ jcave102 Local> set autotrace traceonly;
    SCOTT @ jcave102 Local> alter table all_obj_cpy logging;
    Table altered.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> update all_obj_cpy
      2  set last_ddl_time = sysdate - 1;
    42511 rows updated.
    Elapsed: 00:00:01.45
    Execution Plan
    Plan hash value: 1645016300
    | Id  | Operation          | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT   |             | 43776 |   384K|   137   (3)| 00:00:02 |
    |   1 |  UPDATE            | ALL_OBJ_CPY |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| ALL_OBJ_CPY | 43776 |   384K|   137   (3)| 00:00:02 |
    Note
       - dynamic sampling used for this statement
    Statistics
            556  recursive calls
          46075  db block gets
           1558  consistent gets
              0  physical reads
       13575764  redo size
            924  bytes sent via SQL*Net to client
            965  bytes received via SQL*Net from client
              6  SQL*Net roundtrips to/from client
              6  sorts (memory)
              0  sorts (disk)
          42511  rows processed
    SCOTT @ jcave102 Local> alter table all_obj_cpy nologging;
    Table altered.
    Elapsed: 00:00:00.01
    SCOTT @ jcave102 Local> update all_obj_cpy
      2  set last_ddl_time = sysdate - 2;
    42511 rows updated.
    Elapsed: 00:00:01.32
    Execution Plan
    Plan hash value: 1645016300
    | Id  | Operation          | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | UPDATE STATEMENT   |             | 43776 |   384K|   137   (3)| 00:00:02 |
    |   1 |  UPDATE            | ALL_OBJ_CPY |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| ALL_OBJ_CPY | 43776 |   384K|   137   (3)| 00:00:02 |
    Note
       - dynamic sampling used for this statement
    Statistics
            561  recursive calls
          44949  db block gets
           1496  consistent gets
              0  physical reads
       12799600  redo size
            924  bytes sent via SQL*Net to client
            965  bytes received via SQL*Net from client
              6  SQL*Net roundtrips to/from client
              6  sorts (memory)
              0  sorts (disk)
          42511  rows processedSecond, if you did manage to do an unlogged operation, make absolutely certain you understand the recovery implications. You must do a complete backup of the database after an unlogged operation or the table will not be recovered in the event of a database failure. If you have a standby database for disaster recovery, unlogged operations would cause the standby to be useless (hence the option to force logging at the tablespace and/or database level).
    While it's certainly possible that this is an Oracle server configuration problem, it would be relatively tough to configure a system so that a 30,000 row update would force excessive log switches. If it were a configuration problem, you'd expect that any update of 30,000 rows would be slow and that multiple sessions running smaller updates would also be slow, but I don't believe that describes the symptoms the original poster is concerned about.
    Justin

  • LOG ERRORS failing to capture 2291 errors on UPDATE statement

    We are running Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
    We have often successfully used the error logging clause when performing batch inserts to the database. However, we now have a situation where an UPDATE statement is failing and rolling back upon encountering a foreign-key referential constraint [ORA-02291]. It is successfully recording Check constraint errors [ORA-02290]. The foreign keys are not deferred, and they have nothing to do with any unique constraints or indices on the table that is the target of the UPDATE statement. The Error-logging table was created by using the DBMS_ERRLOG package. We recreated it to make sure that we had not introduced column format errors. The same problem occurs. The UPDATE statement is attempting to update approximately 12000 rows. Any help in understanding this problem would be appreciated.
    Here is the error statement
    ORA-02291: integrity constraint (OIFS.FRAME_FK07) violated - parent key not found
    Here is the problem statement and its surrounding PLSQL block:
    BEGIN <<update_records>>
    UPDATE frame f
    SET (company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    update_date,
    update_user,
    -- comments,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    ) =
    (SELECT company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    SYSDATE,
    user_in,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    FROM oifs.respondent r
    WHERE r.cin = f.cin
    WHERE f.cin IN
    (SELECT cin
    FROM
    (SELECT cin,
    company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    FROM oifs.respondent
    MINUS
    SELECT cin,
    company_name,
    address1_line,
    address2_line,
    address1_city,
    address1_state,
    address1_zip,
    contact1_name,
    contact1_phone_number,
    facility_name,
    facility_type,
    doing_business_as,
    contact1_phone_ext,
    contact1_fax,
    contact1_email,
    contact2_name,
    contact2_phone_number,
    contact2_phone_ext,
    contact2_fax,
    contact2_email,
    source_survey,
    source_status,
    address2_city,
    address2_state,
    address2_zip,
    facility_location_number,
    attention_line,
    company_official,
    facility_irs_code
    FROM oifs.frame
    LOG ERRORS INTO oifs.frame_load_errors
    (job_num || ' ' || TO_CHAR(SYSDATE, 'YYYYMMDD HH24:MI:SS') || ' update')
    REJECT LIMIT UNLIMITED;
    EXCEPTION
    WHEN OTHERS THEN
    ohub.err_pkg.record_and_continue(msg_in => 'problem in updating FRAME rows');
    RAISE;
    END update_records;

    Thank you for your help. It pointed me in the right direction, which was to temporarily disable the triggers. The ORA-02291 errors were then properly captured in the error-logging-table.
    The problem did not appear to be related to the trigger. The problem that was captured in my PLSQL error-handler but not the error-logging-table was an ORA-02291, which was specific to the original table. The trigger-driven processing did not seem to generate any errors (I have PLSQL error-handling logic in there as well).
    I was aware of Tom Kyte's statement, and I knew triggers were dicey when I decided to use them. It seemed the best way to try to ensure database integrity when regular Foreign-Key and Check constraints did not suffice. I am now paying the price for that decision.

  • Performance Issue: Update Statement

    Hi Team,
    My current environment is Oracle 11g Rac...
    My application team is executing a update statement (ofcourse it is there daily activity) ...
    updating rows of 1 lac, daily it takes about 3-4 minutes to run the statement.
    But today its taking more time i.e more than 8 hours.
    then I have generated the explain plan of the update statement and found that its taking full table scan.
    Kindly assist me in fixing the issue by letting me know where and how to look for the problem.
    **Note: Stats gather is updated
    Thanks in advance.
    Regards

    If you notice there are no indexes to the below update statement -
    UPDATE REMEDY_JOURNALS_FACT SET JNL_CREATED_BY_IDENTITY_KEY = ?, JNL_CREATED_BY_HR_KEY = ?, JNL_CREATED_BY_NTWRK_KEY = ?, JNL_MODIFIED_BY_IDENTITY_KEY = ?, JNL_MODIFIED_BY_HR_KEY = ?, JNL_MODIFIED_BY_NTWRK_KEY = ?, JNL_ASSGN_TO_IDENTITY_KEY = ?, JNL_ASSGN_TO_HR_KEY = ?, JNL_ASSGN_TO_NTWRK_KEY = ?, JNL_REMEDY_STATUS_KEY = ?, JOURNALID = ?, JNL_DATE_CREATED = ?, JNL_DATE_MODIFIED = ?, ENTRYTYPE = ?, TMPTEMPDATETIME1 = ?, RELATEDFORMNAME = ?, RELATED_RECORDID = ?, RELATEDFORMKEYWORD = ?, TMPRELATEDRECORDID = ?, ACCESS_X = ?, JOURNAL_TEXT = ?, DATE_X = ?, SHORTDESCRIPTION = ?, TMPCREATEDBY = ?, TMPCREATE_DATE = ?, TMPLASTMODIFIEDBY = ?, TMPMODIFIEDDATE = ?, TMPJOURNALID = ?, JNL_JOURNALTYPE = ?, COPIEDTOWORKLOG = ?, PRIVATE = ?, RELATEDKEYSTONEID = ?, URLLOCATION = ?, ASSIGNEEGROUP = ?, LAST_UPDATE_DT = ? WHERE REMEDY_JOURNALS_KEY = ?
    Explain Plan -
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop | TQ |IN-OUT| PQ Distrib |
    | 0 | UPDATE STATEMENT | | | | 1055 (100)| | | | | | |
    | 1 | UPDATE | REMEDY_JOURNALS_FACT | | | | | | | | | |
    | 2 | PX COORDINATOR | | | | | | | | | | |
    | 3 | PX SEND QC (RANDOM) | :TQ10000 | 1 | 784 | 1055 (1)| 00:00:05 | | | Q1,00 | P->S | QC (RAND) |
    | 4 | PX BLOCK ITERATOR | | 1 | 784 | 1055 (1)| 00:00:05 | 1 | 10 | Q1,00 | PCWC | |
    |* 5 | TABLE ACCESS STORAGE FULL| REMEDY_JOURNALS_FACT | 1 | 784 | 1055 (1)| 00:00:05 | 1 | 10 | Q1,00 | PCWP | |
    Predicate Information (identified by operation id):
    5 - storage(:Z>=:Z AND :Z<=:Z AND "REMEDY_JOURNALS_KEY"=:36) filter("REMEDY_JOURNALS_KEY"=:36)
    Note
    - automatic DOP: skipped because of IO calibrate statistics are missing
    Edited by: GeetaM on Aug 17, 2012 2:18 PM

  • Need a help on Update statement

    Hi All,
    I Need a help in updating a table column. PFB my requirement.
    Table1
    ItemID OrgId       Date
    1       82     12/sep/2012   
    2       82     25/oct/2012
    3       82     17/Nov/2012
    4     82     22/Jan/2013
    5     82     26/sep/2012
    Table2
    Itemid     orgid       Date1
    1      82     23/sep/2012      
    2      82     25/Dec/2012
    3      82     17/Sep/2012
    4      82     22/Feb/2013
    5      82     26/Oct/2012
    Table3
    Itemid     orgid       Date3
    1      82     10/sep/2012      
    7      82     30/Dec/2012
    3      82     12/Sep/2012
    10      82     27/Feb/2013
    5      82     29/Oct/2012
    I Need to Update Date column of Table1 With Date3 of table3
    If
    Item and org combination is present in table3 and date column of table1 is less than Date3 of table3
    Else
    I need to Update with date2 of table2.Can we acheive this in a single update statement, can any one help me on this.
    Thanks and regards,
    Rakesh
    Edited by: Venkat Rakesh on Sep 27, 2012 11:04 PM

    You can probably also use MERGE:
    --DROP TABLE table1;
    --DROP TABLE table2;
    --DROP TABLE table3;
    ALTER SESSION SET nls_language = 'AMERICAN';
    CREATE TABLE table1
       itemid    CHAR (1),
       orgid     CHAR (2),
       thedate   DATE
    INSERT INTO table1   SELECT '1', '82', TO_DATE ('10/sep/2011', 'dd/mon/yyyy') FROM DUAL;
    INSERT INTO table1   SELECT '2', '82', TO_DATE ('10/oct/2011', 'dd/mon/yyyy') FROM DUAL;
    INSERT INTO table1   SELECT '3', '82', TO_DATE ('10/nov/2011', 'dd/mon/yyyy') FROM DUAL;
    INSERT INTO table1   SELECT '4', '82', TO_DATE ('10/jan/2011', 'dd/mon/yyyy') FROM DUAL;
    INSERT INTO table1   SELECT '5', '82', TO_DATE ('10/sep/2011', 'dd/mon/yyyy') FROM DUAL;-- won't be updated
    CREATE TABLE table2
       itemid    CHAR (1),
       orgid     CHAR (2),
       thedate   DATE
    INSERT INTO table2   SELECT '1', '82', TO_DATE ('01/sep/2012', 'dd/mon/yyyy') FROM DUAL;
    INSERT INTO table2   SELECT '2', '82', TO_DATE ('01/dec/2012', 'dd/mon/yyyy') FROM DUAL;
    INSERT INTO table2   SELECT '3', '82', TO_DATE ('01/sep/2012', 'dd/mon/yyyy') FROM DUAL;
    INSERT INTO table2   SELECT '4', '82', TO_DATE ('01/feb/2012', 'dd/mon/yyyy') FROM DUAL;
    CREATE TABLE table3
       itemid    CHAR (1),
       orgid     CHAR (2),
       thedate   DATE
    INSERT INTO table3   SELECT '2', '82', TO_DATE ('30/dec/2009', 'dd/mon/yyyy') FROM DUAL; -- date less than table1, so picks from table2
    INSERT INTO table3   SELECT '4', '82', TO_DATE ('30/mar/2013', 'dd/mon/yyyy') FROM DUAL; -- larger than table1 , so pick this date
    -- table1 original data
    SELECT * FROM table1;
    -- merge new data
    MERGE INTO table1
         USING (SELECT NVL (t1.itemid, t2.itemid) itemid,
                       NVL (t1.orgid, t2.orgid) orgid,
                       t2.thedate prefdate ,
                       t1.thedate nextdate
                  FROM    table2 t1
                       FULL OUTER JOIN
                          table3 t2
                       ON t1.itemid = t2.itemid AND t1.orgid = t2.orgid) dat
            ON (dat.itemid = table1.itemid AND dat.orgid = table1.orgid)
    WHEN MATCHED
    THEN
       UPDATE SET table1.thedate = (case when prefdate > table1.thedate then prefdate else nextdate end) ;
    --table1 updated data
    SELECT * FROM table1;OUTPUT:
    Session altered.
    Table created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    Table created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    Table created.
    1 row created.
    1 row created.
    ITEMID ORGID THEDATE  
    1      82    10.09.2011
    2      82    10.10.2011
    3      82    10.11.2011
    4      82    10.01.2011
    5      82    10.09.2011
    5 rows selected.
    4 rows merged.
    ITEMID ORGID THEDATE  
    1      82    01.09.2012
    2      82    01.12.2012
    3      82    01.09.2012
    4      82    30.03.2013
    5      82    10.09.2011
    5 rows selected.

  • Update statement problem !!

    Hi,
    I need some specific features for my school project and BDB is almost providing me with this functionality. In my project, I want to provide the user with the functionality to provide the update statements from the user screen. I want to then take the user input in a java variable for manipulation of the xml data and display the end result. The only option I have for the user is to provide the xquery updates with the following syntax: ( I need this syntax for update statements as I use a parser to convert the user input to involve fuzziness):
    "insert nodes &lt;b4&gt;inserted child&lt;/b4&gt; after doc('dbxml:/test.dbxml/book)/Bookstore";
    Now I am trying to run these with the below Code but I am not actually getting the required output. Can somebody help me to debug or fix this code for my requirement. I use the following xml data :
    &lt;Bookstore&gt;
    &lt;Book&gt;
    &lt;book_ID&gt;1&lt;/book_ID&gt;
    &lt;title&gt;Harry Potter and the Order of the Phoenix&lt;/title&gt;
    &lt;subtitle/&gt;
    &lt;author&gt;
    &lt;author_fname&gt;J.K.&lt;/author_fname&gt;
    &lt;author_lname&gt;Rowling&lt;/author_lname&gt;
    &lt;/author&gt;
    &lt;price&gt;9.99&lt;;;/price&gt;
    &lt;year_published&gt;2004&lt;/year_published&gt;
    &lt;publisher&gt;Scholastic, Inc.&lt;/publisher&gt;
    &lt;genre&gt;Fiction&lt;/genre&gt;
    &lt;quantity_in_stock&gt;28997&lt;/quantity_in_stock&gt;
    &lt;popularity&gt;20564&lt;/popularity&gt;
    &lt;/Book&gt;
    &lt;/Bookstore&gt;
    I have track points in my code to find the mistake and I get the following ouput.
    Track 3
    Track 3.1
    Track 3.2-----
    The code I use fails to compile the xquery statement with .prepare API.
    import java.io.*;
    import com.sleepycat.db.*;
    import com.sleepycat.dbxml.*;
    public class phone{
    public static void main(String[] args)
    String document1 = "C:/Documents and Settings/cjmadall/Desktop/BDB/book.xml";
    String docName = "book";
    XmlManager myManager = null;
    XmlContainer myContainer = null;
    try {
    myManager = new XmlManager();
    myContainer = myManager.openContainer("test.dbxml");
    String myQuery = "insert nodes &lt;b4&gt;inserted child&lt;/b4&gt; after doc('dbxml:/test.dbxml/book)/Bookstore";
    // This Works and displays the entire document-&gt; String myQuery = "collection('test.dbxml')";
    // This Doesnt Work, ends with the above output -&gt; String myQuery = "insert nodes &lt;newNode&gt;Some new text&lt;/newNode&gt; after collection("dbxml:/test.dbxml")/Bookstore";
    // collection('test.dbxml')/Bookstore";
    System.out.println("Track 3 ");
    XmlQueryContext managerContext = myManager.createQueryContext();
    System.out.println("Track 3.1 ");
    // Get a context for the document queries
    // XmlQueryContext documentContext = myManager.createQueryContext();
    System.out.println("Track 3.2 ");
    // Prepare the XmlManager query
    *XmlQueryExpression managerQuery = myManager.prepare(myQuery, managerContext);*
    System.out.println("Track 3.3 ");
    // Perform the query.
    XmlResults results = managerQuery.execute(managerContext, 0);
    // Display the result set
    System.out.println("Track 3.4 ");
    XmlValue value;
    while ((value = results.next()) != null){
    System.out.println(value.asString());
    System.out.println("Track 3.5 ");
    results.delete();
    managerQuery.delete();
    // documentContext.delete();
    managerContext.delete();
    } catch (XmlException e) {
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } finally {
    try {
    if (myContainer != null) {
    myContainer.close();
    if (myManager != null) {
    myManager.close();
    } catch (XmlException ce) {
    // Exception handling goes here
    }//end finally
    Thanks.

    I was using a old version of BDB and the latest version fixed this issue.

  • Is it possible that my update stats used only correct tables?

    Whenever there is a schedule maintenance run I receive a error:
    Executing the query "UPDATE STATISTICS [Perf].[PerfHourly_F65954CD35A54..." failed with the following error: "Table 'PerfHourly_F65954CD35A549E886A48E53F148F277' does not exist.". Possible failure reasons: Problems with the query, "ResultSet"
    property not set correctly, parameters not set correctly, or connection not established correctly.
    Is it possible that my update stats used only correct  tables?
    Thanks

    Use below script ...(change if required)
    USE [dbname]
    go
    DECLARE @mytable_id INT
    DECLARE @mytable VARCHAR(100)
    DECLARE @owner VARCHAR(128)
    DECLARE @SQL VARCHAR(256)
    SELECT @mytable_id = MIN(object_id)
    FROM sys.tables WITH(NOLOCK)
    WHERE is_ms_shipped = 0
    WHILE @mytable_id IS NOT NULL
    BEGIN
     SELECT @owner = SCHEMA_NAME(schema_id), @mytable = name
     FROM sys.tables
     WHERE object_id = @mytable_id
     SELECT @SQL = 'UPDATE STATISTICS '+ QUOTENAME(@owner) +'.' + QUOTENAME(@mytable) +' WITH ALL, FULLSCAN;'
     Print @SQL
     EXEC (@SQL)
     SELECT @mytable_id = MIN(object_id)
     FROM sys.tables WITH(NOLOCK)
     WHERE object_id > @mytable_id
      AND is_ms_shipped = 0
    END
    Or use below for required table only but it will not execute only generate script, make change as per ur requirements:
    SELECT X.*,
      ISNULL(CASE
        WHEN X.[Total Rows]<=1000
        THEN
          CASE
            WHEN [Percent Modified] >=20.0
            THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name] + ' WITH ALL, FULLSCAN  --20% Small Table Rule'
          END
        WHEN [Percent Modified] = 100.00
        THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  --100% No real Stats Rule'
        --WHEN X.[Rows Modified] > 1000
        --THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  --1000 Rows Modified Rule'
        ELSE
          CASE
            WHEN X.[Total Rows] > 1000000000 --billion rows
            THEN CASE
                   WHEN [Percent Modified] > 0.1
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 1B Big Table Rule'
                 END
            WHEN X.[Total Rows] > 100000000  --hundred million rows
            THEN CASE
                   WHEN [Percent Modified] > 1.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 100M Big Table Rule'
                 END
            WHEN X.[Total Rows] > 10000000   --ten million rows
            THEN CASE
                   WHEN [Percent Modified] > 2.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 10M Big Table Rule'
                 END
            WHEN X.[Total Rows] > 1000000    --million rows
            THEN CASE
                   WHEN [Percent Modified] > 5.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 1M Big Table Rule'
                 END
            WHEN X.[Total Rows] > 100000     --hundred thousand rows
            THEN CASE
                   WHEN [Percent Modified] > 10.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 100K Big Table Rule'
                 END
            WHEN X.[Total Rows] > 10000      --ten thousand rows
            THEN CASE
                   WHEN [Percent Modified] > 20.0
                   THEN 'UPDATE STATISTICS ' + [Schema Name] + '.' + [Table Name]     + ' WITH ALL, FULLSCAN  -- 10K Big Table Rule'
                 END
            END
      END,'') AS [Statistics SQL]
    FROM (
    SELECT  DISTINCT
            DB_NAME()   AS [Database],
            S.name      AS [Schema Name],
            T.name      AS [Table Name],
            I.rowmodctr AS [Rows Modified],
            P.rows      AS [Total Rows],
            CASE
              WHEN I.rowmodctr > P.rows
              THEN 100
              ELSE CONVERT(decimal(8,2),((I.rowmodctr * 1.0) / P.rows * 1.) * 100.0)
            END AS [Percent Modified]
    FROM
            sys.partitions P
            INNER JOIN sys.tables  T ON P.object_Id = T.object_id
            INNER JOIN sys.schemas S ON T.schema_id = S.schema_id
            INNER JOIN sysindexes  I ON P.object_id = I.id
    WHERE P.index_id in (0,1)
      AND I.rowmodctr > 0
    ) X
    WHERE [Rows Modified] > 1000
    ORDER BY [Rows Modified] DESC
    Please click "Propose As Answer"
    if a post solves your problem, or "Vote As Helpful" if a post has been useful
    to you

  • Help needed with Update statements.

    Hello All,
    I am trying to learn Berkeley XMLDB and facing problem to query the inserted XML file. I have a small XML file with the following contents:
    &lt;?xml version="1.0" standalone="yes"?&gt;
    &lt;Bookstore&gt;
    &lt;Book&gt;
    &lt;book_ID&gt;1&lt;/book_ID&gt;
    &lt;title&gt;Harry Potter and the Order of the Phoenix&lt;/title&gt;
    &lt;subtitle&gt;A Photographic History&lt;/subtitle&gt;
    &lt;author&gt;
    &lt;author_fname&gt;J.K.&lt;/author_fname&gt;
    &lt;author_lname&gt;Rowling&lt;/author_lname&gt;
    &lt;/author&gt;
    &lt;price&gt;9.99&lt;/price&gt;
    &lt;year_published&gt;2004&lt;/year_published&gt;
    &lt;publisher&gt;Scholastic, Inc.&lt;/publisher&gt;
    &lt;genre&gt;Fiction&lt;/genre&gt;
    &lt;quantity_in_stock&gt;28997&lt;/quantity_in_stock&gt;
    &lt;popularity&gt;20564&lt;/popularity&gt;
    &lt;/Book&gt;
    &lt;/Bookstore&gt;
    When I try to update the TITLE of this node I have the following error message:
    C:\Users\Chandra\Desktop\BDB&gt;javac -classpath .;"C:\Program Files\Sleepycat Soft
    ware\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\B
    erkeley DB XML 2.1.8\jar\db.jar" bdb.java
    bdb.java:75: illegal start of expression
    public static final String STATEMENT1 = "replace value of node collection("twopp
    ro.bdbxml")/Bookstore/Book/bookid/title with 'NEWBOOK'";
    ^
    bdb.java:80: ')' expected
    System.out.println("Done query: " + STATEMENT1);
    ^
    2 errors
    But when I remove the update statements and just try to display the TITLE of this node, I dont see any outputs. Please help me to catch up with my mistakes. Below is source code I am using to run this functionality.
    Thanks.
    import java.io.File;
    import java.io.FileNotFoundException;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    import com.sleepycat.dbxml.XmlContainer;
    import com.sleepycat.dbxml.XmlException;
    import com.sleepycat.dbxml.XmlInputStream;
    import com.sleepycat.dbxml.XmlManager;
    import com.sleepycat.dbxml.XmlUpdateContext;
    import com.sleepycat.dbxml.XmlDocument;
    import com.sleepycat.dbxml.XmlQueryContext;
    import com.sleepycat.dbxml.XmlQueryExpression;
    import com.sleepycat.dbxml.XmlResults;
    import com.sleepycat.dbxml.XmlValue;
    public class bdb{
    public static void main(String[] args)
    Environment myEnv = null;
    File envHome = new File("D:/xmldata");
    try {
    EnvironmentConfig envConf = new EnvironmentConfig();
    envConf.setAllowCreate(true); // If the environment does not
    // exits, create it.
    envConf.setInitializeCache(true); // Turn on the shared memory
    // region.
    envConf.setInitializeLocking(true); // Turn on the locking subsystem.
    envConf.setInitializeLogging(true); // Turn on the logging subsystem.
    envConf.setTransactional(true); // Turn on the transactional
    envConf.setRunRecovery(true);
    // subsystem.
    myEnv = new Environment(envHome, envConf);
    // Do BDB XML work here.
    } catch (DatabaseException de) {
    // Exception handling goes here
    } catch (FileNotFoundException fnfe) {
    // Exception handling goes here
    } finally {
    try {
    if (myEnv != null) {
    myEnv.close();
    } catch (DatabaseException de) {
    // Exception handling goes here
    XmlManager myManager = null;
    XmlContainer myContainer = null;
    // The document
    String docString = "D:/xmldata/test.xml";
    // The document's name.
    String docName = "cia";
    try {
    myManager = new XmlManager(); // Assumes the container currently exists.
    myContainer =
    myManager.createContainer("twoppro.bdbxml");
    myManager.setDefaultContainerType(XmlContainer.NodeContainer); // Need an update context for the put.
    XmlUpdateContext theContext = myManager.createUpdateContext(); // Get the input stream.
    XmlInputStream theStream =
    myManager.createLocalFileInputStream(docString); // Do the actual put
    myContainer.putDocument(docName, // The document's name
    theStream, // The actual document.
    theContext, // The update context
    // (required).
    null); // XmlDocumentConfig object
    theStream.delete();
    // Update the title
    public static final String STATEMENT1 = "*replace value of node collection("twoppro.bdbxml")/Bookstore/Book/[bookid=1]/title with 'NEWBOOK'";*
    XmlQueryContext context = myManager.createQueryContext();
    XmlQueryExpression queryExpression1 = myManager.prepare(STATEMENT1, context);
    System.out.println("Try to execute query: " +
    System.out.println("Done query: " + STATEMENT1);
    queryExpression1.execute(context);
    // Get a query context
    XmlQueryContext context = myManager.createQueryContext();
    // Set the evaluation type to Lazy.
    context.setEvaluationType(XmlQueryContext.Lazy);
    // Declare the query string
    String queryString =
    "for $u in collection('twoppro.dbxml')/Bookstore/Book/[bookid=1]"
    + "*return $u/title";*
    // Prepare (compile) the query
    XmlQueryExpression qe = myManager.prepare(queryString, context);
    XmlResults results = qe.execute(context);
    System.out.println("ok");
    System.out.println(results);
    } catch (XmlException e) {
    // Error handling goes here. You may want to check
    // for XmlException.UNIQUE_ERROR, which is raised
    // if a document with that name already exists in
    // the container. If this exception is thrown,
    // try the put again with a different name, or
    // use XmlModify to update the document.
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } finally {
    try {
    if (myContainer != null) {
    myContainer.close();
    if (myManager != null) {
    myManager.close();
    } catch (XmlException ce) {
    // Exception handling goes here

    Thanks Rucong. The change you suggested did helped me to run the program correct. But I also have the display function to retrive the results and my program is parsed without any output.
    C:\Users\C\Desktop\BDB&gt;Clientbuild.bat
    C:\Users\C\Desktop\BDB&gt;javac -classpath .;"C:\Program Files\Sleepycat Soft
    ware\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\B
    erkeley DB XML 2.1.8\jar\db.jar" bdb.java
    C:\Users\C\Desktop\BDB&gt;Client.bat
    C:\Users\C\Desktop\BDB&gt;java -classpath .;"C:\Program Files\Sleepycat Softw
    are\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\Be
    rkeley DB XML 2.1.8\jar\db.jar" bdb
    See there is no OUPUT displayed. Is there somethinglike a 'print' I have to use in this java code.
    Any ideas ? Below is the code I am using now
    import java.io.File;
    import java.io.FileNotFoundException;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    import com.sleepycat.dbxml.XmlContainer;
    import com.sleepycat.dbxml.XmlException;
    import com.sleepycat.dbxml.XmlInputStream;
    import com.sleepycat.dbxml.XmlManager;
    import com.sleepycat.dbxml.XmlUpdateContext;
    import com.sleepycat.dbxml.XmlDocument;
    import com.sleepycat.dbxml.XmlQueryContext;
    import com.sleepycat.dbxml.XmlQueryExpression;
    import com.sleepycat.dbxml.XmlResults;
    import com.sleepycat.dbxml.XmlValue;
    public class bdb{
    public static void main(String[] args)
    Environment myEnv = null;
    File envHome = new File("D:/xmldata");
    try {
    EnvironmentConfig envConf = new EnvironmentConfig();
    envConf.setAllowCreate(true); // If the environment does not
    // exits, create it.
    envConf.setInitializeCache(true); // Turn on the shared memory
    // region.
    envConf.setInitializeLocking(true); // Turn on the locking subsystem.
    envConf.setInitializeLogging(true); // Turn on the logging subsystem.
    envConf.setTransactional(true); // Turn on the transactional
    envConf.setRunRecovery(true);
    // subsystem.
    myEnv = new Environment(envHome, envConf);
    // Do BDB XML work here.
    } catch (DatabaseException de) {
    // Exception handling goes here
    } catch (FileNotFoundException fnfe) {
    // Exception handling goes here
    } finally {
    try {
    if (myEnv != null) {
    myEnv.close();
    } catch (DatabaseException de) {
    // Exception handling goes here
    XmlManager myManager = null;
    XmlContainer myContainer = null;
    // The document
    String docString = "D:/xmldata/test.xml";
    // The document's name.
    String docName = "cia";
    try {
    myManager = new XmlManager(); // Assumes the container currently exists.
    myContainer =
    myManager.createContainer("twoppro.bdbxml");
    myManager.setDefaultContainerType(XmlContainer.NodeContainer); // Need an update context for the put.
    XmlUpdateContext theContext = myManager.createUpdateContext(); // Get the input stream.
    XmlInputStream theStream =
    myManager.createLocalFileInputStream(docString); // Do the actual put
    myContainer.putDocument(docName, // The document's name
    theStream, // The actual document.
    theContext, // The update context
    // (required).
    null); // XmlDocumentConfig object
    theStream.delete();
    // Update the title
    String STATEMENT1 = "for $n in collection('twoppro.bdbxml')/Bookstore/Book[book_ID=1]/title return replace value of node $n with 'NEWBOOK'";
    XmlQueryContext context = myManager.createQueryContext();
    XmlQueryExpression queryExpression1 = myManager.prepare(STATEMENT1, context);
    System.out.println("Done query: " + STATEMENT1);
    queryExpression1.execute(context);
    // Get a query context
    XmlQueryContext thiscontext = myManager.createQueryContext();
    // Set the evaluation type to Lazy.
    context.setEvaluationType(XmlQueryContext.Lazy);
    // Declare the query string
    String queryString =
    "for $u in collection('twoppro.dbxml')/Bookstore/Book/[bookid=1]"
    + "return $u/title";
    // Prepare (compile) the query
    XmlQueryExpression qe = myManager.prepare(queryString, thiscontext);
    XmlResults results = qe.execute(thiscontext);
    System.out.println("ok");
    System.out.println(results);
    } catch (XmlException e) {
    // Error handling goes here. You may want to check
    // for XmlException.UNIQUE_ERROR, which is raised
    // if a document with that name already exists in
    // the container. If this exception is thrown,
    // try the put again with a different name, or
    // use XmlModify to update the document.
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } finally {
    try {
    if (myContainer != null) {
    myContainer.close();
    if (myManager != null) {
    myManager.close();
    } catch (XmlException ce) {
    // Exception handling goes here
    Thanks.

Maybe you are looking for

  • Adobe Bridge CS6 - Freezing

    When I open bridge it starts putting up thumbnails, and then freezes.  I upgraded from CS5 to CS6 and it's been doing it since my initial installation.  It worked fine when I only clicked a small folder with a few files, but when I clicked my DropBox

  • RFC server is failing to start

    Hi All, Env: DataServices 4.2/DQM 4.0/RFC4.0 on linux x86_64, ECC6 EHp7 with latest DQM addon - FLDQ 02 ./start_<SID>_trans  (- after install) Business Objects an SAP Company: BusinessObjects DQ Mgmt for SAP Solutions - RFC Server 4.0 Startup status:

  • Writing expression in OWB to generate SEQ no.?

    I want to generate a Sequence number for different records of each unique record. For example Cust_no R_visit_num Seq_vis_num 11 8 8.01 11 8 8.02 11 8 8.03 22 77 77.01 33 55 55.01 33 55 55.01 Let me know if you can help me to generate seq_vis_num for

  • Ipod resets on same song

    My iPod always resets itself at the same point of the same song without fail. I've manually reset the iPod, resynched, and still the same result. Before I delete the track and redownload, has anyone ever encountered this? This track plays fine in iTu

  • [AIR] File Not Found in MAC OS but Works in Windows

    Hi All I have an htmlFolder in my "src" which contains html files. What I do is, that at runtime i render the html File in <mx:HTML id="htmlView"> using the following code. htmlView.location = "app:/htmlFolder/sub-folder/fileName.html"; Problem -> Th