Better and faster alternative for count(*)

I want to check whether empno=1234 exists in emp table
Currently I am using in proc
      select count(*) into cnt from emp
                     where empno=1234
    if cnt>1 then exists otherwise no exists.
    Is there any better way to do the same.?

user11253970 wrote:
I want to check whether empno=1234 exists in emp table
Is there any better way to do the same.?http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1525380674899
select count(*)
  from dual
where exists ( select NULL
                  from emp
                 where sal = 5000 );Faster still is to not count at all
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1525380674899#34907832120350
Just process the data and take appropriate action if nothing was processed.

Similar Messages

  • Updating 3GS from 3.1.2 to 6.1.3 taking way too long. Is there a better and faster way?

    How long does it take to update an original 3GS to 6.1.3? I followed the iTune instructions and it has been updating for hours already. Is there a better and faster way to do this?

    SO if I want to represent the London Underground
    network as a Graph how would I be able to do it?By writing classes of your own or using some one else's. I don't think that the collections framework has out-of-the-box support for graphs.... So try google first.
    The implementation details depend on the API you are going to use, of course...
    from A to B 5 min
    from B to C 4 min
    from A to C 9 min
    this information is redundant, the third info should be omitted. <nit-picking>
    No it's not - What if there's a special, more direct route from A to C? Also, getting from A to B to C will usually take more time than the time from A to B plus the time from B to C. The trains have to stop at B, don't they?
    </nit-picking>
    Maybe this approach is more complex, but it solves the problem Have I understood correctly - isn't what you describe just another way to implement a graph?

  • Is there any better and faster way to copy...

    can anyone teel me any better and faster way to copy...
    InputStream in = null;
              OutputStream out = null;
              try {
                   in = new FileInputStream(src);
                   out = new FileOutputStream(dest);
                   byte[] buf = new byte[1024];
                   int len;
                   while ((len = in.read(buf)) > 0) {
                        out.write(buf, 0, len);
              }catch(Exception e){
    }

    Here's a small program as a sample and for testing. Just ran a few tests with a file of 1.5 MB (buffered slightly faster) and a file of 45 MB (NIO much faster) ...
    import java.io.*;
    import java.nio.channels.*;
    public class Copy {
         public static void main(String[] args) {
              if (args.length == 3) {
                   File from = new File(args[1]);
                   File to = new File(args[2]);
                   if (from.exists()) {
                        long start = System.currentTimeMillis();
                        try {
                             if (args[0].equals("nio")) {
                                  copyNIO(from,to);
                             else {
                                  copyBuffered(from,to);
                        catch (Exception ex) {
                             ex.printStackTrace();
                        System.out.println("Time: " + (System.currentTimeMillis() - start) + " ms");
         private static void copyBuffered(File from,File to) throws IOException {
              FileInputStream fis = null;
              FileOutputStream fos = null;
              try {
                   fis = new FileInputStream(from);
                   fos = new FileOutputStream(to);
                   BufferedInputStream in = new BufferedInputStream(fis);
                   BufferedOutputStream out = new BufferedOutputStream(fos);
                   byte[] buf = new byte[8192];
                   int r = 0;
                   while ((r = in.read(buf)) > 0) {
                        out.write(buf,0,r);
              finally {
                   if (fis != null) {
                        try {
                             fis.close();
                        catch (Exception ex) {}
                   if (fos != null) {
                        try {
                             fos.close();
                        catch (Exception ex) {}
         private static void copyNIO(File from,File to) throws IOException {
                   FileInputStream fis = null;
                   FileOutputStream fos = null;
                   try {
                        fis = new FileInputStream(from);
                        fos = new FileOutputStream(to);
                        FileChannel chin = fis.getChannel();
                        FileChannel chout = fos.getChannel();
                        long size = from.length();
                        long total = 0;
                        while (total < size) {
                             total += chin.transferTo(0,size,chout);
                   finally {
                        if (fis != null) {
                             try {
                                  fis.close();
                             catch (Exception ex) {}
                        if (fos != null) {
                             try {
                                  fos.close();
                             catch (Exception ex) {}
    }

  • Which is better and faster in bootcamp xp or vista or 7

    i have installed windows 7 by boot camp i have noticed its boot is very slow
    i m thinking to remove it and try xp
    anyway my question is which is better and faster xp or vista or 7? in bootcamp in the boot and in the normal use applications inside windows?

    sorry i meant i have istalled windows vista by bootcamp now i want to remove it i m asking which is faster and better xp or vista or 7 ?

  • Easy and fast building for multiple sites

    Hi all, my first post. So, I've got a lot of sites but right
    now I am working on about four main ones - all commercial. In the
    past I had a webmaster but for the short-term and until my company
    is stronger financially I'm taking on the building again myself. My
    question is, in the past I'd used HTML, then looked at some CSS
    combo, and then finally my webmaster hand coded my main site to
    work with PHP/MySQL. So, as I begin to build my new sites, which
    don't need to be super complex, what are the easiest and fastest
    tools for me to use and have the least amount of grief. Should I
    even bother with CSS? Can I just use a php page and use tables?
    Should I delve into Flash, since many of my sites are media
    oriented? Clean, quick, easy and functional are what I need. Thanks
    in advance!

    .oO(2manyirons)
    >[...] My question is, in the past I'd used HTML, then
    looked
    >at some CSS combo, and then finally my webmaster hand
    coded my main site to
    >work with PHP/MySQL. So, as I begin to build my new
    sites, which don't need to
    >be super complex, what are the easiest and fastest tools
    for me to use and have
    >the least amount of grief. Should I even bother with CSS?
    Of course you should. Reasonable and properly structured HTML
    4 Strict
    in conjunction with CSS for the presentation should be the
    way to go.
    >Can I just use a php
    >page and use tables?
    Whatever you like (or need).
    >Should I delve into Flash, since many of my sites are
    >media oriented?
    No, because ...
    >Clean, quick, easy and functional are what I need.
    ... Flash is neither of them. In fact it will cause a lot of
    problems if
    it's used improperly, for example for building the entire
    site. In some
    rare cases it has its uses and can be a valuable add-on, but
    usually
    it's just annoying and a usability problem. Things like
    Flash, JS etc.
    should be used wisely and carefully, especially on commercial
    sites.
    Micha

  • Need to know which is better and faster for laptop memory upgrade

    What is the difference and which is better for a laptop memory upgrade:  SDRAM, DDR SDRAM, SIMM?  One site suggested DDR SDRAM and BB suggested SO DIMM

    SODIMM is the physical form factor of the module, DDR SDRAM is the actual memory type.
    SIMMs are an ANCIENT form of memory module.  If you have a system that uses SIMMS, you will spend less money throwing your computer in the trash and buying a new one.
    Non-DDR SDRAM is also ancient.
    Each system can only use one type of memory, i.e. you can't use DDR memory in a system that only used non-DDR memory, and you can't use DDR2 memory in a DDR system.
    To find out if the configuration is 2x256 or 1x512, you'll need to look at what is installed.
    *disclaimer* I am not now, nor have I ever been, an employee of Best Buy, Geek Squad, nor of any of their affiliate, parent, or subsidiary companies.

  • Powerpoint and word alternatives for mac

    Hi
    I am poised to buy the MS office suite for Mac.
    I use MS word and powerpoint on a daily basis.
    I have tried open office but found it unreliable when opening documents on a pc (format chenges etc).
    Is there any reliable alternative to the MS office?
    I have read reports of MS office for mac being unstable but I have also read lots of reports contradicting this.
    Many thanks
    Paul

    Office for Mac is very stable so your information is unreliable. However there are a number of alteratives, including Apple's iWorks suite of Numbers, Pages and Keynote and for web based alternatives a lot like LibreOffice which you can find by Googling it.

  • What is the better and faster way to get the results

    I'm looking for suggestion for my application.
    I need to write an application where in certain section I need to do some checking for the SSN, I need to find if the SSN in table A is a duplicate in Table B.
    Table B consist of more than 1 million SSN and table A may have a couple of thousands SSNs.
    The SSN in table B consist of good and invalid SSN,such as, SSN with 000 on the first 3 digits or 00 on the second 2 digits or 0000 the the 4 last digits or even all 9 digits consist of 000 00 0000
    If I do the regular select SSN from table B where SSN = 'SSN_from_table_A" for 3 to 5 thousands records in a cf loop than it may takes awhile before I can see the result.
    Is there a better way to do this?

    alecken,
    Can you explain some more about the workflow of your application.  I'm not clear so to what is being returned to the client and what tasks are handled on the CF server, on the database server, and on the client's browser. Are you trying to return thousands or records to the client or having problems looping through thousands of records on the server.  Is the client providing a single SSN to check or are you comparing all values in TableA to TableB?   If possible could you post your CF and SQL code?

  • Within reason it would be better and more secure for user to have more latitude in Id and password security. We can make a tool so difficult that it loses its usefulness. the need to write down scores of passwords to make a control freak happy stinks

    The balance between security and ease of use is way out of control with Apple. Where does Security end and Controlfreak begin I have a very secure password that I use on many really high security programs and applications where peoples lives, safety and finances are at risk. There has never ever been a problem because I have chosen the usernames and passords  carefully, I use them all the time so I don't forget them. If I wrote different ones down so that I could access them from different locations that would be a huge violation of security.
    This policy is so extreme that it makes the tools that Apple makes available. I have used Apple as my music management system for years. This has become so impossible that I am going to have to convert to another system. This will cause me time and work. This is quite un-necessary. Control freaks are hard to deal with.I give up, I'm going to go away.

    I have no idea what your issue is, but if you want to comment to Apple, use their feedback page:
    http://www.apple.com/feedback/itunesapp.html
    Posting complaints here, and in particular threats to go to other products, where only we your fellow users will be likely to see them do no one any good. None of us here will really care if you decide that iTunes doesn't work for you and you have chosen to shift to some other product. That's you perogative as a consumer.
    Regards.

  • What is better and fast to use between decode and case

    Hi friends,
    i wanted to know what is better to use decode or case in sql,which gives faster result.
    thks
    sonal....

    Here's a very simple timing comparison. This table (actually it's a partition) has a little over 1 million rows.
    As you can see, the timing difference is trivial. (I ran an earlier query to fetch the blocks from disk).
    SQL> select sum(decode(balloon_flag
      2                   ,'Y',1
      3                   ,0
      4                   )
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.65
    SQL> select sum(case balloon_flag
      2                  when 'Y' then 1
      3                  else  0
      4             end
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.68
    SQL> select sum(case
      2                  when balloon_flag = 'Y' then 1
      3                  else  0
      4             end
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.46

  • Bug Search Tool is out of Beta and Fully Available for your use

    We are excited to announce the release of Bug Search Tool (BST), the online successor to Bug Toolkit, designed to improve our customers’ effectiveness in network risk management and device troubleshooting.
    Bug Search Tool allows partners and customers to search for software bugs based on product, release and keyword– and aggregates key data such as bug details, product, and version. Bug Search Tool reduces the time taken for product/release searches from minutes to seconds over its predecessor Bug Toolkit. The service also has provision to filter bugs based on credentials to provide external and internal bug views for the search input.
    Top New Features
    Enables input of  
    Keywords and problem description
    Product Identification (PID)
    Metadata Framework (MDF) Product Category, Series, Model, Software version and/or version type
    Retrieves customer and partner-relevant bug information with a single Bug ID as input
    Returns relevant bug summary information with a list of up to 10 Bug IDs as input
    Provides access to view the quality ratings provided by customers for the bugs and also add new reviews.
    Available Now
    This service was developed and refined in close consultation with customers and partners through advisory boards, online forums and other direct communications. 
    “I just wanted to compliment you on the new Bug Search Tool. It is fantastic. very quick, easy to use and has a well laid out GUI. Thanks for the great work!”
    Cisco Customer
    Please check out Bug Search Tool on Cisco.com or take the self-guided BST interactive tour and to learn more contact us.
    Bug Search team (Christine Woods, Deepika Vijayakumar, Sam Guemple)

    Hi Sam,
    First off, I wanted to say THANKS to the whole Bug Search team for their
    continued hard work in making BST a great online tool!!
    I wanted to add a couple of further observations on BST in addition to my
    buddy Paolo's initial comments (+5 "P")
    - Version choices in Communications Manager and Unity Connection are not honored.
    For example, if I go through Voice & Unified> IP Telephony> Unified Communications
    Platform> Communications manager> Cisco Unified Communications Manager Version 9.1
    There will be 44,535 results (????) then I have to input 9.1 again in the "Releases" box and
    I then receive the correct 754 results. So BST is not honoring the original choice of
    Cisco Unified Communications Manager Version 9.1. This is the same for all versions as well
    as Unity Connection choices.
    - IP phone 8900 series bugs are actually all listed under the 6900 series (????). If you
    don't know this trick you can never find any bugs related to the 8900 series. These are two distinct
    product lines and the bugs should be sorted accordingly.
    Cheers!
    Rob
    "Your life is worth much more than gold." 
    - Bob Marley

  • Alternative for select count('x') or count(*)

    Hi Gurus,
    I need to use select count(*) multiple times in a SP before and after deletion of rows from multiple tables. As this is an expensive method, do we have some alternative for Count(*), like selecting something from a system table or view instead?

    Hi
    You can know the number of rows affected by the DELETE statement in PL/SQL (if you are using PL/SQL) using sql%rowcount. So you don't really need to count the rows again after the delete took place...
    If you are deleting the same rows as selected by the second count condition (older than a particular date), in fact you only need to count rows once for each table.
    Luis

  • Why is there no updates to the firefox throttle add-ons ? Is there an alternative? throttle is Bandwidth utilization throttling and monitoring extension for Firefox

    Why is there no updates to the firefox throttle add-ons ? Is there an alternative? throttle is Bandwidth utilization throttling and monitoring extension for Firefox

    Well, it's probably one of two things: either the awesome dude(tte) who developed this awesome extension was tired of updating or the changes in FFox software architecture carried out between version 3.x and 4+ created challenges that were too difficult for him to surmount or a combination of both. Honestly, I love Mozilla but I think they dropped the ball on the throttle issue. It's such an obvious and necessary function and it's so easy to implement. They should have included it a long time ago as in built feature. And, if you are browsing and looking at this post and you agree. Add a suggestion in mozilla.org. The more of us asking for this function, the better.
    Meanwhile, I have the following solution for you:
    Solution 0.6.9.23.11 (DIY Version of my Solution ):
    Setting Up a Separate Portable Firefox 3.6.x that runs independently of and simultaneously to your latest version of Firefox
    Get FireFox Portable 3.6.24:
    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36
    It's a portable app, meaning that it's got all it's profiles and preference and application files in the same directory. It won't compete with your current installation of Firefox, has it's own separate extension folder etc...
    Get Firefox Throttle 1.1.6
    http://firefox-throttle.en.softonic.com/ (I couldn't find it in the official mozilla site)
    It will be flagged as incompatible with even that old version of firefox (but it isn't). You just need to turn off compatibility checking. You can do that with this extension:
    https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/?src=search
    If you have Bookmarks you want to port to the portable (bad pun intend), backup them up to bookmarks.json file on your desktop and import them to the portable version. You can export/import more stuff using FEBE addon but that's a whole world of headaches if you don't your doing.
    Many of your extensions favourites extensions will no longer work on FFox 3.6.x but if, in that same addon's page, you look around until you find a link to previous versions of the addon, you will notice that the compatibility info is right below the version numbers. Just download and install the latest version that is compatible with you 3.6.x....
    Voila mon ami! Your FFox 3.6 portable has just become your own private Download Mule whom you can throttle to your hearts content (ever throttle a real Mule??? I wouldn't try it, personally...) Do your regular browsing in another (unthrottled) browser and do your big downloads in the Mule...
    If you want to keep using your brand spanking new Firefox for other types of browsing while using this portable Mule edition for the downloads, just add -p -no-remote to the shortcut leading to your Firefox Portable Mule edition.
    For example, my taskbar shortcut to my Firefox Portable is:
    ""C:\Program Files (x86)\FirefoxPortableLegacy36\FirefoxPortable.exe"
    I just changed it to:
    "C:\Program Files (x86)\FirefoxPortableLegacy36\FirefoxPortable.exe" -p -no-remote
    This will make it occupy it's own independent instance and I can use the both my Firefox Nightly and the Firefox Portable editions at the same time (each one, using a different profile ie. extensions, cookies, password, cache etc).
    If you're on Linux, you can just run this on Wine and set the Windows Version to Windows 2000 in the Wine config,
    If you want to get rid of the Portable Apps splash screen, click here:
    http://www.ghacks.net/2011/06/06/getting-rid-of-portableapps-splash-screens/
    Solution 0.6.9.23.11 (Non-DIY Version of my Solution):
    Download my preconfigured but SWAGGED-THE-HECK-UP PortableFirefox 3.6
    Having realized that some of you may find the above to be daunting. I took my own customize firefox portable, took out all my data and compressed the folder (it's portable, so it'll run as soon as you unzip it).
    Here is a screenshot:
    http://www.mediafire.com/?o95nkwo8y6q535j
    Here is the download link:
    http://www.mediafire.com/?xdw87ivf3184u2s
    Don't forget to modify your Start/Taskbar shortcuts:
    "C:\wherever you decide to put it\FirefoxPortableLegacy36-Swagged-UP!\FirefoxPortable.exe"
    I just changed it to:
    "C:\wherever you decide to put it\FirefoxPortableLegacy36-Swagged-UP!\FirefoxPortable.exe" -p -no-remote

  • Faster alternative to cfcontent for large file downloads?

    I am using cfcontent to securely download files so the user
    can not see the path the file is stored in. With small files this
    is fine, but with large 100mb+ files, it is much, much slower than
    a straight html anchor tag. Does anyone have a fast alternative to
    using cfheader/cfcontent for large files?
    Thanks

    You should be able to use Java to handle this, either through
    a custom tag or you might be able to call the Java classes directly
    in Coldfusion. I don't know much about Java, but I found this
    example on the Web and got it to work for uploading files. Here's
    an example of the code. Hope it gives you some direction:

  • Forgot icloud password, how to get it recover without any question and also alternative email becuase someone hacked my alternative email id. need password for using icloud hopefully i will get result from you as your earliest.

    forgot icloud password, how to get it recover without any question and also alternative email because someone hacked my alternative email id. need password for using icloud hopefully i will get result from you as your earliest.

    I'm sorry, but I know nothing about iCloud email. I stayed away from iCloud email and only use iCloud for limited purposes.
    But take a look at this discussion and read the response from randers4. He is one of the iCloud experts in the Apple Support Communities.
    https://discussions.apple.com/message/24358339#24358339
    If that doesn't help, you might be better off posting in here where there are other more knowledgable iCloud users.
    https://discussions.apple.com/community/icloud/icloud_on_my_ios_device

Maybe you are looking for

  • Items are not visible in multi-select listbox in a static form

    Hi, I'm using adobe livecycle designer 8.0. I have a multi-select listbox, the items are hardcoded into the form. In runtime, some of the items are selected from the server side when the PDF is generated. If only one item is selected then there is no

  • Os x 10.8.3 slow shutdown

    Since Mountain Lion my iMac shutdown (and startup) very slow. I already read that a lot of users have the samen problem. But I cannot find the solution of this problem. Also 10.8.3 don't solve this problem. Somebody can help?

  • PLEASE   CAN SOMEOME HELP ME INSTALL THIS PROGRAM????

    PLease  can someone help me install this program??  I am not computer literate.

  • How to check the size of an info cube?

    Dear all Is there any t-code which can be used to see the total disk space occupied by a specific cube? I know ST14 can be used for the TOP 30 cubes and stuff. but my cube is not in top 30.....so how should i see the total size of my cube in bytes? p

  • Using Java for scripting in games - which technology to use?

    Hi, I'm currently in the process of implementing a java scripting implementation for a 3D game engine. Any suggestions on which java technology to use? It will handle high level game specific logic and a gui. So there will be a native implementation