Displaying the rows that have been updated....

SQL> select * from spr;
EMP_NAME EMP_no age sex
hry 45353 42 M
spt 43436 34 M
pen 34533 21 M
aen 65475 33 M
SQL> select * from sprfac;
EMP_NAME EMP_no age sex Appraisal Extra_Time
hry 45353 N N
spt 43436 N N
pen 34533 N N
aen 65475 N N
I have a problem regarding updating the sprfac table.
What i need is to satisfy the following conditions and update the second table with values in the second table.
I need to upadate the second table when:
1. The emp_name and emp_no of first table matches with the second table and
2. The Appraisal field and extra_time field should be 'N' in the second table and
3. only if the values of age and sex are NULL.
Let me explain in detail.
My original table is sprfac. spr is Temporary Table.
I have some data in flat files and i have loaded all the data into a temporary table using sqlloader. Now i need to update the second table.
Originally the age and sex fields in the sprfac table are NULL. Once i update the age and sex fields in the sprfac table again if i do update it should not update the rows which have data in age and sex columns.
Suggest me how to update multiple columns simultaneously or send me the code for the update statement if possible.
NOTE: I have changed the tablenames and column names since i cannot keep the original tables here.
And i got the following reply........
update sprfac a
set (a.age, a.sex) = (select b.age, b.sex from spr b
where a.emp_name = b.emp_name
and a.emp_no = b.emp_no
and appraisal = 'N'
and extra_time = 'N')
where a.age is null
and a.sex is null;
Everything is working fine.
Is there any way to send the name and age fields which have been updated of sprfac to a file.
should i use cursors....
Send me the code if possible....
Thanks..........

You can try similar to this, if you have oracle 9i. In 8i merge does not work. In that case u have cursor.
merge into EMP e1
using akg_emp e2
on ( e2.empno = e1.empno AND e1.sal > 1000 AND <whatever condition on e1>)
when matched then
update set e1.sal = 100
when not matched then
insert ( empno, ename, job, mgr, hiredate, sal, comm, deptno )
values ( e2.empno, e2.ename, e2.job, e2.mgr, e2.hiredate, e2.sal, e2.comm,
e2.deptno )

