Is it necessary that 'we should select count(*)' before deleting the recor

hai..
i need to delete a record in my application for that i wrote a pl/sql process shown below....
DECLARE
Symbol varchar2(20);
ctn number(1);
BEGIN
Symbol := :P1_HIDDEN_FLAG;
select count(*) into ctn from emp1 where EMPNO=Symbol;
if ctn > 0 then
Delete from emp1 where EMPNO=Symbol;
End if;
End;
why we need to select count(*) from table.... if we are trying to delete a record that is not available in table... how can we handle that Exception???? Also is it necessary that 'we should select count() before deleting the record from table.....*
plz clarify me....
anoo..

Hello Anoo,
You can modify the foreign key constraint to ON DELETE CASCADE. Then the child automagically is deleted as well. Otherwise you need two (or more - depending on the number of childs ...and childs of the childs etc) statements. Remember that SQL%ROWCOUNT only returns the number of rows of the last SQL statement issued!
BTW : You are allowed to mark answers as 'Correct' or 'Helpful'.... ;-)
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/

Similar Messages

  • Can I insert pretest questions as knowledge checks between content slides and before a graded quiz without affecting the scoring of the graded quiz? Help documentation states that they should be used before a course begins.

    Can I insert pretest questions as knowledge checks between content slides and before a graded quiz without affecting the scoring of the graded quiz? Help documentation states that they should be used before a course begins.
    If I use both pretest questions and graded questions, can I also include remedial with return to quiz for both?

    Sorry, but I gave two workarounds: my preference is custom question slides, but you can also have questions slides where you do not add the score to the Total score. They will not be reported to the LMS and can act as Knowledge slides. Only some quizzing system variables can count all question slides, including the Knowledge slides, but the core variables (score, maximum score, percentage) will be correct. Here some links to my blog, that could help you:
    System variables in Captivate 8 - Captivate blog
    Intermediate Score Slides - Captivate blog
    That each SCORM module can have only one quiz is a SCORM requirement, not a a Captivate specific feature. Camtasia is bit difficult to compare, it is not a fully blown authoring tool although the best video screen capture tool around (video is non interactive by definition). I don't use Storyline, but cannot imagine that they shouldn't create SCORM-compliant files.

  • 2 Qs PRIMARY Q: Should one compact before deleting TB email or vice versa

    HELLO, MY PRIMARY QUESTION: Apparently compacting is part of deletion. But should one Compact before Deleting TB email or Vice Versa OR does it matter which comes first?
    SECONDARY NOTE & QUESTION;i have read the article on compacting but still do not know exactly what this word means- (e.g. does it means compressing & why is it absolutely necessary for deletion? In this regard the TB compacting article says in PERTINENT part; "IF the message is marked as DELETED or moved, Thunderbird SKIPS that message and moves onto the next message." The preceding quote would seem to say that compacting is not part of deletion, yet i know (or think I know) that both deleting a email and compacting it are necessary for its TOTAL DELETION in TB. Can anyone explain this seeming contradiction? ( I used to use Outlook and i do not remember the term "compacting" with that system).
    ANY ANSWER TO EITHER QUESTION WOULD BE GREATLY APPRECIATED. THANK YOU

    Deleting a message marks it for deletion and hides it. Compacting actually removes it and frees up the disk space. Delete then compact.
    Despite the poorly chosen name compacting has nothing to do with compressing files as in zipping them.

  • Today I installed serif photo plus, and got the computer completely crazy, I've uninstalled that program but I can not delete the photo plus toolbar, how I do?

    Today I installed serif photo plus, and got the computer completely crazy, I've uninstalled that program but I can not delete the photo plus toolbar, how I do?

    There may be an add-on installed for the toolbar. Go to Tools>Add-ons (or about:addons), select Extensions tab and remove the toolbar from there (if it's there)

  • My phone has the correct AppleID in the in settings section but asks me to login with one that isn't mine.  I deleted the ID from my itunes but it still won't let me login with mine. How do I get my iPhone on the same page?

    My iphone4 has the correct Apple ID in the information settings section and asks me to login to my ID most of the time but when I try to update my apps, it asks me to login with an ID that isn't mine.  I deleted the wrong ID from my itunes but it still won't let me login with my own ID to update apps.  How do I get my iphone on the same page?

    How did you obtain these apps? All apps are DRM protected & tied forever to the account used to originally obtain them. They cannot be transferred to another Apple ID(account), nor can they be updated using any Apple ID other than the one that was used to originally obtain them.

  • The album downloaded except one song. It says purchased rather than play and there is no option to try and download the one song that had an error.  I deleted the song name from our library, but it still won't let me download. Any advice?

    The album downloaded except one song. It says purchased rather than play and there is no option to try and download the one song that had an error.  I deleted the song name from our library, but it still won't let me download. Any advice?

    Hi VeryBerry1,
    Welcome to the Support Communities!
    The articles below may be able to help you with this.
    Click on the links to see more details and screenshots. 
    Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/HT2519
    You can view your iTunes Store account and request assistance by following the instructions below:
    iTunes Store & Mac App Store: Seeing your purchase history and order numbers
    http://support.apple.com/kb/ht2727
    Cheers,
    - Judy

  • Dear adobe premier guys...why still u didnt release an update that let us select rushes directly from the timline and drop them into a bin... now if we want to select rushes by select all or few rushes and we throw them into a bin all we get is the whole

    We need an update that makes us able to select specific rushes from the timeline including their in and out and put them into a bin..nkw if we do so we get the whole rush without its in and out we already did... i guess it very easy to be solved by ur support team...thank u

    We need an update that makes us able to select specific rushes from the timeline including their in and out and put them into a bin..nkw if we do so we get the whole rush without its in and out we already did... i guess it very easy to be solved by ur support team...thank u

  • After sorting photos into albums, the albums disappeared on me. I dragged and dropped the photos and went back to check that they were in place before exiting the program. When I went back, the folder was there but no albums. Help!

    Working on an IMac - with IPhoto v.9.6 
    This is my first experience with IPhoto... trying to move files from a PC over to a Mac.
    I don't have a ton of photos but I created about 6 albums - standard albums - and dragged and dropped individual photos into each of the albums. I named each of the albums as well so I would know what was in each. After i was finished, I created a folder called 2014 and moved each of the albums into that folder. Before moving ANY of the albums, I opened each of them up to make sure that all the photos I wanted in each were indeed there - and since there were some errors on my part, I deleted any duplicates first. SO, I KNOW the photos were actually in each of the albums BEFORE i moved them into the 2014 folder.
    My intention was to then delete the photo files in my document file but once I got there I thought I would go back and double check the IPhoto file just to make sure... and the pictures were NOT in the albums where I had placed them... is there a need to save this before you move on and if so, to where and how? I was under the impression that once files were moved to albums, they remain there.
    The photos are still in the photo library but unsorted now again... I cannot even open the 2014 folder at this point.
    Thanks for any help!!

    Was back on IPhoto this morning. The folder did not open at all so I deleted it. Beside Albums, nothing showed at all. It was like I had done no work at all except to import my photo folder. Nothing was in my trash bin either.
    I started again and created one album at a time. I dragged and dropped photos into the album and exited out of IPhoto, opened up other programs and then returned to IPhoto to see if the album was still there and it was this time. I created a second album and did the same thing. This time, for some reason, the albums seem to be staying in place. I am not doing anything differently than last time. After creating three albums, I created a folder called 2014 and dragged and dropped the three albums into the folder and exited IPhoto. They were still there when I returned - YEAH! It seems to be working - for now! I am keeping my fingers crossed that my photos are not going to disappear but I am not going to delete my photo folder from my files just in case!
    Thanks for the suggestions but this may just have been a funny glitch... not sure what happened. I didn't change anything or do anything differently this time except that I am doing it one album at a time and exiting the program between creating each of them and coming back to check... very strange.

  • My server keeps telling me that I have an update for 10.10.1 and that I should look for it in the app store. I do that and am not finding anything that makes the update notification go away. I have installed an update the app store says I need.

    I updated to Yosemite on my Mac mini/server. Then my server wouldn't work. I updated and bought the software needed when updating to Yosemite. The server seems to be working. Subsequently I've started getting a notification on the server icon that an update is needed. When i look for details I'm instructed to go to the app store. I've done that. In the updates category no update is found by the app store system. I then went to the purchases category and was informed I needed to install the server software I'd purchased. While I'd installed before, I did it again. I still have the 1 in a red circle covering part of the server icon. I have restarted the mac mini. I can't figure out what step I'm missing. The continued presence of the red circle suggests that the software still isn't installed. Looked into restarting the server in help but don't find clear instructions that make sense. Suggestions from someone who has a mac mini server and has worked with this topic would be greatly appreciated. General comments from anyone who has not looked at this kind of problem before might turn out to be unenlightening for this neophyte.

    I tried turning the computer off and then back on. The alerts don't show the notice to update as resolved. Hopefully this is not a problem or an indicator or another problem. Should I ignore or reload 10.10.1 from the app store to trigger a resolved check in a green circle?
    Interesting that I had to buy server software after my free Yosemite download. I would have hoped that the two pieces of software would have gone together without any complication. It is not positive to end up buying a problem. Ah well, time to move on.

  • My Ipad indicates that it should save my data over the last 2 weeks. A message tells me to connect the Ipad to wifi to enable this saving, however although I did as requested, it does not work and I cannot get rid of that message and I am blocked. Many th

    My Ipad is blocked with a message indicating that my data of the last 2 weeks were not saved, and to allow such saving I need to connect the ipad to a wifi. I did so but it does not work. What should I do? Many thanks for your help

    I unblocked my ipad thanks to the solution offered by spritof.
    Many thanks

  • I cant shut down my macprobook its showing error that safari should be close first but the safari not open

    i have tried to close my macbook pro .but when i ma going to shutdown its showing me error message by saying safari need to be close but the safari is already closed its not geeting shutdown just i can make my mac in sleep mode

    Press option+Carl+escape keys, then in the Force Quit list select Safari. Click Force Quit button, click Confirm.

  • How do I split Imovie events?  I find the option in File menu and have selected the part of the event that I want to split before, but the option to split is not bolded (allowed) in the File menu.

    I have imported video to iMovie and want to split the event.  I have selected part of the event and when I go to File> Split the event before the selected clip it is not bolded in the menu and it is not an allowed selection.  I had imported directly to an external HD so moved the event to the Mac HD and tried it again. This did not work either.  Any ideas why this option is not available to me???

    Use iMovie to move the events to your Movies folder, otherwise you're can't.

  • Should Itunes Match be deleting the music on my iphone and IPAD

    Still trying to get this figured out.  I'm almost certain that yesterday, when I first did Itunes Match, that all the music that was already on the Iphone and Ipad was not deleted (despite the warning to the contrary) when I toggled the Itunes Match switch on both. 
    I'm almost certain that yesterday, even after turning Itunes Match had been turned on, the music was not deleted and as new songs were added (ie CDs ripped)they showed up on both devices with the cloud Icon.
    That is consistent with what I read here:
    http://www.macworld.com/article/1163607/toggle_between_itunes_match_and_local_sy ncing.html
    However, today, I re-downloaded some music after getting the higher quality versions with Itunes on my Mac.  I turned Itunes Match off on both my Iphone and IPad, thinking I would do a quick manual sync to the Mac, get all the songs put on each and then turn Itunes Match back on both. 
    I did so, but when I turned Itunes Match back on each, Itunes Match deleted all of my music, replacing all songs with the cloud icon now forcing me to redownload everything.  That seems inconsistent with what happened yesterday and is also inconsistent with the article above which seems to indicate that Itunes Match should be smart enough to realize the songs it doesn't need to delete.
    Is the above article and my experience wrong?
    Thanks for the help!

    What you are experiencing is normal. As soon as you turn on iTunes Match, it should wipe out all your songs that were manually put on your device and you will have to redownload. Its idiotic to me, but that is the way it is supposed to work. People have stated they sometimes fool the process, but it is supposed to remove them all.
    Hope this helps. Down the road I wish they made it so you could do both, icloud and manual sync.

  • By default In a table Data should be Displayed.before clicking the search b

    Hi All,
    I m using adf11g.I have taken adf query with panel(thrgh Drag&drop in named Criteria).after that i have taken table(Drag Drop in a form ) from Data Control.
    So My Requirement is By default In a table Data should be Displayed.after that clicking the search button *then thrgh criteria then data should be displayed.So plz any body help me this question to the answer.I m waiting for ur reply.
    Thanks&Regards
    Anup
    Cell-9987984070
    Edited by: user13098384 on May 10, 2010 12:32 AM
    Edited by: user13098384 on May 10, 2010 12:44 AM

    Hi All,
    Same problem i m getting.By default Data is not comming bfr search button,if search button then data is comming.Plz give me reply.
    Thanks
    Anup

  • What config should be done before running the ETL of EBS R12 vison demo

    Do the ETL for financial analytics, based on the EBS R12 vison demo database.
    I checked the doument, it quite complicated. Could I skip all the configuration steps in http://download.oracle.com/docs/cd/E12127_01/doc/bia.795/e12083/toc.htm (chapter 7 and chapter 9);
    Just use the default value, is that ok?
    Thanks.

    pt1804 wrote:
    If you are performing the configuration using a vision environment, you should be able to leave most of the steps at default. Your data and everything may not make complete sense though if you don't setup everything correctly.OBIA 7.9.5 is preconfigured for the Vision demo instance. All data in Vision should load with a full ETL with the exception of BOM Explosion, which has additional steps to account for the use of global temporary tables in the applications.

Maybe you are looking for

  • Ringtones lost--not showing up at all in library. Can they be retrieved?

    After switching pc's and having numerous email problems on my iphone resulting in deleting the account a few times, all of my ringtones are now gone. The songs are still in my library, but nothing under the ringtones tab. Is there any way to get them

  • REP-0002: Unable to retrieve a string from the Report Builder message file;

    Hi, I've a custom report in which i need to display a large string, of more than 4000 characters. To cater to this requirement i've written a formula column which displays string upto 4k characters and for a string of size beyond 4k i am calling a pr

  • Scheduling agreement blocking

    Hi All, I have created a scheduling agreement with document type "LP: for on material. When created the SA is having Release ID as "B Blocked". The schduling agreement item is maintained in source list with MRP indicator "2 - relevent for MRP". Plann

  • ERROR LOADING WSDL....

    Dear All We are trying to create a scanario which involves: Webservices <--> PI <-- > WebServices On the Sender and Receiver side we are using SOAP adapter Source Sytem is WEBSERVICES and target system is EP    ( WEBSERVICES).The target system(EP) is

  • Sun Java ME 3.0 windows installer corrupted

    Hello there, I am not sure if I am posting this issue into the right forum...if not and if someone is aware of the right contact, please provide. I am quite new to the J2ME world and at this moment I am mainly concentrating on learning J2ME for mobil