Change AUSP-ATWRT without Update statement

Hello,
I am looking for any kind of FM / BAPI/standard way to update AUSP-ATWRT field without using UPDATE statment. I can not use UPDATE statement in my code.
Any help is appriciated!
Thanks in advance

Hi,
So... where and how have you looked thus far..? I'm not trying to be difficult or snide here, but if I, who didn't know of the existance of AUSP some 12 minutes ago did find what I believe to be the correct BAPI by:
1) looking at the table description to figure out what the table contains, and
2) doing one search on SCN...
you will too, I believe...
cheers
Janis

Similar Messages

  • Run Aggregate Without Update Stats

    When ever I choose "Roll-up of filled aggreates" in my process chain it does the rollup in 180 seconds and then spends 1 hr with update stats. The update stats does not need to run but once per weekend. Is there a way to do the rollup without the update stats part.
    Also does the same if you click the "Rollup" from the infopackage.
    Any help will be rewarded !
    Thanks
    Richard

    There is an RSADMIN option that turns off all BW initiated stats collection, at which point you must have an appropriate process in place by running BRCONNECT or other statistics collection approach.
    Also saw a new Note  <a href="https://websmp104.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=012003146900000053702006">938040</a>that indiates there is some debate at SAP whether the option should continue to be supported beyond 2004s SP7.
    Check Notes - Deactivating BW-initiated DB statistics  <a href="https://websmp104.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=012006153200001729112002">555030</a>

  • Updating data without using update statement

    Hi,
    A quick question...
    Can any table data could be updated without using update statement from backend.
    Just wanted to make sure.
    Thanks in advance.

    Hi,
    What is your definition of Update?
    Since your question is vague and you dont explain what exactly you mean.
    here are my thoughts
    1) A record can be deleted and isnerted with new values.Where the nes values have only few columns changed from previous ones.
    2) I use pl/sql developer.If i need to update i can write select.. for update.Change the values (as in notepad)Commit.
         This is infact a update but with nice UI
    3) even your application can update data in your tables, if you code it and give correct privileges to the userRegards,
    Bhushan

  • 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( );
    }

  • Updating ARDT table without using direct update statement

    hi,
        can any one guide me how to update REMARK field in the ADRT table without using direct UPDATE statement. It would be helpful if any one can tell me the bapi or a function module with a sample code.

    Hi                                                                               
    <b>SZA0                           Business Address Services (w/o Dialog) </b> ADDR_PERSONAL_UPDATE                                                          
    ADDR_PERSON_UPDATE                                                            
    ADDR_PERS_COMP_UPDATE                                                         
    ADDR_UPDATE                                                                   
    these are the four function modules which will update the (Business Address Services) reward if usefull
    check these is there any  help ful for u or not

  • Change Update stats job creteria

    Hi ,
    As per my understanding Update statistics job Update stats of table if it has been changed more than 50%.
    Please suggest where we can check this value set for job and How can we change it.
    Regards,
    Shivam Mittal

    Hi Shivam,
    You can set the "stats_change_threshold" parameter, in "init<DBSID>.sap" file. Check http://help.sap.com/saphelp_bw30b/helpdata/en/02/0ae0c6395911d5992200508b6b8b11/content.htm
    Best regards,
    Orkun Gedik

  • Does Update statement update only changed columns?

    Let's say I have TABLE1 with columns ID NUMBER(2,0),FNAME VARCHAR2(20),LNAME VARCHAR2(20), AGE NUMBER(2,0). I insert a new record:
    INSERT INTO TABLE1 (ID,FNAME,LNAME,AGE) VALUES(1,'Steve','Jobs',40);
    then I say:
    UPDATE TABLE1 SET FNAME='Steve', LNAME='Jobs',AGE=56 WHERE ID=1;
    As you see only the value of AGE column is different but in the UPDATE statement I still set the other columns to the previous values to. I wonder if Oracle is smart enough to update only the AGE column or does it update all the columns?

    I don't think that Oracle is making this check: it simply updates columns as specified in the SQL statement.
    Here is a 5 year old J. Lewis article that explains why Oracle is working this way: http://jonathanlewis.wordpress.com/2007/01/02/superfluous-updates/.

  • Using named parameters with an sql UPDATE statement

    I am trying to write a simple? application on my Windows 7 PC using HTML, Javascript and Sqlite.  I have created a database with a 3 row table and pre-populated it with data.  I have written an HTML data entry form for modifying the data and am able to open the database and populate the form.  I am having trouble with my UPDATE function.  The current version of the function will saves the entry in the last row of the HTML table into the first two rows of the Sqlite data table -- but I'm so worn out on this that I can't tell if it is accidental or the clue I need to fix it.
    This is the full contents of the function . . .
         updateData = new air.SQLStatement();
         updateData.sqlConnection = conn;
         updateData.text = "UPDATE tablename SET Gsts = "Gsts, Gwid = :Gwid, GTitle = :GTitle WHERE GId = ":GId;
              var x = document.getElementsById("formname");
              for (var i = 1, row, row = x.rows[i]; i++) {
                   updateData.parameters[":GId"] = 1;
                   for (var j = 0, col; col=row.cells[j]; j++) {
                        switch(j) {
                             case 0: updateData.parameters[":GTitle"] = col.firstChild.value; break;
                             case 1: updateData.parameters[":Gsts"] = col.firstChild.value; break;
                             case 2: updateData.parameters[":Gwid"] = col.firstChild.value; break;
    Note: When I inspect the contents of the col.firstChild.value cases, they show the proper data as entered in the form -- it just isn't being updated into the proper rows of the Sqlite table.
    Am I using the named parameters correctly? I couldn't find much information on the proper use of parameters in an UPDATE statement.

    Thank you for the notes.  Yes, the misplaced quotes were typos.  I'm handtyping a truncated version of the function so I don't put too much info in the post. And yes, i = 1 'cuz the first rows of the table are titles.  So the current frustration is that I seem to be assigning all the right data to the right parameters but nothing is saving to the database.
    I declare updateData as a variable at the top of the script file
    Then I start a function for updating the data which establishes the sql connection as shown above.
    The correctly typed.text statement is:
            updateData.text = "UPDATE tablename SET Gsts=:Gsts, Gwid=:Gwid, GTitle=:GTitle WHERE GId=:GId";
    (The data I'm saving is entered in text boxes inside table cells.) And the current version of the loop is:
            myTable = document.getElementById("GaugeSts");
            myRows= myTable.rows;
              for(i=1, i<myRows.length, i++) {
                   updateData.parameters[":GId"]=i;
                   for(j=0; j<myRows(i).cells.length, j++) {
                        switch(y) {
                             case 0: updateData.parameters[":GTitle"]=myrows[i].cells[y].firstChild.value; break;
                             case 1: updateData.parameters[":Gsts"]=myrows[i].cells[y].firstChild.value; break;
                             case 2: updateData.parameters[":Gwid"]=myrows[i].cells[y].firstChild.value; break;
                             updateData.execute;
    The whole thing runs without error and when I include the statements to check what's in myrows[i].cells[y].firstChild.value, I'm seeing that the correct data is being picked up for assignment to the parameters and the update. I haven't been able to double check that the contents of the parameters are actually taking the data 'cuz I don't know how to extract the data from the parameters. ( The only reference  I've found so far has said that it is not possible. I'm still researching that one.) I've also tried moving the position of the updateData execution statement to several different locations in the loop andstill nothing updates. 
    I am using a combination of air.Introspector.Console.log to check the results of code and I'm using Firefox's SQlite manager to handle the database.  The database is currently sitting on the Desktop to facilitate testing and I have successfully updated/changed data in this table through the SQLite Manager so I don't think I'm having permission errors and, see below, I have another function successfully saving data to another table.
    I currently have another function that uses ? for the parametersin the .text of a INSERT/REPLACE statement and that one works fine.  But, only one line of data is being saved so there is no loop involved.  I tried changing the UPDATE statement in this function to the INSERT/REPLACE just to make something save back to the database but I can't make that one work either.I've a (And, I've tried so many things now, I don't even remember what actually saved something --albeit incorrectly --to the database in one of my previous iterations with the for loops.)
    I'm currently poring through Sqlite and Javascript tomes to see if I can find what's missing but if anything else jumps out at you with the corrected code, I'd appreciate some ideas.
    Jeane

  • Auto update stats disabled for a user Database in Sql server

    While trying to improve the performance of few queries, we found via execution plan that there were lot of Index/Clustered index seeks. Therefore:
    First thing we did, was to check our Re-indexing and update stats job which runs weekly for this user DB ( Around 400 GB in size and is used 24*5). The job was running fine.
    Later when we ran SP_Blitz, we came to know that auto-update-stats is disabled for this user DB. We expected this to be a possible cause and change it from false to TRUE(Auto update stats)
    Also, per SP_blitz there are user-created statistics for this DB. When ran the query to check how many, we saw around 7K user stats out there.
    So my question would be 1) setting the Auto update stats to TRUE would require a reboot or once changed i need to track the performance and 2) Should we consider dropping those user created stats or manually look into them one by one.
    How should we proceed on this, please suggest, thanks!

    There may be good reasons for having auto-stats off, but those cases are not very common. It makes a little more sense to turn if off on table level. An example of the latter is a relatively small table, say < 100000 rows where not many new rows are added,
    but the existing rows are being updated frequently. This will trigger autostats, but probably without much benefit.
    But if you have a system which is very busy during peak times, you may not want autostats take resources during those hours. But if you turn off autostats, you will need to make sure that stats are updated in some other fashion.
    Here is a query that you can use review when your statistics last were updated:
    SELECT o.name, s.name, stats_date(o.object_id, s.stats_id) AS lastupdated
    FROM   sys.objects o
    JOIN   sys.stats s ON s.object_id = o.object_id
    --WHERE  s.user_created = 1
    ORDER BY lastupdated
    7000 user-created statistics sounds a little excessive, but I guess they were added to compensate for the autostats that SQL Server were not permitted to create. I would not recommend dropping these statistics, as SQL Server would spend cycles on recreating
    them.
    You should not have to restart SQL Server for the Auto-update stats setting to take effect; it takes effect immediately.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • 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.

  • Update Statement w/ Order By and other goodies

    this is a continuation of my previous post : Re: create update statement with joins/select Please see it for table structure and sample data.
    Ok so this is building on my previous SQL question that was resolved by you brilliant SQLers out there. the below code will do exactly what i need it to do, but I was wanting less user interaction:
    update offender_case_identifiers ociq
       set Identifier_type = 'ARN2'
    where ociq.offender_book_id in
          (select offender_book_id from v_header_block
            where offender_id_display = :ppid)
        and ociq.comment_text != :parn
       AND ociq.identifier_type = 'ARN'I was only wanting the user to have to enter the ":pid" and have the script take care of the rest. I have found the best way to ensure that I'm finding the most recent "ARN" from the offender_case_identifiers (which is then going to need to be set to ":parn") is to run the following script:
    select oci.identifier_type
    , vhb.offender_id_display
    ,oci.comment_text
    ,vhb.offender_book_id
    ,oci.offender_book_id
    from   offender_case_identifiers oci, v_header_block vhb
    where
    oci.offender_book_id = vhb.offender_book_id
    and vhb.offender_id_display = :ppid
    and oci.identifier_type like 'ARN'
    order by comment_text descThe above code was the original starting point for my previous final SQL statement, listed first in this post, however, I have added the "ORDER BY" at the bottom of it. For additional sample data, here is the result of the above statement:
    IDENTIFIER_TYPE     OFFENDER_ID_DISPLAY     COMMENT_TEXT     OFFENDER_BOOK_ID     OFFENDER_BOOK_ID_1
    ARN     *0000382183*     01550228     *1,011,683*     1,011,683
    ARN     *0000382183*     01550228     *1,011,683*     1,011,683
    ARN     *0000382183*     01531810     *823,281*     823,281
    ARN     *0000382183*     01531810     *823,281*     823,281
    ARN     *0000382183*     01531810     *823,281*     823,281
    ARN     *0000382183*     01531810     *823,281*     823,281
    ARN     *0000382183*     01529717     *804,301*     804,301
    ARN     *0000382183*     01525871     *759,982*     759,982
    ARN     *0000382183*     01525871     *759,982*     759,982
    ARN     *0000382183*     01516263     *688,100*     688,100
    ARN     *0000382183*     01516263     *688,100*     688,100
    ARN     *0000382183*     01516263     *688,100*     688,100
    ARN     *0000382183*     01515789     *682,680*     682,680
    ARN     *0000382183*     01510809     *624,140*     624,140
    ARN     *0000382183*     01507681     *590,261*     590,261
    ARN     *0000382183*     01507681     *590,261*     590,261
    ARN     *0000382183*     01507681     *590,261*     590,261
    ARN     *0000382183*     01484993     *454,927*     454,927
    ARN     *0000382183*     01484993     *454,927*     454,927
    ARN     *0000382183*     01484993     *454,927*     454,927
    ARN     *0000382183*     01477592     *448,231*     448,231
    ARN     *0000382183*     01477592     *448,231*     448,231
    ARN     *0000382183*     01456544     *428,902*     428,902
    ARN     *0000382183*     01456544     *428,902*     428,902
    ARN     *0000382183*     01429778     *403,175*     403,175
    ARN     *0000382183*     01427677     *401,055*     401,055
    ARN     *0000382183*     01427677     *401,055*     401,055
    ARN     *0000382183*     01427677     *401,055*     401,055
    So, as you can see, I want the query to select from the above results, the top/1st record of "Comment_Text" and set it to the ":parn" WITHOUT prompting the user to enter it. Then I want the script to change all other "Identifier_Type" to 'ARN2' that do not share the first "Comment_Text"....so in this example, I would want all 'ARN' changed to 'ARN2' that do not have "Comment_text" = 01550228.
    I hope this isnt too confusing, because it is to me. Thanks in advance for all the help.

    Hi,
    So you have a query that shows all rows, and you want to UPDATE the rows in that reuslut set that do not have the greatest value of comment_text. You can use the analytic DENSE_RANK function to number the distinct comment_texts, and then discard the rows that were assigned #1. the remained will be the ones you wqant to UPDATE.
    Here's one way to do that:
    UPDATE     offender_case_idetifiers
    SET     identifier_type     = 'ARN2'
    WHERE     (offender_book_id, comment_text)
         IN (
                WITH    got_r_num    AS
                    SELECT  vhb.offender_book_id
                 ,        oci.comment_text
                 ,        DENSE_RANK () OVER (OREDER BY oci.comment_text  desc)
                                 AS r_num
                 FROM    offender_case_identifiers oci
                 ,         v_header_block           vhb
                 WHERE   oci.offender_book_id      = vhb.offender_book_id
                 AND         vhb.offender_id_display   = :ppid
                 AND        oci.identifier_type           = 'ARN'
                SELECT  offender_nook_id
                ,       comment_text
                FROM    got_r_num
                WHERE   r_num     > 1
    AND     identifier_type     = 'ARN'
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    If you're asking about a DML statement, such as UPDATE, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Update statements encounterd  Errors  OGG-01168 & SQL error 1403 mapping

    Hi Expetrs,
    Update statements throwing below error:
    2012-11-07 10:40:11  WARNING OGG-00869  Oracle GoldenGate Delivery for Oracle, rep1.prm:  No unique key is defined for table AAAA. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.
    2012-11-07 10:40:12  WARNING OGG-00869  Oracle GoldenGate Delivery for Oracle, rep1.prm:  No unique key is defined for table AAAA. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.
    2012-11-07 10:40:15  WARNING OGG-00869  Oracle GoldenGate Delivery for Oracle, rep1.prm:  No unique key is defined for table BBBB. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.
    2012-11-07 10:40:15  WARNING OGG-00869  Oracle GoldenGate Delivery for Oracle, rep1.prm:  No unique key is defined for table BBBB. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.
    2012-11-07 10:40:16  WARNING OGG-01004  Oracle GoldenGate Delivery for Oracle, rep1.prm:  Aborted grouped transaction on 'abc.BBBB', Database error 100 (retrieving bind info for query).
    2012-11-07 10:40:16  WARNING OGG-01003  Oracle GoldenGate Delivery for Oracle, rep1.prm:  Repositioning to rba 17466 in seqno 1384.
    2012-11-07 10:40:16  WARNING OGG-01154  Oracle GoldenGate Delivery for Oracle, rep1.prm:  SQL error 1403 mapping abc.BBBB to abc.BBBB.
    2012-11-07 10:40:16  WARNING OGG-01003  Oracle GoldenGate Delivery for Oracle, rep1.prm:  Repositioning to rba 20104 in seqno 1384.
    2012-11-07 10:40:16  ERROR   OGG-01296  Oracle GoldenGate Delivery for Oracle, rep1.prm:  Error mapping from abc.BBBB to abc.BBBB.
    2012-11-07 10:40:16  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, rep1.prm:  PROCESS ABENDING.If I use KEYCOLS:
    --extract file:
    TABLE abc.INDIA , KEYCOLS (ID);--replicat parameter file
    MAP abc.INDIA, TARGET abc.INDIA , KEYCOLS (ID);Encountered below error
    2012-11-09 00:37:54  WARNING OGG-00869  Oracle GoldenGate Delivery for Oracle, rep1.prm:  No unique key is defined for table INDIA. All viable columns will be used to represent the key, but may not guarantee uniqueness.  KEYCOLS may be used to define the key.
    2012-11-09 00:48:34  ERROR   OGG-01168  Oracle GoldenGate Delivery for Oracle, rep1.prm:  Encountered an update for target table abc.INDIA, which has no unique key defined.  KEYCOLS can be used to define a key.  Use ALLOWNOOPUPDATES to process the update without applying it to the target database.  Use APPLYNOOPUPDATES to force the update to be applied using all columns in both the SET and WHERE clause.
    2012-11-09 00:48:34  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, rep1.prm:  PROCESS ABENDING.any clues plz ??
    Regards,
    Edited by: user13403707 on 19 Nov, 2012 10:55 PM

    If you know of any columns that can be used to identify the records you want to replicat changes to at the target table, use them as KEYCOLS.
    Then add supplemental logging using those columns as
    ADD TRANDATA owner.table_name, COLS (col1, col2).
    If you can't think of any such columns, just do
    ADD TRANDATA owner.table_name;
    It will add supplemental logging with the below warning
    2012-11-19 09:59:13 WARNING OGG-00869 No unique key is defined for table table_name. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
    Logging of supplemental redo data enabled for table owner.table_name.

  • Rollback from update statement

    Hello folks,
    I am using oracle 10G.
    Just before sometime I have fired one Update statement (without where clause) Due to this all the records in the table have been modified. also I have disconnected from this session :(
    Is there any way to rollback this work ?
    (please note that I do not have database backup with me right now.. there is long process to reload the
    original data from table from backup)

    This method is old which is used on 9i but i think you can also used it in 10g
    DECLARE
    CURSOR cur_item_mst is
         SELECT * FROM item_master;
    v_row_item_mst item_master%ROWTYPE;
    BEGIN
         Dbms_flashback.enable_at_time(TO_TIMESTAMP ('22-SEP-2008 13:00:00','DD-MON-YYYY HH24:MI:SS'));
         Open cur_item_mst;
         Dbms_flashback.disable;
         Loop
              Fetch cur_item_mst INTO v_row_item_mst;
              Exit when cur_item_mst%NOTFOUND;
              INSERT INTO item_master VALUES (
                   v_row_item_mst.itemno,
                   v_row_item_mst.description,
                   v_row_item_mst.rate);
         END LOOP;
         CLOSE cur_item_mst;
         COMMIT;
    END;
    / If is all dependent on the size of undo_retension parameter for how long the undo is saved.
    Please change the time & date according to your requirnment.
    Regards
    Singh
    Edited by: Singh on Sep 22, 2008 3:56 PM

  • Error while schedulingg update stat in db13

    Dear Experts,
    Please look into my issue we are facing an error while scheduling update statistics in db13 and I tried to open detailed log
    It is given
    SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: program_start_error: For More Information, See SYS
    Please help me how to solve this my error
    Regards

    Hi,
    Check the owner for BRBACKUP, BRARCHIVE, and BRCONNECT in kernel,
    these files should be with SIDADM, if not change the owner to SIDADM and rerun the update stats.
    and also Refer the note 446172
    Regards,
    Ram

  • How do I pass multiple values from a text box to an update statement

    I hope this does not sound to lame. I am trying to update multiple values Like this:
    Code|| Computer Desc || Computer Price || Computer Name
    SEL1 || Apple macbook || 1564 || Apple Macbook Basic
    SEL2 || Dell 630 || 1470 || Dell Latitude
    I want to change all six values at once in one update statement based on the Code, I can't find a good tutorial/example to help me.
    Can anyone point me in the right direction?
    Thanks so much,
    Laura

    You can do conditional updates with decode or case statements e.g.
    SQL> create table t as
      2  select 'SEL1' as code, 'Apple macbook' as comp_desc, 1564 as comp_price, 'Apple Maxbook Basic' as comp_name from dual union
      3  select 'SEL2', 'Dell 630', 1470, 'Dell Latitude' from dual
      4  /
    Table created.
    SQL>
    SQL> update t
      2  set comp_desc = CASE code WHEN 'SEL1' THEN 'Test1' Else 'Test2' END,
      3      comp_price = CASE code WHEN 'SEL1' THEN 1234 Else 2345 END,
      4      comp_name = CASE code WHEN 'SEL1' THEN 'Test1 Name' Else 'Test2 Name' END
      5  /
    2 rows updated.
    SQL>
    SQL> select * from t
      2  /
    CODE COMP_DESC     COMP_PRICE COMP_NAME
    SEL1 Test1               1234 Test1 Name
    SEL2 Test2               2345 Test2 Name
    SQL>

Maybe you are looking for

  • A few questions in purchasing a new MacBook Pro

    I have recently become a full Apple fan (I have been a PC person for nearly 28 years), and am in the process of purchasing a new MacBook Pro (as my old HP Pavilion is on it's last legs).  As I am in this process, I am trying to decide which MacBook P

  • Passing JavaScript Var ---- to java method....URGENT...PLEASE ...HELP

    I am doing a simple java Servlet example... I have value that is assigned in a one of the javascript function(). Below i have the function where i get the columnValue.... i want to use that value in the doPost method in my Servlet1 class... Can someo

  • Blank images in slideshow

    I have just downloaded iphoto 11. I am able to see thumbnail pictures, but am unable to see images in slideshow. I only see blanks. Anyway round the problem? Imatong

  • Is there a way to remove the add box under the google searchbar on the "mozilla firefox start page" ?

    I always liked the standard google start page for firefox, but with this new 4.0 there's an ugly add box below the search bar, nagging about "learn about all the cool things" or something named "Spark" or all sorts of other spam. So is there a way to

  • JDev 10.1.3 and data control

    I didn't find the data control palette in JDev 10.1.3. Does it mean data control are not yet implemented in this preview or do i something wrong ? Is it possible to obtain a version with data control implemented. We only use this portion of adf with