I want to save updated record only in stage table from the form..

I have created form with two block
1...criteria base block
2....details block....(This database block i.e. on stage table).
I am inserting data into detail block (i.e. stage table )with no commit through find button.
data is showing there with status 'FRESH'
suppose i changed item cost, now status goes change to 'NEW'
now when i am saving it is saving all data into stage but i want to save only data with 'NEW' status.
Please Help me
I tried it by deleting data from stage where status ='FRESH' on post_update trigger but is not supporting.
Edited by: ManojT on Sep 3, 2009 6:52 AM

Hi I am using this procedure in find button to get data on detail block
PROCEDURE GET_ITEM_DATA IS
i number :=0;
L_COUNT NUMBER;
S_COUNT NUMBER;
CURSOR GET_DTL IS
(SELECT MSI.SEGMENT1 AS "ITEM" ,
MSI.ITEM_TYPE,
MICV.CATEGORY_SET_NAME,
XXCAVM_GET_ITEM_COST_PKG.CAVM_GET_COST_DATE(MSI.INVENTORY_ITEM_ID,ORG.ORGANIZATION_ID,3) "LAST_UPDATE_DATE",
XXCAVM_GET_ITEM_COST_PKG.CAVM_GET_ITEM_COST(MSI.INVENTORY_ITEM_ID,ORG.ORGANIZATION_ID,1) "ITEM_COST_F",
XXCAVM_GET_ITEM_COST_PKG.CAVM_GET_ITEM_COST(MSI.INVENTORY_ITEM_ID,ORG.ORGANIZATION_ID,3) "ITEM_COST_P",
MSI.INVENTORY_ITEM_ID,
ORG.ORGANIZATION_ID,
ORG.ORGANIZATION_CODE
FROM
(SELECT ORGANIZATION_CODE,ORGANIZATION_ID
FROM ORG_ORGANIZATION_DEFINITIONS ) ORG,
MTL_SYSTEM_ITEMS_FVL MSI,
MTL_ITEM_CATEGORIES_V MICV
WHERE CATEGORY_SET_NAME LIKE 'Product'
AND MSI.INVENTORY_ITEM_ID =MICV.INVENTORY_ITEM_ID
AND MSI.ORGANIZATION_ID = MICV.ORGANIZATION_ID
AND ORG.ORGANIZATION_ID = MSI.ORGANIZATION_ID
AND ORG.ORGANIZATION_ID = MICV.ORGANIZATION_ID
AND MSI.INVENTORY_ITEM_STATUS_CODE = 'Active'
AND MSI.SEGMENT1 =NVL(:CTRL_BLK.INV_ITEM,MSI.SEGMENT1)
AND MICV.CATEGORY_SET_NAME = NVL(:CTRL_BLK.ITEM_FAMILY,MICV.CATEGORY_SET_NAME)
AND MSI.ITEM_TYPE = NVL(:CTRL_BLK.ITEM_TYPE,MSI.ITEM_TYPE)
AND ORG.ORGANIZATION_CODE = NVL(:CTRL_BLK.ORGANIZATION,ORG.ORGANIZATION_CODE));
--AND MSI.INVENTORY_ITEM_ID = 8063
--AND MSI.ORGANIZATION_ID=204);
BEGIN
FOR GRD IN GET_DTL LOOP
     SELECT COUNT(*) INTO S_COUNT FROM XXCAVIUM_ITEM_CST_STG
     WHERE ITEM = GRD.ITEM
     AND ORG = GRD.ORGANIZATION_CODE
     AND ITEM_TYPE = GRD.ITEM_TYPE
     AND CATEGORY_SET_NAME = GRD.CATEGORY_SET_NAME;
          IF S_COUNT >0 THEN                         
                                        NULL;
                    ELSE
                    INSERT INTO XXCAVIUM_ITEM_CST_STG
                         (ORG,CATEGORY_SET_NAME,ITEM,COST_PENDING,
                         COST_FROZEN,ITEM_TYPE,LAST_UPDATE_DATE,
                         COST_TYPE_ID,ORGANIZATION_ID,
                         INVENTORY_ITEM_ID,COST_ELEMENT,STATUS)
                         VALUES(GRD.ORGANIZATION_CODE,GRD.CATEGORY_SET_NAME,GRD.ITEM,GRD.ITEM_COST_P,GRD.ITEM_COST_F      ,
                         GRD.ITEM_TYPE,GRD.LAST_UPDATE_DATE,3,GRD.ORGANIZATION_ID,GRD.INVENTORY_ITEM_ID,'Material','FRESH');
                    END IF;
