Mark to base using DECODING works is not as expected.

Version: 11.2.0.3

Platform: RHEL 5.8

I try to use the DECODE function.

In the example below, if the meeting looks for the string 'Enterprise', then decoding should

return 'Enterprise '. But it doesn't seem to work.

I thought that some hidden character was the origin of the problem, so I used the TRIM. But no luck.


SQL > create table t (banner varchar2 (80));

Table created.

SQL > insert into values t ('Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production');

1 line of creation.

SQL > commit;

Validation complete.

SQL > select * from t;

BANNER

--------------------------------------------------------------------------------

Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

SQL > select * from t where the banner as "database % ';

BANNER

--------------------------------------------------------------------------------

Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

-Try to use decode it. If the meeting looks for the string 'Enterprise', then return 'Enterprise '.

-Although the string "Business" is present, decode doesn't seem to work.

-I tried to use the upper trim. But no luck.


SQL > select 'EDITION', decode(banner,'%Enterprise%','Enterprise','Standard') edition of t which the banner like '% database % ';

' EDITION EDITIO

------- ----------

Standard EDITION

SQL > select 'EDITION', decode (trim (banner), '% company %', 'Enterprise', 'Standard') edition of t where trim (banner) like '% database;

' EDITION EDITIO

------- ----------

Standard EDITION

