How does decode and case works?

Hi,
I want to know how decode and case works? How they process the arguements. Please explain me with some examples.
Thanks,
Sarav
Edited by: 943941 on Jul 3, 2012 1:42 AM

welcome
check this link
https://forums.oracle.com/forums/ann.jspa?annID=1535
you will find everything you need
DECODE compares expr to each search value one by one. If expr is equal to a search, then Oracle Database returns the corresponding result. If no match is found, then Oracle returns default. If default is omitted, then Oracle returns null.
This example decodes the value warehouse_id. If warehouse_id is 1, then the function returns 'Southlake'; if warehouse_id is 2, then it returns 'San Francisco'; and so forth. If warehouse_id is not 1, 2, 3, or 4, then the function returns 'Non domestic'.
SELECT product_id,
       DECODE (warehouse_id, 1, 'Southlake',
                             2, 'San Francisco',
                             3, 'New Jersey',
                             4, 'Seattle',
                                'Non domestic')
       "Location of inventory" FROM inventories
       WHERE product_id < 1775;Edited by: user 007 on Jul 3, 2012 2:40 PM

Similar Messages

  • How does mix and match works in ECC6.0?

    How does mix and match works in ECC 6.0?
    Can some shared on this topic?
    Thanks in advance

    It;s a term used in Retail for combination of sales item eg buy 3 get 1 any other  @ xx price.

  • How does QoS and Queueing work?

    Hello,
    I am new to QoS/Networking and I have a few questions so I hope you can help me.
    1. ToS is older than DiffServ so how does the router know that the bits are set by DiffServ and not ToS?
    2. Why should I use L3 prioritization instead of L2? If I have Switches on the way from the frame I have to use L2 priorization right?
    3. Do I need L2 and L3 priorization if I use Router and Switches or is the Router able to interpret  the 802.1p CoS Tags, too?
    4. I don't understand the way how Cisco Switches are queueing traffic. I read about some specification like "1P4Q4T". I know it's about priority- and standart queues and bandwith thresholds but how does they work?
    4.1 How do you define the bandwith thresholds? What does 4 thresholds mean?
    4.2 How are the Queues used if I don't use QoS?
    4.3 How are the queues used if I prioritize 1 VLAN?
    I watched a few tutorials and read a lot in the world wide web but I haven't found the answers, yet. I hope you can help me.
    Best Regards,
    Veit

    Did nobody have an answer for those questions?

  • How does "SoftReference" and "WeakReference" work?

    Hello, everybody!
    I want to design a cache with "SoftReference"
    the cache is just like:
    int length = 1024;
    Object[] cacheObjects = new Object[length+1];
    cacheObjects[value.hashCode() & length] = new SoftReference(value);I hope the "value" and soft reference are cleared by gc at some time before throwing "OutOfMemoryError" if there is no directly reference to the "value" object.
    So I wrote a simple test:
    private static void softCache() {
            int i = 400000;
            List<String> list = new ArrayList<String>(i + 1);
            String a = "...."; // a huge string;
            while (i-- > 0) {
                list.add(a + i);
            Reference<Object> ref = new SoftReference<Object>(110);
            try {
                long[] b = new long[20000000];
                System.out.println(b[0]);
            } catch (Exception e) {
            } finally {
                System.out.println(ref.get());
            System.out.println("OK");
        }The test result is:
    the ref and the 110 object are not cleared before throw "OutOfMemoryError".
    Why?

    Well, for a start the result of boxing 110 is a
    reference to a static Integer object - Integer has
    predefined instances for numbers up to 128, I
    believe. So there's a strong reference to it, and it
    can't be cleared. The ref variable won't be cleared,
    because it's a strong reference to a WeekReference
    object.Yes, you are right. If I change 110 to 1000. it was cleared.
    Thanks.
    Your has table stuff is wrong (you need to use %
    length not & length, and allow for synonyms, i.e.
    different objects with the same hashCode), might as
    well stick to HashMap. You need a seperate key anyway
    to find the appropriate object in a cache.why '% length', not '& length'?
    It 's allowed to cover by the object with same hashCode.
    here the cache is for huge number object(may more than 10,000, 000).
    It's more important to save space and improve speed if match probability > 90%. not nedd to find the appropriate object for each key.
    You should also use a cleanup thread. Create a
    reference queue and attach the SoftReferences to it,
    then a cleanup thread deletes the entries from the
    hashtable when their references are cleared. The
    requires extending the SoftReference class to add the
    key information needed to find and clear the hash
    table entry.yes. thank your advice.

  • How does tRFC and JCO3 work?

    Hello.
    I'm building an application that based on JCo 3 and iDoc libraries 3 will be used to execute BAPIs remotely and also send iDocs.
    I'm wondering if it will be a valid scenario to use the same TID in to make multiple calls and if this whole set of calls will be consider to be part of the same transaction. For example:
    JCoFunction function1 = ...;
    JCoFunction function2 = ...;
    IDocDocument idoc1 = ...;
    try {
       String tid = destination.createTID();
       function1.execute(destination, tid);
       JCoIDoc.send(idoc1, ..., destination, tid);
       function2.execute(destination, tid);
       destination.confirmTID(tid);
    } catch(Exception ex) {
    Is this something that makes sense? Or should createTID and confirmTID be called for each execute/send? If this is valid, what will happen if executing function2 fails? Is there any way to notify that the tid was not finished or is not valid?
    Thank you very much.

    Did nobody have an answer for those questions?

  • App Store - How does licensing and transferring work?

    I've just purchased and downloaded Aperture from the Mac App Store and it appears to have installed correctly but I have no notification of a licence number, no dmg file and no information about whether I can load it on other computers that I own. Is this a one computer licence or what? and what happens if I lose the program or have a disk crash or change to another machine?

    There is no license as the apps are already pre-registered for ownership via the MAS. There is no disc image. The applications are simply fully installed on your computer as if you installed from a disc image.
    If you select MAS Help from its Help menu, open the section "Purchase applications" then select "Use applications on multiple Macs." The information should answer the question.

  • How does failover and load distribution work in Operations Manager resource pools?

    Hello everyone,
    I have a couple of questions in regard to failover and load distribution in resource pools.
    What is the criteria for an x-plat or network device to initiate a failover?
    How is load distributed in a resource pool - Is it round-robin, performance based or something completely different?
    In case more than two management servers are in the same pool, and a management server becomes unavailable, how is load distributed among the remaining resource pool members?
    Any help is appreciated.
    Thx,
    Claus

    Hi,
    Resource Pools are a collection of Health Services working together to manage instances assigned to the pool. 
    Workflows targeted to the instances are loaded by the Health Service in the Resource Pool that ends up managing that instance. 
    If one of the Health Services in the Resource pool were to fail, the other Health Services in the pool will pick up the work that the failed member was running. 
    And I would like to share this article with you. Hope it helps.
    http://www.systemcentercentral.com/how-does-the-failover-process-work-in-opsmgr-2012-scom-sysctr/
    Niki Han
    TechNet Community Support

  • Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own? If each has their own does each id have to buy their own music and apps? How does find my iphone work with one apple id or two? also I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?

    Is it possible to have your whole family on one apple id or is it better to have each person have there own?
    Yes, it is possible. 1 apple ID can be associated with up to 10 devices.
    If each has their own does each id have to buy their own music and apps?
    Yes, all purchases are non-transferable.
    How does find my iphone work with one apple id or two?
    Every device associated with one apple ID through Find my iPhone is tied to that Apple ID; Find my iPhone will work in the same way with up to ten devices associated with one apple ID. You cannot enable Find my iPhone for one device across two apple IDs
    I am going to be going off to college soon should I make an itunes id for my self and how will I get all the music from the old id?
    If you have authorized a computer with the old apple ID, you can transfer old media purchased through the old to other devices via iTunes. This doesn't mean the media purchases through the old apple ID it transferred to the new account. If you plan to make future purchases and don't wish to share them with others, make your own apple ID.

  • I always have trouble with my mailbox. It is always asking for my passwords but everything has been verified. How can I get it to stop doing it and start working????

    I always have trouble with my mailbox. It is always asking for my passwords but everything has been verified. How can I get it to stop doing it and start working????

    There is only one thing that happens -- the Server does not respond.
    Your mac concludes that you must have entered the wrong password. That may happen once, but then other issues become more likely, and it keeps asking for a new password.
    Sometimes the Server is down for maintenance. Sometimes something is configured wrong. Some services do this on purpose to get you to use WebMail (pick up your Mail with your Browser) so they can show you some ads.

  • How does Jason's multipartrequest works in the case of space in the filenam

    How does Jason's multipartrequest works in the case of space in the filename or the directory where the file resides?

    Good question...

  • How does the event structure work & ...

    How does the event structure work & and how to modify the case example if you want to change the name of the case? I haven't a look at the manual but nothing about event structure is mentioned.

    I know how it works.. =P

  • How does business catalyst really work?

    So i've tried to reach this and cant seem to find answers in plain english.... How does Business Catalyst really work?.. functionally.
    1) I have a hosting service with godaddy and jumpline, I have a lot of space and do all of my client's websites through the space I have with those two plans, do they offer the business catalyst format? Just buy that platform with them or have it added?
    2) I have CC, business catalyst "comes with" it.... how does that work? Am I given space on someone elses server somewhere or do I just have the ability to upload the BC software onto a server I have... in which case could it be uploaded to godaddy or jumpline?
    3) The new MUSE features can only be done with business catalyst right?

    Hi,
    Business Catalyst is a web hosting platform that lets web designers host, build, and sell websites to clients. You use Muse to create and update a website. You use Business Catalyst to host it. A Muse subscription includes free hosting on Business Catalyst for one site. A Creative Cloud membership includes free hosting for five sites.
    Regarding your Creative Cloud Subscription, with BC. You must install and use Muse/Dreamweaver to publish your free sites. For More details, Please refer to the article below
    http://helpx.adobe.com/business-catalyst/using/business-catalyst-muse-users.html
    The new Muse feature, like in Browser editing is compatible only with Business Catalyst, but the other feature like Parallex Scrolling works on all the other hosting as well, like Godaddy.
    If you still have any query, please let us know and we will try to resolve it.
    Thanks.

  • How does "notify me" actually work in mail app

    Might be a daft question, but how does "notify me" actually work in iPhone email app?
    I get the principal but surely when you get a reply thats already noticed you?
    Could someone advise me how it actually notifies and is it in addition to receiving the reply to the mail?

    I have the columns in place. But I have a few questions -
    1. Iis there some kind of audit trail report on the updates to my record to the table? If so how do I get to see?
    2. Am I expected to create a <entity name>_HISTORY table for this to work? I see some such recommendation  here .

  • How does the Passbook application work? How am I able to import my plane ticket, concert ticket etc into Passbook?

    How does the Passbook application work? How am I able to import my plane ticket, concert ticket etc into Passbook?

    Try the following to fix the iTunes Can't Connect issue that you are having:
    Open Settings.
    Open General.
    Open Date & Time.
    Switch the Set Automatically setting to Off.
    Open Set Date & Time.
    Set the date to a year ahead.
    Go back to the Home screen and open Passbook.
    Tap the App Store button. The App Store should load.
    Go back to Date & Time and turn on Set Automatically.
    Thanks to: https://discussions.apple.com/message/19622208#19622208

  • HT4914 How does the payment method work for iTunes Match?

    How does the payment method work with iTunes Match. For example, if you have a gift card, does it take it out of that. Or is there tax? What if you cancel your subscription in the middle of the year, does it take the money for that year or not? If someone could answer those questions it would be greatly apreciated. And if anyone has their own questions, feel free to ask. Thank you.

    Hi HLFrank,
    Welcome to Adobe Forum,
    You can opt for monthly payment in a yearly contract or pay at one go for an year.
    Please check the option at http://www.adobe.com/in/products/creativecloud/buying-guide.html
    Regards,
    Rajshree

