Return Into.  Can I return the old value in an update statement?

Hello - I have an update statement and I need the value of a field, prior to the update. Is it possible to use the Return Into to do this? Or do I have to have a separate select statement prior to the update statement in order to store that value in a variable?
Thanks!

RETURNING INTO is valid for an UPDATE, but it returns the new value, not the old value.
SCOTT @ nx102 Local> select * from a;
      COL1
         4
Elapsed: 00:00:00.00
SCOTT @ nx102 Local> ed
Wrote file afiedt.buf
  1  declare
  2    l_old_col1 number;
  3  begin
  4    update a
  5       set col1=col1+1
  6     returning col1 into l_old_col1;
  7    dbms_output.put_line( l_old_col1 );
  8* end;
SCOTT @ nx102 Local> /
5
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00If you are trying to track historical changes, have you looked at Workspace Manager? That can be far easier than writing your own change tracking code...
Justin

Similar Messages

  • I can't get the old account out my update

    I can not get the old account off even if I sign in on my new account the old still show up and I can't update how do I get the old one out my iPad I tried signing out and in, my new account is in but when I try to update something an old account pops up and I can't do anything

    Settings > iTunes and App Store > Apple ID = Sign Out... Then Sign In using the preferred Apple ID.
    Dinky710 wrote:
    ... but when I try to update something an old account pops up ...
    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID

  • Can we see the old value using rollback segment no?

    hi
    querying the following
    SELECT * FROM joschedule AS OF TIMESTAMP To_Timestamp('5-jul-09 8:50:58','DD-MON-YY HH24:MI:SS') where unitid = 1 and joborderno = '91260050' but im getting the following error. How to see the using the segment no.
    ORA-01555: snapshot too old: rollback segment number 1 with name "_SYSSMU1$" too small kanish

    Well, as the error says, you do not have the rollback anymore that is required to build the old snapshot that your query specifies.
    You may want to increase the undo_retention parameter to specify how long Oracle should (try to) hold on to rollback data for this type of queries.

  • I am trying to activate my program into my new computer (the old one was run over by a car) and it says I have exceeded my installations.  It's Adobe Audition 3 (you can see I've been using it a long time) and I rely on it for work everyday.  Please advis

    I am trying to activate my program into my new computer (the old one was run over by a car) and it says I have exceeded my installations.  It's Adobe Audition 3 (you can see I've been using it a long time) and I rely on it for work everyday.  Please advise.

    The activation server for Audition 3 was shut down by Adobe several years ago.
    You now need to download the non-activation version provided by Adobe here
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Install then enter the new serial number provided by Adobe at that link. Your existing serial number will no longer work.

  • I changed my Apple ID and password.  Now I can't sign into icloud on my mobile devices.  They have my old id and I can re her the old password for icloud.

    I changed my Apple ID and password.  Now I can't sign into icloud on my mobile devices.  They have my old id and I can re her the old password for icloud.

    Hello Martin,
    Thank you for the details of the issue you are experiencing with your iCloud account on your Mac.  I recommend signing out of iCloud first:
    On your Mac, open iCloud preferences, then click Sign Out.
    iCloud: Change iCloud feature settings
    http://support.apple.com/kb/PH2613
    If you are still being prompted for your password, I recommend the steps in the following article (this article refers to an iOS device, but the steps are still relevant for your Mac as well):
    iOS 7: If you're asked for the password to your previous Apple ID when signing out of iCloud
    http://support.apple.com/kb/TS5223
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How can we include the property value into the News RSS?

    We have defined object property u201CDepartmentu201D that is used in News XML creating form. How can we include the property value into the News RSS (set value of the particular RSS XML tag)?

    We have solved the issue with NWDS

  • JbiValidator calls the setAttribute to the old value when validate fails

    I tried to implement a Custom Validator by extending a JboValidator Interface. I applied the validator to an attribute. I tested the the validation on a JSF page. When I input an invalid value on the attribute, the validator runs but the problem is the framework sets the value of the attribute to its old value by calling again the setter function (setAttribute()) which in turn calls the validator again.
    This is what I have observed. If this is what the framework really does, then how can I suppress the firing of the validator when it sets it back to the old value?
    regards,
    Anton

    Thanks to all for your responses. Regarding accessing of new value inside value change listener, I am sure ValueChangeEvent.getNewValue() is not going to give me the value with proper data type. I am not using immediate attribute anywhere but use custom domain data type with masking (i.e. Formatter Format). Also I use InputDate field. Always valueChangeEvent.getNewValue() gives me the string representation of the value but not with actual data type.
    Question:
    1. Is there any API, that gets the valueChangeEvent.getNewValue() and the UI components as parameters and return the data with proper data type?
    2. I need to get the newly value with proper data type inside valueChangeListener. Is it achievable? If so, how?
    Need your help.

  • Where can I find the scale value of mx:Image with scaleContent enabled?

    Hey all
    Like the topic says, where can I find the scale value of the image content using an mx:Image with scaleContent set to true. Both the scale on the image object and the image.content is 1 (resizing is probably done by a matrix).
    To put things into context: I'm loading a picture from the filesystem and then use the Marilena facedetection to check for faces. When I find any faces I draw on a overlaying UIComponent the box where the face is. Because the detections returns the position of the face based on the unscaled bitmapdata the box indicating the face is not in the right position. In order to get this right I need the scale factor of the mx:Image scaleToFit.
    tnx in advance!

    Nope, there it is also 1.
    I solved it by calculating it myself:
    detectLayer.scaleX = detectLayer.scaleY = image.width>image.height?Bitmap(image.source).width/image.width:Bitmap(image.source).heig ht/image.height;

  • How can i pass the Input value to the sql file in the korn shell ??

    Hi,
    How can i pass the Input value to the sql file in the korn shell ??
    I have to pass the 4 different values to the sql file and each time i pass the value it has to generate the txt file for that value like wise it has to generate the 4 files at each run.
    can any one help me out.
    Raja

    Can you please more elaberate., perhaps you should more elaberate.
    sqlplus is a program. you start it from the korn shell. when it's finished, processing control returns to the korn shell. the korn shell and sqlplus do not communicate back and forth.
    so "spool the output from .sql file to some txt file from k shell, while passing the input parameters to the sql file from korn shell" makes no sense.

  • How to get the old value of the ValueChangeEvent

    I'm using the JSF component selectManyListbox. I have assigned a value change listener to it. When I try get the old value using getOldValue() of the ValueChangeEvent Im always getting a null value. The only value Im getting is from the method getNewValue(), which is the last item I clicked in the selectManyListbox items before submitting the whole form. Is there a way to get the old value of this component or Im doing something wrong?

    Here is the partial bean code
    public class TestUI extends PageCodeBase {
         private static Logger logger = Logger.getLogger(pagecode.protected1.TestUI.class);
         protected Object [] menuValue;
         protected Object [] listBoxValue;
         protected List allTaskCodes;
         * @return Returns the listBoxValue.
         public Object[] getListBoxValue() {
              return listBoxValue;
         * @param listBoxValue The listBoxValue to set.
         public void setListBoxValue(Object[] listBoxValue) {
              this.listBoxValue = listBoxValue;
    public void handleSelectManyListboxValueChange(
                   ValueChangeEvent vce) {
              logger.debug(".. first component was heard..");
              String[] s1 = (String[]) vce.getOldValue();
              String[] s2 = (String[]) vce.getNewValue();
              //vce.getComponent().
              if (s1!=null&&s1.length!=0) {
                   logger.debug("length of first array is " + s1.length );
              //for(int i=0; i<s1.length; i++)
                        logger.debug("value of old is " + s1[0] );
              if (s2!=null&&s2.length!=0) {
                   logger.debug("length of second array is " + s2.length );
                   //for(int i=0; i<s1.length; i++)
                        logger.debug("value of new is " + s2[0]);
    Here is the jsf code
    <h:selectManyListbox styleClass="selectManyListbox" id="listbox1"
                        size="3" valueChangeListener="#{pc_TestUI.handleSelectManyListboxValueChange}"
    onchange="submit()" value="#{pc_TestUI.listBoxValue}">
    <f:selectItem itemValue="value1" itemLabel="select1" />
                        <f:selectItem itemValue="Value2" itemLabel="select2" />
                        <f:selectItem itemValue="Value3" itemLabel="select3" />
    <f:selectItem itemValue="value4" itemLabel="select1" />
                        <f:selectItem itemValue="Value5" itemLabel="select2" />
                   </h:selectManyListbox>

  • I don't like the latest Firefox. Can I keep the old one without problems?

    At work I have v. 3.6.19 and it is asking me to upgrade to 5.0.1. I have a brand-new iMac at home and I installed the newest Firefox just a couple of months ago, so I probably have the 5.0.1. In any case, I don't like the new one's interface. Instead of having separate reload and stop buttons to the LEFT of the url window, there's a single reload/stop button (and it seems smaller than the old ones) attached to the RIGHT of the url window. Since I have a 27" screen on my new computer, it means I have to move the mouse WAY UP TO THE RIGHT to reload a screen, which is hard on my mousing hand. That may sound like nitpicking to you, but I'm finding it to be a problem. Also, the Home button seems to have disappeared. I just don't find the ease of use to be the same as with the one I still have at work. So I guess my question is twofold: 1) can I keep the old version at work and still upgrade the Flash (as it's asking me to do as well)?; and 2) can I put an older version on my iMac at home?
    I used to work in software (although not as an engineer), and in my opinion, newer does not always equal better. A case in point, it used to be easier to return to a previous page using the top toolbar, but as the versions change the function seems to be harder to use.

    Hey paulwisc,
    If you are just unhappy with the location of the Home button, you can move it to any toolbar location that you like. [https://support.mozilla.com/en-US/kb/how-do-i-customize-toolbars?s This article] will give you all the steps you need to customize the toolbar.
    Is that the only reason you want to roll back? If you have other reasons, you should consider [http://input.mozilla.com/en-US/feedback leaving feedback] for the developers so that they can continue to improve the product.
    If you still want to roll back to a previous version of Firefox, just take a look at the Knowledge Base article [[Installing a previous version of Firefox]].
    Hopefully this helps!

  • How can I findout the coulm value contains 0 through 9 for the table

    could u plz suggest me how can I findout the coulm value contains <> 0 through 9 for the table...

    Well I am going to give it a shot, because I believe I am looking for the same thing.
    I have a value that is of type varchar2. How can I determine if it has special characters or alpha characters in it? In other words, I only want the value to consist of numbers. (Initially it had been thought that Letters would be used as well, but now they just want numbers and the datatype of the column cannot be altered since there is data in it.)
    I have gotten this far, but I do not know what else I can use besides '[:alpha:]'? I cannot seem to find this documented anywhere...I can find the regexp package reference, but not the character classes...
    select regexp_instr('1a23456', '[[:alpha:]]',1,1,1, 'i') x
    from dual
    This works fine = returns 3, so I know there is an alpha character.
    select regexp_instr('1$23456', '[[:alpha:]]',1,1,1, 'i') x
    from dual
    This returns 0 - what do I need to change so that it detects the '$' and returns 3?
    Thanks!!
    Janel

  • How can I get the edited value from the editor in JTable

    I have a JTextField added as an editor to a cell in JTable.
    I value gets changed when I press enter.
    but in actionPerformed of the JTextField when I say
    String txtEditorValue = txtEditor.getText();
    I am getting the old value. How can I get the edited value? Thanks.

    Hi,
    I guess, your understanding of how JTable works together with its models is not good enough - for example the method getTableCellEditorComponent(...) of the TableCellEditor interface is used to get the component, that should be used as editing component - its second parameter is a value that should be used to setup the editing component - it is normally not the editing component itself.
    JTable uses an underlying TableModel to store the cell values - if you have edited a cell, JTable gets the value of the editing component by itself and stores it in the TableModel using its setValueAt(...) method. To retrieve this data you only need to query the TableModel using row and column of this cell as parameters
    say jt is your JTable, and row and column are the row and column of the cell - so to get the value, simply use
    Object obj = jt.getModel().getValueAt(row,column);
    if you know, that there is a String in this cell use
    String str = (String) jt.getModel().getValueAt(row,column);
    The editor component is used for the view of the JTable - you only want the data, which is stored in the model - you don't have to deal with the GUI components in this case.
    greetings Marsian

  • I have 2 ipod touches. I backed up the new one with old's info. The old one will not unlock with the password I had wrote down and I tried my new ones password.  How can I reset the old ipod without affecting the new one and how can I unlock the old one?

    I have 2 ipod touches. I backed up the new one with old's info. The old one will not unlock with the password I had wrote down and I tried my new ones password.  How can I reset the old ipod without affecting the new one and how can I unlock the old one?

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software

  • How can I remove the old apple id from my ipod 4rth gen to log in my new apple id ? (my old apple id keeps showing automatic I can't put my prefer new apple id)

    How can I remove the old apple id from my ipod 4rth gen to log in my new apple id ? (my old apple id keeps showing automatic I can't put my prefer new apple id)

    - Note that apps are locked to the account that purchased them.
    - To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.

Maybe you are looking for