Decode and Ifthenelse

Hi Experts,
                I would like to know the functioning of decode and ifthenelse functions. Which one is faster. Is there difference in the performance of these two.
Thanks & Regards
Alex Oommen

Hi Alex,
ifthenelse function Allows conditional logic in expressions Returns one of the values provided, based on the result of condition. The data type of the return
value is the data type of the expression in true_branch. If the data type of false_branch is not
convertible to the data type of true_branch, Data Services produces an error at validation.
decode returns the value associated with the first condition that evaluates to TRUE. The data type of the return value is the data type of the first expression in the condition_and_expression_list. If the data type of any subsequent expression or the default_expression is not convertible to the data type of the first expression, Data Services produces an error at validation. If the data types are convertible but do not match, a warning appears at validation.
The decode function provides an easier way to write nested ifthenelse functions. In nested
ifthenelse functions, you must write nested conditions and ensure that the parentheses are in the
correct places, as the following example shows:
ifthenelse ((EMPNO = 1), '111',
ifthenelse((EMPNO = 2), '222',
ifthenelse((EMPNO = 3), '333',
ifthenelse((EMPNO = 4), '444',
'NO_ID'))))
In the decode function, you list the conditions, as the following example shows. Therefore, decode is
less error prone than nested ifthenelse functions.
decode ((EMPNO = 1), '111',
(EMPNO = 2), '222',
(EMPNO = 3), '333',
(EMPNO = 4), '444',
'NO_ID')
Regards,
M Ramesh