Maybe you are looking for

  • RUN_REPORT_OBJECT returns server_name_0 (zero job id)

    When run_report_object is called, it returns the server name with an '_0' (underscore zero) appended to the end. Example: my_server_name_0 I presume that's where the job is is supposed to be, but what does 0 (zero) mean? Should it be returning the se

  • Gallery not loading

    I'm trying to upload a photo gallery of 211 photos. Every time I send it I get a message "An error occurred while publishing the album "2007 Santa- Child & Family Center." Request to the server failed." I've tried creating the gallery with 80 photos

  • Having Some unknown characters in my file of Receiver Mail Adapter

    Hi All,         I have a unique problem, I am having special characters(  #S@u201D E" E$ u201Däu201Där 4TåE$R   D0u201CC3 u0192    c@u201DÔôETÄPu201Du201Eu20220u201D 3@u201C  ó ró#  u20ACu201C  ó# ó#  u2019 ) in text file of Receiver Mail Adapter.I

  • External trouble

    my external hard drive is not being recognized by my MBP. normally whenever i plug it in, the device begins to spin, and the icon is placed onto my desktop. however, today when i plugged in my external, the device begins to spin, but nothing is place

  • How do i make it so when i type a url...

    it doesn't underline it and make it a hyperlink? I'm printing it on paper, so it doesn't need to be a hyperlink.