Similar Messages

  • Hello I am having problems viewing areas of a pdf...it's a form fillable pdf that someone else has completed and saved..I'm able to view all but the areas that have been filled in.. any info would help

    Hello I am having problems viewing areas of a pdf...it's a form fillable pdf that someone else has completed and saved..I'm able to view all but the areas that have been filled in.. any info would help

    Hi Bob, I just tried your suggestion, but the interactive PDF is in spreads by default, no way to change the setting. When I choose to view by single page in Acrobat, it displays a single spread.
    When I choose to view by spreads, it displays 4 pages, two spreads. That's the topic of this whole discussion, I believe. I do own CS 6 at home, however my employer supplied me with CS 5.5. And I have very little, if any, influence on purchasing.
    So, I have no good way to make an interactive PDF (with differing recto/verso headers and footers), that is accessible and shows the correct header/footer. It's either single pages (with one header/footer), or recto/verso headers/footers but PDF only as a spread, as well as I can tell.
    Unless you know something else I can do...
    Best, Marilyn

  • HT201272 How do i see a list of the apps that have been downloaded and the dates and times and amounts?  Tried to follow the on-line thing but i want to compare what has been downloaded with my visa bill.  HELP!!

    How do i see a list of the apps that have been downloaded and the dates and times and amounts?  Tried to follow the on-line thing but i want to compare what has been downloaded with my visa bill.  HELP!!

    See this -> http://support.apple.com/kb/HT2727

  • Report with the alerts that have been thrown

    Hi all!
    We are using the XI alerts to send several e-mails according to the alert that have been thrown.
    Now, I would like to know if some report could be automatically generated showing the information of these alerts. Is it possible?
    Thanks in advance.
    Regards,
    Sergi

    Hi Sergi !
    That's strange. I assume you tried with a wide date range, just to be sure that it is not a filter issue.
    Try this:
    go to TX 'ALRTCATDEF', locate your alert category and write down the name. Maybe you can get it from the RWB Alert Inbox, I'm not sure. Anyway, in the ALRTCATDEF tx there will be one or more alert categories already defined. Also you can find the alert category in use in the part of the scenario where the alert is triggered.
    Then go to tx SLG1, in object filter keep the "*" and this time complete the "External ID" field with the name of the alert category, matching the case.
    Try to find the alert this way.
    Regards,
    Matias.

  • In a PrC, how to delete data from the PSA that have been loaded in Prcs Chn

    Hello,
    In a process chain, how can I delete the data from the PSA that have been loaded within that process chain. I don't want to delete data that belongs to other business units that use the same datasource.
    Thanks,
    Andre

    I dont think so you can achieve that, PSA is actually datasource dependent.
    One you load from a datasource to PSA.That is accesible by multiple DTPs if you have created so.
    As you said "I don't want to delete data that belongs to other business units that use the same datasource."
    If you delete the PSA, you may have to repull the data from source system again and if thats delta it wont work out.
    As said by above ppl you can include the "Delete PSA" in process chain but choose some 15 days buffer.
    Hope this helps.

  • Assigning View permission to all the users that have been selected in contact selector - SP 2010, InfoPath 2010

    I have a SharePoint InfoPath 2010 browser form with item level security. Only submitter
    and approvers has access to the form.  This form contains a people picker that is populated with the names of attendees
    for the meeting they attended (which
    I am able to store in Field2 below). I want to allow attendees to be able to view (grant view permission) the InfoPath form. Field 2 has the users in form of domain\user1;domain\user2; etc. Following the below step, I am getting error when I ADD or REPLACE
    permission on current item. How do I go about assigning view permission to all the users that have been selected in contact selector?
    Jitu

    Hi ,
    i understand that the text box and the people picker hold multiple user names and you want to grant user permission based on the user in the text box.
    I have a test based on your description,the results are: When there are multiple users in the text box, the workflow will throw an error'Error Occurred'.It is the same with the people picker column.
    You need to limit the peopel picker to only allow to select one user,in this way the text box will only hold one user.Then you can use the people picker or the text box to grant user permission.
    Thanks,
    Entan Ming
    Entan Ming
    TechNet Community Support

  • Tally up a column only on rows that have been checked

    Hi I'm driving myself to drink with this, and I'm sure it should be pretty easy.
    I have a subtotal column (Column D) which I calculate the total of via (SUM(D2:D20), however I have a column G, that is a "Paid" column, that has a checkbox, now what I want to do is only tally up in column D the amounts that have been ticked/checked in column G.
    I thought SUMIF would be my solution but it's not working.
    I've tried the following among other things and nothing works.
    =SUMIF(D2:D20,TRUE)
    =SUMIF(G2:G20,TRUE,D2:D20,)
    Any help would be most appreciated.

    =SUMIF(G2:G20,TRUE,D2:D20)
    works perfectly.
    In your message there was an extraneous comma but I don't know if it was available in your sheet or if it was just a typo.
    If you are running Numbers in English in a country whose decimal separator is comma, you will have to edit the formula like that:
    =SUMIF(G2:G20;TRUE;D2:D20) (semi-colon replacing comma).
    Yvan KOENIG (from FRANCE samedi 19 juillet 2008 20:47:27)

  • Where can i view the pictures that have been uploaded to my cloud?

    Where can I view the pictures that have been uploaded to my cloud? when i log onto icloud it doesnt give me the option to view photos

    How were the photos "uploaded"? If via backup or Photo Stream, they aren't viewable online. If you turned on iCloud Photo Library (beta) you should see a Photos app at iCloud.com
    More details at iCloud Photo Library beta FAQ - Apple Support

  • Is there a way to print something showing all the purchases that have been made and what the total cost is?

    Is there a way to print something showing all the purchases that have been made and what the total cost is?

    While it is not possible to directly print your iTunes account purchase history within the iTunes Store, you can take a screnshot of your purchase history on your computer, and then print that screenshot.
    The following article explains how to review your purchase history:
    http://support.apple.com/kb/HT2727
    This articles explains how to take a screenshot on Mac OS X:
    http://docs.info.apple.com/article.html?path=Mac/10.7/en/mh26782.html
    and this does on windows:
    http://windows.microsoft.com/en-CA/windows-xp/help/setup/take-a-screen-shot

  • ICloud control panel automatically unticks the boxes that have been ticked

    The iCloud control panel on my PC with Windows 7 automatically unticks (upon signing off) the boxes that have been ticked. Any fix?

    Your first question should be researched on Microsoft's support forums.  This may get you started as it discusses how to create and configure an Outlook profile: http://support.microsoft.com/kb/829918.
    On your second question, to change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iDevice, then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, and if your old ID is an earlier version of your current ID, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice on your device, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • I have converted a number of songs to mp3 format on my iMac, is there a way to view just the songs that have been converted in iTunes?

    I have converted a number of songs to mp3 format on my iMac, is there a way to view just the songs that have been converted in iTunes?

    You can view tracks in a given format by selecting to show the Kind column. If you mean you want to determine which specific MP3 tracks you have that were converted by iTunes as opposed to being imported in MP3 format, Get Info on a track and look at the "encoded with" field.
    Regards.

  • How do i delete the songs that have been downloaded onto my iphone?

    how do i delete the songs that have been downloaded onto my iphone?

    doesn't work... it still shows i hv all the songs in my iphone...
    i've deleted all the songs... emptied the Recycle Bin too...
    i used to be able to just clear all the music away and sync in a whole new set of songs..
    but i can't do it now...
    sad...
    any help available as i do not want to have to do it manually one by one unchecking the songs...

  • Delete rows that have been dropped in a CDC flow

    Post Author: sgsampey
    CA Forum: Data Integration
    A newbie question:
    I have a source table called Events with (significant) fields that look like:
    EventIDEventNameBeginDateEndDateDaysOfWeekModifyDate
    These data ranges can be quite long, and there's an exception table if the Event isn't being held on a given day
    ExceptionIDEventIDExceptionDate
    I need to flatten this data into a target Event_Instance table of individual days:
    EventInstIDMasterEventIDEventNameDateDayOfWeek
    I'm going to populate the target by combining Event source (filtered by modify date to only grab updates and additions) with a SQL table that creates a range of days, join that with the exception table, and filter based on no match in the exception table. That part's easy.
    The problem I'm having is what do do when an Exception is removed or updated (Events are never removed - just canceled). There's no ModifyDate to look at. I know I need to create a buffer table to track changes, but once I identify execptions (in a Query Transform) that have been added since the last ETL, I don't see how to remove those Event_Instances. The two only solutions I can come up with is to wipe the entire Event_Instance table and rebuild with every ETL, or to add an 'action' field to Event_Instance, updateit to 'D' for those rows that need to be removed and then execute a SQL command to delete those rows once done.. I know there must be a better, incremental way to do this. TIA!

    Your Mobileme galleries should be listed in the library pane on the left. How about creating a new album in the main library and dragging the images from a gallery to the album. Then delete the gallery and recreate it from the album.

  • Lines displayed in images that have been "sliced"

    Safari displays lines between sections of an image that have been "sliced" where a aprt of the image may be used with linking to other pages of that website or other url's. The header on the following site:
    http://www.mcruz.com/MCI-AboutUs.asp and contents pages of this site: http://www.apomessiah.com/guidepost1Summary.asp for a couple of examples.
    Is there a way to turn it off???

    This sounds as if you would try to import the images a 2nd time.
    But you say you  want to develop them.
    So make sure that your import dialog is no longer open, and that you access the images from library module, left-hand panel e.g. folders or collections.
    Then select one image and go to develop module, e.g. via pressing letter d as shortcut.
    Cornelia

  • How can we  identify the mails from the mails that have been read previousy

    Hi
    i m using java mail api to fetch the mails. but i am facing a problem that is every time i fetch all the mails in my application.
    Is there any way by which i can set a flag or something so as to i can identify the mails which have been processed earliar.
    please help me out.
    Dushyant Kumar

    POP3, right? See the JavaMail FAQ.

Maybe you are looking for

  • TEXT MESSAGE RINGTONES 3.0 UPDATE MISSING

    I'm a huge fan of apple. I'm a huge fan of their products and I convert people to their products all the time. Who here wants to see apple make one little change they should have done a while ago to the iPHONE?? This message's purpose is to create tr

  • Why do I keep getting alerts for shared calendars?

    I have a calendar set up in Calendar, it syncs with iCloud. My wife has a clanedar set up in Calendar, it syncs with iCloud. Both calendars are shared, so we can see what the others availability is on a given day at a given time. But why do I keep ge

  • Selective file transfer

    Hi, I'd like to transfer my own files, photos, music and a few applications from the family's iMac onto my new MacBook. If I transfer via Target Disk, do I have the option of grabbing only what I want, or does it bring everything from the iMac into t

  • Emails are not readable - strange text

    Hi All suddenly I can't read some of my incoming emails. The body text is in a nonsense script. If the sender has a signature, that is readable. How can I set Mail to read these? Is it RTF? HTML text? Thanks, Elliott

  • Itunes can't play the file because the original file can not be found

    There is many things wrong with that message and I don't know why. I had around 30 songs off an album on my computer I put the album on Itunes I edited them and then they played fine I put them on my ipod and then deleted them off coz i wanted to put