Check count and then do some work

Hi,
I have a table with 10 million records. I want to check whether a value of a specific column is present or not. If the count is greather than 0, then I want to do some task and if it is 0, then I want to do some other task.
Could you please tell me what is the best way to do?
What I am doing now is: I am checking the count using count(*) and then checking the value whether that is greater than 0 or =0 and then based on the value I am doing different task.
But count(*) is slow for this big table.
So, please let me know the best possible way to do this.

declare
  value_exists number;
begin
  select count(*)
  into   value_exists
  from   my_table
  where  my_column = 'ABC' and
         rownum = 1;
  if value_exists = 1 then
  elsif value_exists = 0 then
  else raise_application_error(-20001,'Bad value for value_exists of '||coalesce(to_char(value_exists),'NULL'));
  end if;
end;

Similar Messages

  • I have windows 7 and my speakers worked then after update my speakers do not work and everything checked out and says they are working and that soundcard is working but no sound now.

    I have windows 7 and my speakers worked then after update my speakers do not work and everything checked out and says they are working and that soundcard is working but no sound now.
    I have tried everything and nothing works.

    sound problems:
    #Restore speaker icon to System Task bar, right-click on clock or tray > Properties > Volume: On
    #Click on the Sound icon in System tray then on Mixer, make sure Firefox is not muted [http://dmcritchie.mvps.org/icons/fx_sound.png picture]
    <p>Additional references
    * [https://support.mozilla.com/en-US/kb/No%20sound%20in%20Firefox No sound in Firefox | Troubleshooting | Firefox Help]
    * [http://support.mozilla.com/en-US/kb/Video%20or%20audio%20does%20not%20play Video or audio does not play | Troubleshooting | Firefox Help]
    * [http://kb.mozillazine.org/Video_or_audio_does_not_play Video or audio does not play - MozillaZine Knowledge Base]

  • Every time i connect my iphone to itunes and trying to do a backup or get the new update it says i have to restore my iphone. and then that doesnt work, i tried to reinstall itunes but it doesnt work. i get this all the time. fix it please.

    Every time i connect my iphone to itunes and trying to do a backup or get the new update it says i have to restore my iphone. and then that doesnt work, i tried to reinstall itunes but it doesnt work. i get this all the time. fix it please.

    iTunes states " There's a problem with your Iphone, please contact apple service center " Also i took my iphone to a local service man and he told me the IMEI code has been corrupted and there's nothing that can be done about it. Please help, if you have any solution.
    Thank you

  • Hey plz help me out!!  i am using macbook pro 10.5.8..... and was using photobooth...and then after some time i opened it and there was no green light on cam, and it displayed nothing! plz tell me how to fix it! i want to see my face again!!! plz help me

    hey plz help me out!!  i am using macbook pro 10.5.8..... and was using photobooth...and then after some time i opened it and there was no green light on cam, and it displayed nothing! plz tell me how to fix it! i want to see my face again!!! plz help me

    iSight troubleshooting
    http://support.apple.com/kb/HT2090

  • Hey apple users. if i deaktivate my iphone because i got a new phone, can someome else put thier sin card in my old iphone and then it will work again? or does the phone stop working all together if i deactivate the phone on the support page?

    hey apple users. if i deactivate my iphone because i got a new phone, can someome else put thier sin card in my old iphone and then it will work again? or does the phone stop working all together if i deactivate the phone on the support page?

    Do this first:
    http://support.apple.com/kb/HT5661
    Then whoever gets the phone just sets things up again using their Apple ID.

  • I'm running Lion on a Late 2008 MacBook Air.  With no other applications running, I can no longer Check for Software Updates.  It gets abut half way through the checking process and then freezes.  The MBA passes Disk Utility. Thoughts?

    I'm running Lion on a Late 2008 MacBook Air. 
    With no other applications running, I can no longer Check for Software Updates.  It gets about half way through the checking process and then freezes. 
    The MBA passes Disk Utility. Thoughts?
    Thanks
    Jim Taylor

    How long do you leave it?
    Mine can sometimes sit for quite a while (maybe 10 minutes??) before it finally finishes.
    You could look at the relevant logs via Console (Utilities folder) to see if Software Update is complaining about anything.
    charlie

  • After export movies works and then is not working anymore?!

    Hi guys,
    i am capturing HD movies to my final cut express HD..Edit them, expert as quick time movie (option self contain is OFF). Then i test the movies and they are like they should be. Then i import them into IDVD and IDVD accept some and some not. So when i check the not accepted movies they only play the sound. While 10 minutes before the movie was working correct.
    After a few times (making the same movies again and again on the same maner) IDVD accepted alle the movies. But when i wanted to burn the dvd it gives me a error about a missing movie file, again and again?
    It worked all okay when i made my other dvds.
    The only thing changed at this system is that i upgraded to Ilife'11
    What am i doing wrong?
    Thanks in advance!
    Ps. my movies are HD (1080i)

    Could it be that the link is broken after i change the movie from folder to a >other folder ?
    The FCE Project File or the export?
    Sequence>Render Only>Mixdown.
    This action makes one temp file out of all your audio. It makes a difference to exported files playing correctly in the audio department.
    Al

  • My ipod touch 5th generation keeps wifi signal for 10-30 minutes and then just stops working.

         I've had my ipod for about a month now and it worked fine up until this week.
    This week I noticed probelms with the wifi. I would be just on facebook or browsing the web and the wifi would just stop working. Every time I turned wifi off and the on again it would give me about 5-10 more minutes of wifi before I had to do it again. I've never expeiranced this with my other 4th generation or 3rd generation ipod touches. The wifi itself is not the probelm because it works just fine on my laptop. Today I updated my software and the probelm was not resolved.
         I need help sould I got to the Apple store and have them check it out?

    Does the iPod have the problem with other networks?
    Do other devices work OK?
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on the router
    - Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - iOS: Recommended settings for Wi-Fi routers and access points
    - DOes the router have the latest firmware?
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • Strang pop up message and then iPod wont work or get any other sound

    I got a new desktop and downloaded the new iTunes and then updated by iphone 3G-S and now I am getting this message popping up.
    "This accessory is not made to work with iPhone.
    Would you like to turn on Airplane mode is reduce audio interference. You will not be able to make or receive phone calls."
    I have no accessories besides apps and this occurs randomly when even nothing is running but seems worst when ipod or app is running. What is going on?

    You probably have some pocket lint or debris fouling your dock connector. Insure the dock connector is clear. http://www.apple.com/iphone/how-to/index.html#help.this-accessory-is-not-made-to -work-with-iphone-appears

  • Rules - Reference an entity member list and then exclude some entities

    I have rules written to extract data in a specific file format.
    I am using a dynamic member list and then want to exclude some of the entities from doing the extract.
    The member list is base of a parent - it has about 500 entities. I only want to exclude 5 entities. I don't want to have to create a member list of 500 entities just becasue 5 of them are not needed.
    I can't use
    POV_ENTITY <>
    OR If Not POV_ENTITY =
    becuause it is not the POV_ENTITY it is the entity in the member list.
    How can I write that?
    Before:
    For Each Entity in HS.Entity.List("",ListName)
    After: (gives me a Syntax error):
    For Each Entity in HS.Entity.List("",ListName) AND If Entity Not "TAX_ROLLUP.TAX_DOM" Then
    Thanks!
    Full section of the rules:
    If ListOfEntity Then
    'Flag accounts have a different name than the Entity list
    'We need to include the name of the entity list in the File name
    'as well as loop through it to extract those entities
    'List Name = "Tax Entity & the right portion of the flag account beginning after "Tax_"
    UndSco=Len(ListToXtract)
    NameR = Right(ListToXtract, UndSco - 4)
    ListName="Tax Entity " & NameR
    'File Name is the concatenation below
    'Admin has to change the path in the WriteToFile routine at the bottom of this file
    FName="HFM_RIA_" & ListName & "_" & pov_period & "_" & pov_year & "_" & XView & "_" & FDate & ".txt"
    'Below is the header of the file
    Call Writetofile("*************************************************",FName)
    Call Writetofile(pov_scenario & " " & pov_period & " " & pov_year & " " & XView,FName)
    Call Writetofile("*************************************************",FName)
    Call Writetofile("Entity" & "," & "Account" & "," & "ECT" & "," & "PCT" & "," & "CAD" & "," & "CZK" & "," & "EUR" & "," & "GBP" & "," & "PLN",FName)
    'We loop through all the entities of the list related to the current flag account
    For Each Entity in HS.Entity.List("",ListName) AND If Entity Not "TAX_ROLLUP.TAX_DOM" Then
    Edited by: user2609991 on Jan 20, 2010 6:23 AM

    Sorry, yes I did it now using the greather than and less than signs.
    I am able to load the rules file but it still writes the Tax_Dom info to the file.
    I think I am going to give up and just create a big member list of all the entities less those six.
    Thanks for responding.
    Edited by: user2609991 on Jan 20, 2010 11:33 AM

  • I ran the update and then firefox stopped working completely ggot a message about .dll that won't work with windows. tried toreinstall new copy of latest but they won't.

    I just ran the update to .4 as the dialog box said to. Now firefox won't work at all. Nothing happens I get a message about a .dll file that is incompatible. Tried to doanload a new copy but that doesn't get any further starting to extract files then it fails to finish. Any thing I can do or have I lost evrery thing including my bookmarked sites?
    == This happened ==
    Every time Firefox opened
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SIMBAR={7B37EC33-AF75-48D2-9930-4E9EF2ABA545}; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)

    Thank you,
    Morbus! It worked like you said. Anyway I think the problem starts with maybe needing to completely clean up my OS and drives as they keep "filling up" real fast - much faster than my usage. Uninstall wouldn't work so I just oened up programs and fond the .exe and then deleted it. Scary moment as I really have seen others so mess up everything doing this but download went well of new copy and yes I have all my bookmarks and settings. YAYS!! so thank you again. Also running so much faster and no glitches like tabs not working th way they should. In end I think I need to get an upgrade from Vista home basic. and just then add my files one at a time to see how all goes.

  • My iPad does not recognize my Apple ID. I have reset several times (as requested) it's stated that its successful, and then does not work..I cannot access anything!!!!

    My iPad does not recognize my Apple ID. I have completed a reset several times (as requested).
    The re-set is shown as successful but then doesn't work..I'm locked out of everything!!!

    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.  When you do this you may find that the password for your old ID isn't accepted.  If this should happen, and if your old ID is an earlier version of your current ID, you need to temporarily recreate your old ID by going 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.

  • Yahoo Mail: on Mac Pro (keeps asking for my password and then doesn't work)

    I have used Yahoo Mail through my Mac Pro Mail Account for years and enjoyed fine service.
    For the last few months, the Mac Mail says I have the wrong password, and it won't allow me to access
    mail.
    If I change the password, it will work for a while (days) and the cycle starts all over again.
    Sometimes, I stop using Mac Mail and use Yahoo off the web, and then suddenly Mac Mail will start working
    on its own again.
    I read a thread for earlier in the year and tried every single thing suggested - this still happens
    I have used Yahoo mail for 22 years - but maybe it is time to switch?
    Gmail never has this problem...but I use the Yahoo mail for my business, my friends, and groups.
    Anyone with a working solution?
    PS: My Yahoo email ALWAYS 100% of the time works on my iphone, and ipad...this only happens on my Mac Pro.

    You don't have a Mac Pro (*65lb tower) but a notebook.
    There is a support page and setup wizard to help plus links to support articles and community.
    you may have to rebuild mail index or see if you can export, (re)move the existing mail folder and setup a new one and import old mail. Mail does and can have its issues for sure.
    Mail support and Setup Wizard
    http://www.apple.com/support/mail
    MacBook Series Forums
    https://discussions.apple.com/community/notebooks?view=discussions
    Mac OS X Forum
    https://discussions.apple.com/community/mac_os?view=discussions 
    http://www.apple.com/support/macbookpro

  • I have windows 7 (PC) and am doing some work for school. I need to transfer my work to a MAC computer, how do I do this?

    I have windows7 (PC) an am doing some work for a school project. I need to be able to transfer my work to a MAC at school. How can I make sure it will work on the MAC?

    If they are Photoshop files, just place them on a FAT or FAT32 formatted Flash drive. Both the Mac and PC can recognize the drive.
    Make sure your files have an extension .jpg/.png/.psd and so on.
    Photoshop Mac or PC can open the files.
    Gene

  • Can i move my songs onto memory stick and then back after work on computer is finished

    can i move itunes library onto a memory stick while work is being done on computer and then return them after, thanks

    Sure... you can backup your data to a memory stick, a USB drive, a NAS, or any other backup source you like.
    But do not simply move the songs, grab the ENTIRE iTunes folder so that the iTunesLibrary.itl file is captured as well.  Without that file, you essentially start over with playlist, playcounts, and library layout.

Maybe you are looking for

  • [Sound Blaster ZX]Control Panel takes 6 MINUTES to load and is nearly unusable?!

    All, Yesterday I took the plunge and picked up a Sound Blaster ZX to replace my old Audigy Platinum. Unfortunately I've been met with a series of problems that leave me with a bad taste in my mouth about my purchase. The driver install seemed to go w

  • What is the Significance of No. of Openings in iRecruitment ?

    Hi, Number of openings is mandatory field in iRecruitment. I would like to know what is its significance of this field other than data recording ? Using this can we restrict to the number of offers we can make at a time ? or restrict the number of ap

  • Post Transfer to ASP

    Hi, I am having trouble sending a username field to a url using post. My code is listed below: HttpConnection http = null;         OutputStream oStrm = null;         InputStream i = null;         boolean ret = false;         // Data is passed as a se

  • ERROR: jbd can only store block numbers in 32 bits.

    I am running Oracle VM Server 2.2.1. When trying to format the following partition, an error is raised. [root@vmserver08 ~]# cat /proc/partitions major minor #blocks name 8 0 143247360 sda 8 1 104391 sda1 8 2 10482412 sda2 8 3 2096482 sda3 8 4 1 sda4

  • Where do my TextEdit files go in the cloud ?

    I have 2 iCloud accounts and I am lost in the clouds ..... One iCloud account (at mac.com) has a unique password.  My other iCloud account uses my email address and a different password ..... The problems started with an iTunes account -- and then so