Similar Messages

  • Efficiency of decoding and displaying image files?

    BRIEF SUMMARY
    My question is this: can Flash Player download JPG and GIF
    files from a server and rapidly open/decode them, ready for
    display, efficiently and
    entirely 'in memory'?
    Would Flex be a good choice of language for developing a RIA
    that needs to continually download lots of JPG and GIF images
    on-the-fly from the server and render them on the screen? I *don't*
    want my application to thrash the hard disc.
    BACKGROUND
    I am designing a 'rich' web app, and I'm investigating
    whether Flex is the right tool for the job.
    Although Flash's animation features are an obvious selling
    point for implementing my user interface, I also need to do some
    server-side rendering. What I want to do is perhaps a little
    unorthodox: I will be generating lots of GIF and JPG files on the
    fly and these will be streamed to the client (along with other
    application data, e.g. in XML format) to update different parts of
    the on-screen document. In need this to happen very quickly (in
    some cases, creating the effect of animation).
    It happens that JPGs and 16-colour GIFs will be, by far, the
    most efficient formats for streaming the images, because of the
    nature of the application. I could of course send the images in
    some proprietary format, geared for my application, but presumably
    decoding the images would be slow as I would have to implement this
    myself in ActionScript, and so I would be limited by the speed of
    Flex 'bytecode'. (I realise Flash is a lot more optimised than it
    once was, but I am hoping to see a gain from using image formats
    that Flash natively understands!)
    Naturally the internet bandwidth should (in principle) be the
    bottleneck. However, assuming I can get my image files to the
    client on time, want I want to know is:
    how efficient is Flash at loading such files?
    Bearing in mind that I'm not just displaying the occasional
    image -- I will be doing this continuously. Most of the images
    won't be huge, but there will be several separate images per
    second.
    The image files will be a mixture of normal colour JPGs and
    4-bit colour GIFs (LZW-compressed). I know that Flash natively
    supports these formats, but depending on how Adobe have implemented
    their LZW/Huffman decoding and so on, and how much overhead there
    is in opening/processing downloaded image files before they are
    ready to 'blit' to the screen, I imagine this could be pretty fast
    or pretty slow!
    If my client only has a modest PC, I don't want the JPG/GIF
    decoding alone to be thrashing his CPU (or indeed the disc) before
    I've even got started on 'Flashy' vector stuff.
    I'm new to Flash, so are there any 'gotchas' I need to know
    about?
    E.g. Would it be fair to assume Flash Player will do the
    decoding of the downloaded image entirely 'in memory' without
    trying to do anything clever like caching the file to disc, or
    calling any libraries which might slow down the whole process? It
    would be no good at all if the images were first written to the
    client's hard disc before being ready to display, for example.
    Further, if I'm doing something a little out-of-the-ordinary,
    and there is no 'guarantee' that images will be loaded quickly,
    what I'm doing might be a bad idea if a later version of Flash
    Player may (for example) suddenly start doing some disc access in
    the process of opening a newly downloaded image. So, while I could
    just 'try it and see', what I really need is some assurance that
    what I'm doing is sensible and is likely to carry on working in
    future.
    Finally, I imagine JPG/GIF decoding could be something that
    would vary from platform to platform (e.g. for the sake of
    argument, Flash Player for Windows could use a highly-optimised
    library, but other versions could be very inefficient).
    This could be the 'make or break' of my application, so all
    advice is welcome! :) Thanks in advance.

    You need a servlet/jsf component to render the image in the response.
    Look at this: http://www.irian.at/myfaces-sandbox/graphicImageDynamic.jsf

  • How to decoding and encoding PNG and GIF images?

    I could decode and encode JPEG images using following create functions which are in com.sun.image.codec.jpeg package.
    JPEGImageDecoder decoder = JPEGCodec          .createJPEGDecoder(inputStream);
    JPEGImageEncoder encoder = JPEGCodec                    .createJPEGEncoder(outputStream);
    But I dont know required package and functions to decode and encode PNG and GIF images. Please help me.

    Is the API that hard to follow?
    ImageIO.read( file/stream/url)
    ImageIO.write( image, format (e.g. PNG, GIF(1), JPEG), file/stream what have you)
    1) Not sure if Java supports GIF saving, it might if you install JAI, or Java 6.

  • How to decode and display jpeg from a bytes stream ?

    Hello.
    I am new to Flex and got stuck on something that I assume has an easy solution.
    I have an RIA application in which I want to display a jpeg image. this image was
    sent on a Web Service message,  as an array of bytes (I just read the jpeg file as
    is and send it to the web application).
    I couldn't figure out a way to decode and display this image at the RIA, using an apropriate component. (Image ?)
    I have seen a few examples where a jpg is loaded from a web server using a url in
    which it's avaliable, but I don't think this is much help to me...
    Your help/example apreciated.

    Thanks.
    I assume you mean passing the bytesArray to Image.load() ?
    Anyway, that's what I did and it worked fine.
    Now I am facing the same issue with playing sounds, which are available on bytesArray.
    I tried to pass the mp3 bytes to the Sound.load(), but it doesn't work, becuase it tries
    to cast it to a URL. do you know by any chance  whether I can achieve that somehow ?
    (I could use prety much any other sound format, if it makes a difference)
    Thanks again.

  • Error in Adobe Captivate 4: "unable to decode and import the selected wav - mp3 file"

    Good day!
    I have a problem. When i want to import music file from standart Gallery, i see the mistake: unable to decode and import the selected wav - mp3 file.
    I can't import mp3,wav files...
    In Adobe Help site i have found this: http://help.adobe.com/en_US/Captivate/4.0/Using/WS5b3ccc516d4fbf351e63e3d119e9582190-7fd8. html
    But in my Adobe Captivate 4 directory i don't have file regsvr32 NSAudio.dll.
    Question: where i can download this file?
    Thanks!

    Hi there
    As I recall there were two different "fixes" for audio with Captivate 4. One involved replacing the dll and another had something to do with installation problems on Windows XP. So give the link below a try.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • Diff between decode and case

    Hi
    I need small clarification about difference between decode and case
    Thanks who visit my thread

    And for those people who can't be ar$ed to follow links...
    Decode allows for conditional output where the conditions are straightforward matches between values.
    Case allows for regular conditions to be used such as greater than, less than etc.
    Some of the things done by case can be achieved through decode as well but in a more convoluted manner than simply using case.
    ;)

  • More effecient way of using Decode and CASE

    Is it possible to use both case and decode together? I feel I have too many decode and I am not sure how to write this in a more efficient way.
    I would really appreciate any help.
    Thank you so much in advance!!!
    SELECT  Person_ID,Work_ID,
        CASE WHEN NBR = 1 THEN
                MIN(DECODE(NBR, 1, field1)) aug_one_field1;
                MIN(DECODE(NBR, 1, field2)) aug_one_field2;
                MIN(DECODE(NBR, 1, field3)) aug_one_field3;
                MIN(DECODE(NBR, 1, field4)) aug_one_field4;
                MIN(DECODE(NBR, 1, field5)) aug_one_field5;
                MIN(DECODE(NBR, 1, field6)) aug_one_field6;
        CASE WHEN NBR = 2 THEN
                MIN(DECODE(NBR, 2, field1)) aug_two_field1;
                MIN(DECODE(NBR, 2, field2)) aug_two_field2;
                MIN(DECODE(NBR, 2, field3)) aug_two_field3;
                MIN(DECODE(NBR, 2, field4)) aug_two_field4;
                MIN(DECODE(NBR, 2, field5)) aug_two_field5;
                MIN(DECODE(NBR, 2, field6)) aug_two_field6;
        CASE WHEN NBR = 3 THEN
                MIN(DECODE(NBR, 3, field1)) aug_three_field1;
                MIN(DECODE(NBR, 3, field2)) aug_three_field2;
                MIN(DECODE(NBR, 3, field3)) aug_three_field3;
                MIN(DECODE(NBR, 3, field4)) aug_three_field4;
                MIN(DECODE(NBR, 3, field5)) aug_three_field5;
                MIN(DECODE(NBR, 3, field6)) aug_three_field6;
        CASE WHEN NBR = 4 THEN
                MIN(DECODE(NBR, 4, field1)) aug_four_field1;
                MIN(DECODE(NBR, 4, field2)) aug_four_field2;
                MIN(DECODE(NBR, 4, field3)) aug_four_field3;
                MIN(DECODE(NBR, 4, field4)) aug_four_field4;
                MIN(DECODE(NBR, 4, field5)) aug_four_field5;
                MIN(DECODE(NBR, 4, field6)) aug_four_field6;
    END
       FROM (SELECT Person_ID,Work_ID, NBR
                   fiel1, field2, field3,field4,field5, field6,
                  FROM field_rep
       GROUP BY Person_ID,Work_ID

    Thanks alot John and Frank.
    John to answer your question, I just felt the 24 or more decode will slow down the systems performance, hence I was trying to find a better way to do it.
    Frank
    This is a sample data but I want it pivoted hence the reason for using the decode. I have oracle 10g. These are sample data
    Person_id work_id NBR      field1     field2     field3     field4 field5 field6
    1       ao334   1     1/2/2009   1/9/2010     block_A        HH       55667      1
    1       ao334   2     5/2/2011   9/9/2013     block_Z        HL       11111      3
    1       ao334   2     1/2/2009   1/9/2010     block_A        HH       22222      1
    1       ao334   4     1/2/2009   1/9/2010     block_A        HH       zzzzz      7
    1       z5521   1     10/5/2006  12/31/2012     block_C        SS       33322      1
    1       z5521   2     1/2/2009   1/9/2010     block_C        SS       21550      1
    1       z5521   3     1/2/2009   1/9/2010     block_R        SS       10000      1
    1       z5521   4     1/2/2009   1/9/2010     block_D        SS       99100      5
    1       z5521   5     1/2/2009   1/9/2010     block_P        SS       88860      1
    1       z5521   6     1/2/2009   1/9/2010     block_G        SS       99660      8
    1       ob114   1     1/2/2009   1/9/2010     block_A        HH       52333      1
    1       ob114   2     1/2/2009   1/9/2010     block_A        HH       88888      1Output will look like this
    Person_id work_id  aug_one_field1 aug_one_field2 aug_one_field3 aug_one_field4 aug_one_field5 aug_one_field6 aug_two_field1 aug_two_field2 aug_two_field3 aug_two_field4 aug_two_field5  aug_two_field6
    1       ao334        1/2/2009       1/9/2010       block_A       HH             55667          1              5/2/2011       9/9/2013       block_Z        HL                      11111          3

  • Decode and Case

    Hi,
    What is the difference between decode and case?
    What are the cases in which we can use Decode and case
    Thanx

    you can not put Search CASE statements by using DECODE
    Eg:
    SELECT AVG(CASE WHEN e.salary > 2000 THEN e.salary ELSE 2000 END) "Average Salary" FROM employees e;Can't we?
    select avg(decode(sign(e.salary - 2000), 1, e.salary, 2000)) "Average Salary" from employees e;

  • Can not import my wav. file, message "unable to decode and import selected wav/mp3 file"

    Please help, i don't know how to import my wav file. I checked to see if the settings are compatible
    and it seems like them are. The wav file im trying to import is: 88kbps, 11kHz...

    I don't think so, if its not how do I get it to be?
    (Embedded image moved to file: pic07711.jpg)
    Jackie Stjepanovic
    Trainer
    Staff Development
    Automobile Customer Service (ACS)
    (310) 781-4627
                                                                                    Captiv8r                                                 
                 <[email protected]                                        
                 >                                                          To
                                           Jackie Stjepanovic             
                 11/23/2010 08:56          <[email protected]>
                 AM                                                         cc
                                                                                    Subject
                 Please respond to         Can not import my
                 clearspace-974018         wav. file, message "unable to  
                 851-110472-2-3295         decode and import selected wav/mp3
                 [email protected]         file"                          
                     dobe.com                                                                               
    Is it PCM encoded?
    Cheers... Rick  
    http://www.robowizard.com/pc.gif
    Helpful and Handy Links
    http://www.gooberguides.com/ProductPages/Captivate/Captivate5Foundations.htm
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=5
    http://www.ShowMeSolutions.biz
    http://sorcererstone.wordpress.com/
    http://www.gooberguides.com

  • Unable to decode and import wav/mp3 file

    I've recorded an audio file using Mbox 2 and Pro Tools LE 7.
    I have exported the file to the wav format, but when I try to
    import it into my Captivate 2 file, I get the following error
    message.
    "Unable to decode and import the selected wav/mp3 file."
    Any ideas why this is happening?
    Thanks for the help.
    Mark

    Hi "Chemistry guy",
    A WAV is not a WAV is not a WAV. There are many "types" of
    WAV audio file. Check to be sure that your WAV file is in "
    PCM" format. That should be easy with a good audio editor.
    Matter of fact, it should be easy even with Windows included "Sound
    Recorder" application.
    To use your own audio editor, I imagine you know how to find
    and change file properties.
    On the other hand, if you want to use "Sound Recorder" ... on
    WinXP go to "Start > All Programs > Accessories >
    Entertainment > Sound Recorder", then open the file, then go to
    "File > Save As" ... and
    at the bottom of the save-as dialog, you will see "Format"
    (describing current file formatting) and a button to "CHANGE" that
    format. Click the button and you will see a drop-list containing
    various formats.
    Select "PCM" and
    save the file.
    Hopefully with this change made, you will be good to go.
    .

  • Unable to decode and import the select wav/mp3 file

    Hi,
    I've been TRYING to test the Text-to-speech feature in
    Captivate 4. Problem: "Unable to decode and import the select
    wav/mp3 file" each and every time I want to use it. Frustrating!
    I also tried importing sounds from the library, same problem.
    My system is Vista Business 64Bit, 4Gb RAM, Intel SSD hard
    drive, conexant high definition audio 221 on a Lenovo T400.
    How do I fit this? I want to try it out damnt :)

    I went through the "unable to decode and import the selected wav/mp3 file" error.  After talking with an Adobe Rep,  I quickly realized that I could NOT use the directions.  I have no experience in using Command Prompts.  I have written down the directions by key stroke for those people that are similar to me.  Enjoy!
    For Vista and Win7,
    Click on the circle start menu,
    In the search box, type in command and in the generated list, "right-click" on the comman link and change to "run as administrator".
    Go back to the search box, type in command and hit enter.  This will take you to the command prompt window (black window w/ white text) lol
    You have to get to the right directory first.
    Type: cd (space-bar) .. (hit enter)
    Type: cd (space-bar) .. (hit enter)
    If Captivate is installed on Program Files (x86) ---
    Type: cd (space-bar) progra~2 (hit enter)
    If Captivate is installed on Program Files
    Type: cd (space-bar) progra~1 (hit enter)
    Type: cd (space-bar) Adobe (hit enter)
    Type: cd (space-bar) Adobe (space-bar) Captivate (space-bar) 4 (hit enter)
    Type: regsvr32 (space-bar) NSAudio.dll (hit enter)
    If you get an error at any point, re-key that particular line.
    Once you see that the last line of command went through, open up Captivate and test the Text to Speech.  These instructions fixed both computers I was working on!!!!

  • CP4 unable to decode and import the selected wav/mp3 file

    I am trying to import a .wav file into a project and get an error message 'unable to decode and import the selected wav/mp3 file'.
    I have tried the solution huan_miguel posted a week ago for someone with the same problem.
    http://blogs.adobe.com/captivate/2009/03/adobe_captivate_4_installatio n.html
    executed all the steps described in this link.
    Unfortunately, the problem is still there.
    Any other solution?

    You're probably going to need to do both.
    Although Captivate can certainly accept a 10 meg audio file, you would need to add it to the movie and then synchronise the slides to the audio. Chopping the audio file up and adding the relevant bits to each slide has both advantages and disadvantages.  It's easier to control the playback synchronisation when you divide up the audio, but it's more work.
    Take a look at this graphic from SoundBooth when I export an audio file recorded in Captivate 5:
    Notice that it shows the bitrate of the Captivate WAV file as being 16 bit.  This is quite a low bitrate.  You can go as high as 32 bit in SoundBooth, however, in my experience, when you try to import a WAV into Captivate that is over 16 bit you will encounter issues.  Cp just doesn't seem to like it.
    If you want to learn more about bit rates in multimedia: http://en.wikipedia.org/wiki/Bit_rate
    Suffice to say, you need to find out what the current bit rate of the audio file is, and if necessary, save it as 16 bit for Captivate.  For this, you will require some kind of audio editing software.
    You can try using Audacity as someone else suggested: http://audacity.sourceforge.net/  and try exporting the file out as 16 bit.
    However, if you are going to be doing quite a bit of this type of work, I would suggest you invest in Adobe Soundbooth, or something of that ilk.  You'll enjoy the experience more.

  • Unable to decode and import the selected wav/mp3 file

    I am trying to import mp3's into a Captivate 3 presentation
    but keep getting this error "Unable to decode and import the
    selected wav/mp3 file." I am using the same mp3 files that I have
    used many times with projects in Cap1 and Cap2. I have converted
    the files to wav's and tried but I'm still getting the same
    message. I have a deadline and I'm stumped.
    Any ideas?

    Hi DianaUNC
    Interesting. I've seen it happen with WAV files but not MP3.
    Do you still have Captivate 2 around? If so, do these successfully
    import into Captivate 2? One thought was that you might pop them
    into something like Audacity and save them out again. Perhaps
    something is amiss with the encoding used.
    Or you might try the trick of opening them in Windows Sound
    Recorder and saving them out of that in a different format. I know
    that works with one particular WAV file I have.
    Cheers... Rick

  • 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

  • Multithreaded Video Decoding and Seek frame accuracy for seamless m4a loop

    Hi everybody,
    We read that flash 11.2 and Air 3.2 will improve the seek functionality.
    Right now being able to select a part of a track and precisely loop it is very difficult and complex for an mp3 but impossible with an m4a due to NetStream.
    So if you could let us know if the Multithreaded Video Decoding and Seek frame accuracy improvement in 11.2 and 3.2 will bring us a solution would be great!
    Basically as m4a are local files does 11.2 and 3.2 will allow to seek not only to keyframes but anyframe? This is key functionality to all music applications. If not do you think it will come soon?
    Thank You

    Seamless looping using seek will not work very well. It will have to be a separate feature.
    You could submit it as a feature request.

Maybe you are looking for