1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Oracle GRC - Reject SQL for Flow Rule

Discussion in 'SQL PL/SQL' started by sambicheno, Nov 11, 2009.

  1. sambicheno

    sambicheno Guest

    I'm trying to write an SQL statement that will set the DATE_TO as the CHANGE_DATE for the PAY_PROPOSAL_ID with the highest OBJECT_VERSION_NUMBER and set the DATE_TO to NULL for the next highest OBJECT_VERSION_NUMBER within the PER_PAY_PROPOSALS table when the new entry is first made to the table. I then need want to reverse this, after the salary change has been approved.

    I've tried the following, but with no success:

    UPDATE PER_PAY_PROPOSALS
    SET DATE_TO = CHANGE_DATE WHERE MAX(OBJECT_VERSION_NUMBER)
    SET DATE_TO = NULL WHERE OBJECT_VERSION_NUMBER IS MAX(OBJECT_VERSION_NUMBER) -1

    Any ideas gratefully received.
     
  2. rajavu

    rajavu Forum Guru

    Messages:
    853
    Likes Received:
    53
    Trophy Points:
    610
    Location:
    @ Bangalore , India
    Nothing is clear from the post. Please repost with more precise description , Create table scripts and sample data.