END LOOP;
GO_BLOCK('XXCAVIUM_DTL_BLK');
EXECUTE_QUERY;
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.DEBUG('Exception occured during the process. Error Message: '||SQLERRM);
END;
Please suggest if any

Similar Messages

  • How to insert 20 records  only in one table

    hi to all,
    i want insert 20 records only in a table,but suppose i want to enter 21th record it will not inserted .
    suppose delete one record then insert, it will insert.
    but always count(*) is not greater than 20.
    is there any solution for that,
    pls help me

    Yes there is a solution for that using a materialied view:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> drop table t purge;
    Table dropped.
    SQL> drop materialized view t_mv;
    Materialized view dropped.
    SQL> create table t (
      2  x integer,
      3  y varchar2(30)
      4  );
    Table created.
    SQL> CREATE MATERIALIZED VIEW LOG on t
      2  WITH ROWID (x, y)
      3  including new values;
    Materialized view log created.
    SQL> CREATE MATERIALIZED VIEW t_mv
      2  REFRESH FAST ON COMMIT AS
      3  SELECT count(*) cnt
      4  FROM t;
    Materialized view created.
    SQL> alter table t_mv ADD CONSTRAINT chk check(cnt<=20);
    Table altered.
    SQL> insert into t select object_id, object_name from all_objects where rownum <
    21;
    20 rows created.
    SQL> commit;
    Commit complete.
    SQL> insert into t values(21,'KO');
    1 row created.
    SQL> commit;
    commit
    ERROR at line 1:
    ORA-12008: error in materialized view refresh path
    ORA-02290: check constraint (TEST.CHK) violated
    SQL>
    SQL> select count(*) from t;
      COUNT(*)
            20
    SQL>Not sure that trigger based solution works due to multi versioning read consistency.

  • I have to restore my phone from back up but in order to do it i had to update my software. now that my software is updated there isnt enough room on the phone to back up. is there a way to only restore certain things from the backup like contacts?

    i have to restore my phone from back up but in order to do it i had to update my software. now that my software is updated there isnt enough room on the phone to back up. is there a way to only restore certain things from the backup like contacts?

    Because it says it's incompatible when it can't be, I got hope. I get error messages all the time with my iPod and iPhone that it cannot sync and that 'this device is not capapble of connecting to iTunes' stuff. I literally forget that happened, plug it in again and it works, I later realize that iTunes made a mistake, they do that.

  • How do I record only a select portion of the screen?

    I can't seem to figure out how to record only a select portion of the screen.

    QuickTime X screen recording feature doesn't offer anything except the entire display.

  • Access is not inserting, updating or deleting records in my database table on the server

    I am having a problem with an application I developed using Dreamweaver 8 and Access 2000 several years ago which is no longer working correctly. The problem is that Access is not inserting, updating or deleting records in my database table on the server but is reflected in changes to my Web site. I used the Dreamweaver server behaviors: insert record, update record and delete record to make the changes to my Access table on the server. My Access table on the server shows all of the records I inserted or updated in the past, but not any of the newly inserted on updated records.
    does any one have any ideas as to what my problem is?
    Jim

    No, that has nothing to do with your problem. Let's make sure I understand the symptoms.
    1) Your site is online at a remote host.
    2) You use a dynamic page in your online site to update a database record (insert, delete, or update)
    3) The update then appears correctly on your dynamic content page.
    4) You download the mdb and it appears to not have any of the upates you just made.
    Please correct any of these statements if they are wrong.
    If the above is correct, then you must be looking at a cached mdb, or the mdb you are looking at is in the wrong location. Do this: search your entire drive for copies of the mdb, including in the Windows temp directories which is likely where the cached copy is located. Delete any extra copies and download again.

  • Hi, i purchased and downloaded the lr6 desktop app (update), and used my serial number from the email from adobe but it said it was only eligible for lr5. thanks, rich

    hi, i purchased and downloaded the lr6 desktop app (updating from lr5, paid 80. for the update), and used my serial number from the email from adobe sentbut it said it was only eligible for lr5. thanks, rich

    If you purchased an upgrade from LR5 to LR6 then after you enter your LR6 serial number, you will need to enter your LR5 serial number, unless LR6 finds LR5 on the computer.  This also assumes that you've purchased the perpetual license of both LR5 and LR6, not a cloud license for LR5 which doesn't use a serial number for licensing.  If entering a LR6 then LR5 serial number into LR6's serial-number area isn't working, then is there something special about the LR5 that would make it ineligible for an upgrade?

  • TS3694 how do i restore my iphone3, got error 3014, seems that the update/restore only can be used from iphone3g and new'er

    how do i restore my iphone3, got error 3014, seems that the update/restore only can be used from iphone3g and new'er

    Go to to your Users/Home/Library/Application Support/iWeb folder in the Finder and then enter  Time Machine.  Go back to the last backup that has the domain file, select it and use the Restore button.
    OT

  • Delete record from the form and from the database

    hi,
    i want delete record from the form and the database ,but the record is only delete from the from !!!
    this is my code :
    if //condition then
    delete_record;
    commit;
    end if ;
    Any solutions ??
    thnx

    You have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
    When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
    As oracle is not able to insert your commit fails and stops your deletion of record from table

  • I updated my iPod touch 4th generation from the latest iOS 4 update (i think maybe iOS 4.3.5 or something like that) to iOS 5.1.1 and my Photos, Videos, contacts, music, App data, etc. was deleted. How can I all the data back?

    I updated my iPod touch 4th generation from the latest iOS 4 update (i think maybe iOS 4.3.5 or something like that) to iOS 5.1.1. I updated to iOS 5.1.1 on a Windows XP Home Edition with the Service Pack 3 installed on the Windows XP (which I believe is the latest version). After updating, I unplugged my iPod from the computer. I saw that all my photos and videos were on my iPod, but there were no apps. A window popped up and told me to enter a passcode for my iPod. I entered a passcode. I then locked my iPod and entered what I thought to be the correct passcode, but my iPod remained unlocked. Desperate, I tried many passcodes with failure. After a while, my iPod became disabled for a long time. I decided to reset my iPod. After I reseted it, I chose to reset from my earlier back up. After reseting, my computer loaded on all my apps. But, when I started using my iPod, I realized all my photos, videos, music, app data (like game saves and high scores), etc. were gone! I have no idea what to do and I am very stressed about this! SOMEONE PLEASE HELP ME GET ALL MY STUFF BACK!!!!!!

    Go to iTunea>Preferences>Devices and see if there is a backupright at the time you did the update. Then try restoring from that backup. If the apps are in your iTunes library, any app data will be restored to the iPod.
    When restoring from an iOS 4 (or later) backup, if the device had a passcode set, iTunes will ask if you want to set a passcode (and remind you that you had protected your device with a passcode). iTunes will not ask you to set a passcode when restoring from iOS 3.x and prior backups.
    Therefore, remembe the passcode that you enter this time.
    It appears that if you restore from a backup, that backup is not subseqyently overwritten by the next backup.

  • Whenever I updated or downloaded a new app from the App Store, a message appears saying:   "Account Not In This Store Your account is not valid for use in the U.S. store. You must switch to the Swedish. store before purchasing."   I made some research onl

    Whenever I updated or downloaded a new app from the App Store, a message appears saying:
    "Account Not In This Store
    Your account is not valid for use in the U.S. store. You must switch to the Swedish. store before purchasing."
    I made some research online and asked a few of my friends with the same problem. All they did was sign out of iTunes from settings>iTunes & App Stores or from the App Store itself and signed back in. It worked for many of them but not with my iPhone 4s. It really does get on my nerves to always sign out and back in to the App Store as it sometimes works and allows me to update and download or most of the time it doesnt.
    When viewing my Apple ID account on my iPhone (after entering the password) it either views my account or says:
    "This Apple ID is only valid for purchases in the U.S. iTunes Store. You will be switched to that Store. Try your purchase again."
    So I press on OK then either switches me to the App Store app of its choice, or says "Cannot connect to iTunes Store".
    I tried restoring iOS6 hoping it was a bad installation, but i still have the same problem.
    Can anyone help me please?
    Arian

    Are you sure your AppleID is NOT tied to the US store? If you are trying to buy an app from the Swedish store you will be unable to do that. Some apps are only available on certain stores. That is why you get the "Cannot connect to the iTunes store" message when trying to buy that app. Your updates are being done from the US store ; thats why you can update sometimes and sometimes not.
    If you keep encountering problems contact iTunes support. They will help you sort it out.

  • I have an agreement form created in word doc. i want to hire some one experience with formscentral to recreate the form and user be able to complete the agreement, sign it electronically (using echosign) then click submit. i will be alert of new response.

    i have an agreement form created in word doc. i want to hire some one experience with formscentral to recreate the form and user be able to complete the agreement, sign it electronically (using echosign) then click submit. i will be alert of new response. can someone connect me to where i can talk to someone can provide this service. i have sample of agreement form

    Hi c3 cyber club,
    Unfortunately FormCentral and Echosign are two different services and forms created in Forms central can only be submitted via and to Forms Central.
    We cannot have the form filled in using FormCentral and get it signed using Echosign.
    However, you can use Echosign directly and you can get most of the functionality.
    Thanks,
    Vikrantt Singh

  • Insert/update multiple tables from one form.

    I'm working on an app. that requires the user to fill out a form. The contents from the form is then used to either insert new records or update existing records in multiple tables. Is that possible? Can someone give a details example?

    You should create a form like you would create it having one table. Use row_id as primary key. The rest of the process are done by the triggers - those will take care of updating the right table depending which column was hit.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • If I want to change my Apple ID will my apps from the previous Apple ID get deleted?

    If I want to change my Apple ID will my apps from the previous Apple ID get deleted?

    No, it will just ask you for the password to your old Apple ID to update the apps in the future. Unless your talking about simply changing the email address associated with your Apple ID account.

  • Export dump only 1000 tables from the schema which contains 3000 tables.

    Hi,
    I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
    As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
    Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.
    Thanks in advance.
    Thanks,
    Orahar.

    I have an requirement to export the dump only with particular 1000 tables from the schema which contains 3000 tables.
    As I want to take the dump, I need to mention the List of tables in "TABLES" Parameter. But syntax won't allow for 1000 tables.
    Kindly guide me on this to proceed further to take the dump of only particular 1000 tables.You haven't mentioned the oracle release version.
    if you're using 10g, you could use datapump export/import to achieve this. Not a straight way.
    Check Metalink Export/Import DataPump Parameters INCLUDE and EXCLUDE - How to Load and Unload Specific Objects - 341733.1
    Under section 9. Exporting or Importing a large number of objects.
    HTH
    -Anantha

  • I'm trying to update my ipod touch 4th generetion from the version 4.2.1 to IOS 5 but I can't!

    I'm trying to update my ipod touch 4th generetion from the version 4.2.1 to IOS 5 but I can't, itunes says there is no new uptade for this device. Why is this happening, and what can i do?

    Do you have iTunes 10.5 installed?
    Do you really have a 4G iPod, the one with the camera?

Maybe you are looking for

  • Quantity is different from sale order and delivery

    Hi, Gurus, Quantity is different from sale order and delivery. I identified the Material in the sales order, the item category for this material as BOM. I have also checked the bill of material display header overview. The Base Quantity maintained as

  • Add a new attribute for user provisioining on SAP R3

    Hi, I want to add a new attribute for user provisioining on SAP R3. - I have added new attribute in Process form and Resource form - I think i need to add this attribute in lookup definition of SAP attributes also need to do mapping but i am not find

  • Reg:varray & nested table.

    Dear Friends, How varray & Nested table working internally in oracle.? When & Why to use varray & nested table.? Which is the faster from both of them.? Thanks.

  • IPod Touch stopped connecting to Internet (WiFi)

    Just unbelieveable-- I've been using my iPod Touch with a variety of WiFi connections the past 3 months, but really wanted WiFi at my home. So yesterday I got a D-Link DIR-635 Router acting as a bridge Router (connected to my older DI-604 Router) and

  • FI account assignment search help enhancement

    We are looking to either link html text or enhance SAP search help so when staff our choosing GL accounts in PR's & PO's they can look at guidance on what should be charged to specific accounts. Can such user defined help text be added to matchcode o