SQL > select 'EDITION', decode (upper (trim (banner)), "% COMPANY % ', 'Enterprise', 'Standard') edition of t where upper (trim (banner)) as"DATABASE % ';

' EDITION EDITIO

------- ----------

Standard EDITION

SQL >

Don't understand why decode cannot see the string "business".

BTW. Where is the Preview button?

Hi Ram,

Decode the will just exactly the result of research and the return value if it matches. This is the way DECODE and CASE work.

For example: DECODE(deptno,10,'Accounts',20,'IT')

So please adjust your statement accordnigly. Use INSTR, or REGEXP_COUNT.

See the example below.

SELECT decode(regexp_count(banner,'Express'),1,'Express Edition')
FROM v$version;

In the new forums, I think that we don't have a preview button to see our post before posting.

See you soon,.

Suri

Tags: Database

Similar Questions

  • XPS 13 - Wake from sleep using USB works, but not when lid closed?

    I mainly use my XPS 13 as a desktop replacement - I have the lid closed; monitor and a keyboard, a mouse connected (both wireless).

    I finally managed to get to wake up from its sleep by moving the mouse by activating 'allow this device to wake the computer from sleep mode' in the device (Win 7 64 bit) Manager, but it does nothing when the lid is closed, which is 99% of the time because I am using a monitor. I have to open the lid and use the power button.

    Does anyone have an idea on how to get this working, or not at all?

    It works fine on my other laptop Dell I bought at the same time (Inspiron 15). One is connected to a TV as a "Media Server", if the lid is also closed all the time, but he wakes up from his sleep when I move the mouse USB wireless.

    OK, it's now solved!

    The A08 BIOS update allows this, BUT the strange thing is that sometimes the option ' USB wake sleep ' is not available after a BIOS flash.

    This time, it was and now I can wake up the laptop from sleep, even with the mouse Wireless USB via a hub!

    Yay!

  • Backup of Windows 7 - change the settings - works does not as expected

    I'm trying to configure the backup of Windows 7 by using the "Change settings" option, but when I click on the link, all I get is a the Explorer window showing the contents of c:\Windows\System32

    Same thing if I click on the link 'manage space '.

    What I am doing wrong? or is it a mistake?

    Had the same prob, winlocker and shredder in the context menu, uninstalled winlocker and voila, backup now works.
    So, try to uninstall the software that hangs in the context menu (the menu "right click") and see if it works. Not interested in why at that time [is really starting to enjoy my Kubuntu box]

  • Windows search works is not as expected

    Why windows search return results that do not include the string I searched for?

    I told windows to search files, as well as in the sub directories. I added the suffix. PLM to the list of files to search for.
    I'm looking for a directory for files containing the string "settings.h", and one of the files that is my main.plm file. When I open this TextPad and search for the string "settings.h" in this file is not there.

    Why Windows gives me this fallacious result in searches? As a programmer, it is important to be able to search through a lot of files for strings to see where they are referenced. I would expect Microsoft as a software company to understand this requirement and why it is important.
    Thank you
    Mark

    I think that period is not sought specifically for and 'settings' and 'h' are treated as strings to search for in any order.  This search syntax to find the strings that contain symbols such as periods:

    Content: ~ = "Settings.h"

    However, the extraordinary ~ = syntax does not work for the content of the files that are located in areas that are indexed.  It is strange that we have indexed the content property syntax work only outside areas, but that's what we have.  This deficit is one of the reasons why I have completely disabled search indexing.  However, with indexing disabled, we are not able to retain or add manual of new additions to the list of searchable files specified by exenstion.  It might be appropriate for keep you to keep indexing on but these files in an area not indexed together.

  • Searching for pictures of iOS 10 works is not as expected

    I have updated to a couple of my iOS devices (iPhone 6 and iPad Air) iOS 10, actually 10.1 public beta 1 now, but find the results obtained in the search of my library of ~ 5000 photos and videos quite modest.

    I very rarely get the images I'm looking for, if any.

    For example, 'find my photos from the Netherlands' Returns none so I have 122 in my library.

    The research of the city of Delft (that is the Netherlands) returns a single result, which, ironically, shows a screen indicating the word "Delft" on a local train.

    I wonder if there is the possibility of re-indexing of the library or the device can be done on a Macintosh, but I'm afraid user ios do not have such a luxury for now.

    In my troubleshooting process I spent from Italian to English, since this might be a reason for poor search results. But things have not changed.

    Of course, if I ask "Find my photos of the mountains" (or dogs by the way) I get decent results this image recognition works though, not much luck with geotags.

    Any idea?

    / P

    Wow!

    The answer to this question of mine has been overwhelming... (I'm kidding)

    In the meantime, FYI Apple has released the iOS 10.0.2 update that solves the problem of geotags.

    I can now find my photos from the low countries (or Switzerland or India also) and get the correct results.

    Nice

    / P

  • HP envy 4500 problems scanning - used to work, now, not so much

    I tried to solve this problem for over 3 hours now so apologies if shows my frustration.

    Equipment:

    MacBook pro under OS X 10.9.2

    Apple airport express router

    HP Envy 4500 all in one printer/scanner

    I can print without problem.

    Using the HP Scan application, I get this message:

    My camera looked good in regards to connectivity on my computer in system preferences, then I went to the screen of printer control in the menu 'Wireless' and I tried to redo the wireless configuration. I typed in my network name and the printer can't find my network. I have continued in any case, left the network name in and typed the wi - fi password, still no luck.

    So I tried the WPS in place. The screen just kept looking, and nothing connected.

    So, I tried to download the drivers from the HP site and guess what? The driver is installed on my hard drive, but then set it up the window of the HP utility can't find my device is:

    I tried to connect the printer directly to the computer with the USB cable, just so he could download the driver, he got as far as the next step, "Configuring device" and who doesn't work anymore:

    I tried to restore the default settings on the printer.

    I tried uninstall & reinstall - oh, but then we encounter the same problem.

    And during all this, the printer has frozen several times, so I had to unplug the power to restart.

    I restarted my computer and my router. I did everything listed to. The printer does not have the router in Setup Wizard, and in the HP utility, it does not find my printer, BUT I CAN PRINT.  Just doesn't scan.

    For some reason, I can PRINT wireless with no problems. But the scanner do not think that my router or my computer is. I can not open even the utilities EVEN when it is connected DIRECTLY with USB, I get this message:

    I am beyond frustrated, I'm about to throw it at the wall. Please if anyone has a solution, I'd like to hear it. This printer is not even 5 months old. I HATE when things are not working. I can understand if I did something to it, but I did nothing else until it turned off for a few days.

    Note: I WAS able to scan before without a problem. The only thing I can think is that I put my printer off for a few days because I was not using it.

    Ugh. OK, it's been 4 hours.

    Hi, if anyone else has this problem, read this post, it has solved the problem for me:

    http://h30434.www3.HP.com/T5/Mac-printing-and-scanning/HP-2610-scanner-does-not-work-with-Apple-Maverick-10-9/m-p/3867896/highlight/false#M50069

  • Little something that used to work, but not now?

    Hiya,

    Years in Dreamweaver 8, I made this page: http://deepwater3d.Kol.co.nz

    Now if you resize the window, you will see the image will resize accordingly, well it does not stretch, it won't get cut, it retains its proportions regardless of what screen size you view it from.

    I did that by the size of the width of the image = 100%, height = width\4 * 3

    But today, using the same version of dreamweaver it won't let me enter these values by saying that its not valid.

    How is that possible? I did exactly this years and lol it works very well on the internet? It will not work with forwardslashes or oblique... What can I do to force the height dependent on the width, so I keep my proportions of the image?

    Thank you

    CAScreen shot 2011-10-07 at 7.14.54 PM.jpg

    The HTML code you added years ago is as invalid as it is today.  DW is today much more stringent while allowing you to perform these corruptions.

    Try to remove the specification of the total height.  Who will be resize the image and maintain proportions.

  • Mobile mouse 3000, used to work, is not now.

    Both the red light and the green light on the stick work.

    Change of battery.

    Computer says that it works, but it is not

    Reset buttons have all been postponed.

    Hi CatherineJohnston,

    You did it of any material changes or software on the computer before this problem?

    You can follow this link and check if the problem persists.

    Troubleshoot the incidents of the response to the mouse or wireless keyboard

    Hope the helps of information.

    Please post back and we do know.

  • Events in Subvi works does not as expected

    Hi, I'm reposting this question because my previous one did not lead to a satisfactory conclusion.

    I enclose my Vi which do not work as expected. If I remove a Subvi and its controls of 3 partners and two indicators, it works fine, but when I add two screws SUB, it's messy. I'm learning in this way, I don't know it can be done a lot of other ways, but please help me find the problem, do it this way in my final MainVi, I would use Live 8 such void. Thanks.

    Your main problem is the FLOW OF DATA.  A loop can not browse all what it has not completed.  So, as you have, you must have the two structures of event execture before you can go back to look for the next event.  So if you insist on having these subVIs, they must be in separate loops.

    BTW, you can get away with a single Subvi.  Go to the properties of VI and make incoming (preallocated clone).  Then, each call to your Subvi has its own memory space.  Much easier to maintain this mode.

    And I know you said you didn't want alternatives, but here's how you can do it with a unique structure in your main loop.

  • HTTP POST works does not as expected

    I can't understand why the POST with data works when I use Firefox, but not when sent from the BlackBerry. The only difference seems to be that the BlackBerry less sends the headers, but it's all legal HTTP.

    It's TCP data are sent to the server (from recorder package):

    ----------------------------------

    HTTP/1.1 POST/page
    Host: localhost
    Connection: close
    Content-Length: 8

    test = abc

    ----------------------------------

    That sounds about right. However, the Web Server table $_POST (PHP) is empty.

    Code follows:

         HttpConnection c = (HttpConnection)Connector.open(connectionString);
            c.setRequestMethod(HttpConnection.POST);
    
            DataOutputStream out = c.openDataOutputStream();
            URLEncodedPostData postData = new URLEncodedPostData(URLEncodedPostData.DEFAULT_CHARSET, true);
            postData.append("test", "abc");
    
            System.out.println("requestData: " + new String(postData.getBytes()));
            out.write(postData.getBytes());
            //out.flush();
    
            c.getResponseCode();
    
            InputStream is = c.openDataInputStream();
            LineReader lr = new LineReader(is);
    
            while(true)
            {
                try
                {
                    byte[] arr = lr.readLine();
                    System.out.println("Line: " + new String(arr));
                }
                catch(EOFException e) { break; }
            }
    

    Everyone knows about similar problems using POST?

    See you soon,.

    Pav

    Update:

    -J' tried this on 2 servers Web (Apache + PHP) unrelated, both have the same problem.

    SOLVED!

    I tried to put different headers that Firefox sends inside the request of BB and it does the job:

    c.setRequestProperty ("Content-Type", "application/x-www-formulaires-urlencoded");

    Hope it saves someone out there a lot of frustration :-)

  • handheld at 1 pixel brush works does not as expected...

    Hello everyone :-)

    When I try to draw a simple freehandline with the tool draw we get this before I release the mouse button:

    Outline 1.jpg
    That's how I expect the line to be in the final drawing.

    But instead I get this so after releasing the mouse button:

    Outline 2.jpg

    I'm using this brush settings:

    Brush Settings.jpg

    So he must produce a solid rounded 1 pixel brush stroke... In Illustrator CS6 this worked as expected.

    What I am doing wrong? :-o

    All apreaciated advice! :-)


    Have a good day, cyan68

    "Einfach" means "without a brush.

    But: the Brush tool will not work without a brush, he always apply a brush.

    The pencil tool is what you want. Really.

    It works exactly like the Brush tool, but without having to apply a brush.

  • Filling of camera works does not as expected in Android OS 4.0

    Hi all

    Recently upgraded to Ice Cream Sandwich (Android 4.0) on my model of Motorola Xoom Wi - Fi. Love it so far. I seem to have a new problem trying to create a camera effect fill of any kind. Steps to repro:

    • Create any type of layer
    • Press on the '&' > type 'bridge camera '.
    • Try taking a picture; PS Edit then ends in a loop of treatment (with the four squares to the right animation)

    If I try to use the 'back' button Android, I can go back to the Android home screen, and then re - enter PS Touch, who then proceeds to ask me if I want to save my snapshot (which is basically empty). I type any option and everything goes as usual (less PS touch do not take the picture).

    I suspect it has to do with Ice Cream Sandwich and the new drivers for the camera of the Xoom. I tried uninstalling and reinstalling PS Touch that does not solve the problem.

    Other that that, I have not found something else wrong while using PS touch under Ice Cream Sandwich. I notice a very little bit of performance increase also.

    Just thought that I let you know and see if anyone else can repro.

    Version 1.1.1 fixes all my problems. Fonts are back, selections so that work now complete camera very well. Yay!

  • newText works does not as expected

    Hello all,.

    I am using formCalc.

    My form has a drop-down list box allows this custom text entry. On the change event is a script as follows:

    SubformRecap.TableLiabilityRecap.Row [13]. Cell [1] = xfa.event.newText

    The custom text entered only works when the user:

    • start typing without displaying the menu choices drop-down or completely erases the text of an unwanted choice field
    • then, type the custom text
    • AND then press ENTER

      The script fails to capture the newText if ONE of the following actions occurs

      • does not completely erase the contents of the field drop-down box
      • or highlights and types on the highlighted text
      • or, use TAB instead of ENTRY when you have finished typing

      When it fails the following text/integer appears in the referenced field: 1

      I have limited user so I guess I could train, however, I would like to avoid that if possible. It's a great form and TAB the norm for the entry and exit of the fields. People use it on their laptops in the field - oddities like this in order to have a major nuisance.

      Is the change the right event? Is there a way to enter (ENTER virtual) script?

      Thanks in advance!

      Stephen

      Well, this problem seems interesting... I tried to rebuild, but nothing never is, for me it works in any case so far.

    • Poster works does not as expected with Adobe CS5

      I've finally updated to OS X on an early 2009 Mac Pro Quad Core. I have two screens: a 20 "Apple Cinema and a Samsung Syncmaster. Previously, always with Snow Leopard, I had no problem with the implementation of my menus, panels, etc on the Samsung, thus leaving my film clean and only to view the picture or painting under development. It's a great ploy.

      But now, I can't have my workspace (menus, panels and so on) to "stick" to the Samsung. Instead, they insist on layering anything I'm working on the cinema, which is now difficult to see behind all the clutter menus and panels.

      I tried to move this to the Samsung, and I saved the arrangement as a new workspace. But the next time and so on, I opened Photoshop, all the menus were back on my film. It is a problem, I expected little, all the problems you may have. But it is serious because I'm not keen on having to pass all the other screen before starting work. In addition, it could be the cause? None of the existing workspaces or those custom made displays on the second monitor except if moved manually.

      I'd appreciate responses as to why this is happening. Thank you

      -Try to reset memory NVRAM/PRAM and SMC

      MacIntel: Reset of the controller (SMC) system management

    • Case structure works is not as expected

      Hello all

      I have a business structure which does not seem to work there in the State on.

      I created the circuit 1st in 1st red slice and it works each led flashes on then off in sequence, but when I try this logic in a case statement (in the 2nd red block) they are all remain lit.  What is the way in which the case statement suppose to work?  Is their a workaround solution?

      Thank you

      First of all, you have here a block diagram.  A 'circuit' is what you create in the material of electric wires and components with electronic.

      All your case structures all work as expected.  What you were doing in the upper part is different from the bottom.  In the background, each LED is located inside a special case.  This particular case only runs when something is true.  You have no way of writing a fake to the LED, because if the LED is going to be false, this case will not run.  Up there, the LEDS are always in the path of execution, so that they get a value True or False, written for them, as appropriate.

    Maybe you are looking for