Decode and Date

Dear All,
Does decode check the date in the table and returns some value from the same table? For example;
Select decode(original_date,1, (select new_date from ABC_Calendar) from ORG_Calendar;It should be like above.
Thanks

Hi Nicolus,
Here is the code with decode which I tested which failed. Now There is code and there should be help as there is problem. I would appreciate your help to resolve this issue.
SELECT ROWNUM,batchid,statusdate,decode(statusdate,statusdate, (select GREG from HIJ_CAL),(select GREG from HIJ_CAL)),nrofships,CITYNAME,delay_days,NULL Courier_Delivery_Time
FROM
SELECT batch,a.statusdate,(TRUNC(SYSDATE)-TRUNC(a.statusdate)) delay_days,(c.CITYNAME) CITYNNAME
FROM batch a , cityname c
WHERE TRUNC(a.statusdate) <=TRUNC(SYSDATE-3)
AND a.status=38

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

  • When connected to wifi, I get an error message saying "cannot decode raw data"

    While I am at school, I can connect to the wifi, however I can only access google, and the apple website. When I try and google something to work on a project, I get a messgae that says "Cannot Decode Raw Data" it is getting rather annoying, and I was wondering if anyone else has had this problem. The only time I have gotten this message is while at my school, it has worked before but only started this recently.
    Is there a quick fix for this? Is it something caused by the wifi at school?
    Thanks in advance.

    While I am at school, I can connect to the wifi, however I can only access google, and the apple website. When I try and google something to work on a project, I get a messgae that says "Cannot Decode Raw Data" it is getting rather annoying, and I was wondering if anyone else has had this problem. The only time I have gotten this message is while at my school, it has worked before but only started this recently.
    Is there a quick fix for this? Is it something caused by the wifi at school?
    Thanks in advance.

  • Decode on date range

    Hi ,
    I have a oracle table in which i have 6 date fields ok.
    I want to compare load_timestamp with all 6 date field to find out if load_timestamp date falls within the 6 date fields.
    If it falls within range then I have to mark it 'ACTIVE' else 'INACTIVE'
    business rule is as below:
    if (date of load between county_begin_dt and count_end_dt) and (date of load between fund_begin_dt and fund_end_dt) and (date of load between svc_cd_begin_dt and svc_cd_end_dt) then 'ACTIVE' else 'INACTIVE'
    I have tried using decode but give me error
    select decode(load_ts between fund_begin_dt and fund_end_dt, 'active','inactive')
    from table_name;
    error-
    ORA-00907: missing right parenthesis
    Any help is appreciated.
    Thanks in advance
    JP

    select
      case
        when (load_ts between county_begin_dt and count_end_dt) and
             (load_ts between fund_begin_dt and fund_end_dt) and
             (load_ts between svc_cd_begin_dt and svc_cd_end_dt)
        then 'ACTIVE'
        else 'INACTIVE'
      end as msg
    from table_name;Depending on your requirements, you may want to use TRUNC function.
    select
      case
        when (county_begin_dt <= load_ts and load_ts <= count_end_dt) and
             (fund_begin_dt   <= load_ts and load_ts <= fund_end_dt) and
             (svc_cd_begin_dt <= load_ts and load_ts <= svc_cd_end_dt)
        then 'ACTIVE'
        else 'INACTIVE'
      end as msg
    from table_name;pratz

  • Decode variant data w/o using 'Variant To Data' function.

    I need to decode variant data w/o having foreknowledge of the type used to create it. That is, I'm using the 'Flattened String To Variant' function which gives me the info I need, but it's all contained within one indicator. I need some way to break this info down into its constituent elements.
    For instance, let's say I have the flattened data and type descriptor from a cluster with two elements, a boolean and a string, but not the structure itself. Passing this flattened data and/or the type descriptor into a function, I would get a 2D array (or the like) as output containing the name of the boolean (its label), its value, and the name of the string and its corresponding value.
    There must be a way to
    do this, and I suspect it's been done already, but I can't find any reference to it.
    I have attached a file named Test.vi which demostrates this problem.
    Remember, even though I know the name of the control, I won't know the type, so I cannot use the 'Variant To Data' function to deference these values. I can make ready use of DLLs, CINs, or LabVIEW code for the solution.
    Thanks ahead of time for any help! Greg
    Attachments:
    Test.vi ‏26 KB

    You might be able to take advantage of the Variant to Flattened String VI from the Advanced>>Data Manipulation>>Variants pallette. This VI converts a Variant to a flattened data string and a type descriptor. The type descriptor is explained in ap note 154. You might be able to create a VI that would parse data from the flattened data string using the type descriptor. You might have to represent each piece of data as a flattened string to work around the data flow issues in LabVIEW.

  • 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

  • Decoding pdf data which was encoded as a single string

    I am storing a single (very large BLOB) string which is a base64 encoding of a .pdf file.
    If I try to decode the string I get a corrupted .pdf file.
    Below is the code I'm using to decode...
    blob_len := dbms_lob.getlength(pdf_blob);
    offset := 1;
    amount := 78;
    DBMS_LOB.CREATETEMPORARY(blob_dec,true);
    loop
    if offset >= blob_len then
    exit;
    end if;
    dbms_lob.read(pdf_blob,amount,offset,dec_buffer);
    dbms_lob.append(blob_dec,utl_encode.base64_decode(dec_buffer));
    offset := offset + amount;
    end loop;
    NOTE: I know the inital .pdf is fine because if I take the same .pdf file and encode it via Oracle's utl_encode.base64_encode facility, I can decode the data without any issue.
    I do notice that the utl_encode.base64_encode creates individual lines of 76 characters in length with CR's at the end of each, whereas the string I need to work with is a single long string of 201,433 characters.
    The string is coming in from an external webservice so I cannot influence its format.
    I can't read in the string in a single dbms_lob.read call as iIm restricted to the size of the buffer RAW definition (i.e. 32767 ).
    Any help appreciated.
    anthony.

    ascheffer,
    Thanks for your reply.
    I set the offset to 78 because all examples on the net had this figure.
    I've just changed the offset to 76 as per your suggestion, and I can't believe that this works.
    You're a hero!!!
    Thanks,
    Anthony.

  • C# Wrapper for Berkeley Db is not ptting proper key and data values

    Hi All,
    I am using C# wrapper for Berkeley Db which is available at sourceforge.net.
    Now when i am putting an integer as key value, it returns keysize as 9,
    instead of returning 4.
    That C# Wrapper contains a serialzing class called BDBFormatter which pass all the data into DBT .
    The file created using C# Wrapper is not read as key and data values are not coming properly if i try to read the file using only C berkeley db.
    Can anybody suggest me some way to create a berkeley Db file in C#. which can be accessible by Linux C berkeley Db APIs.
    Any help will be appreciated.....
    Thanks,
    Eric Hass

    user11218092 wrote:
    Hi All,
    I am using C# wrapper for Berkeley Db which is available at sourceforge.net.
    Now when i am putting an integer as key value, it returns keysize as 9,
    instead of returning 4.
    That C# Wrapper contains a serialzing class called BDBFormatter which pass all the data into DBT .
    The file created using C# Wrapper is not read as key and data values are not coming properly if i try to read the file using only C berkeley db.
    How data is encoded is up to the programmer. There is no defined way in BDB to do that, it is application dependent.
    The BDBFormatter class is just one way of encoding C# classes and structs (which includes the ability to serialize Nulls).
    It is written with BDB in mind and has some performance advantages over the standard .NET serialization classes.
    If you want to read back the data from code written in another language, you will have to duplicate how data is encoded/decoded.
    The source code is there to read. ;-)
    Karl

  • 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

  • "Cannot Decode Raw Data" Message with Ebay

    Regularly when i'm using Ebay Safari fails to load the web page with the following error:
    Safari can’t open the page “http://my.ebay.co.uk/ws/eBayISAPI.dll?MyeBay&gbh=1&&_trksid=m38&guest=1”. The error was: “cannot decode raw data” (NSURLErrorDomain:-1015) Please choose Report Bugs to Apple from the Safari menu, note the error number, and describe what you did before you saw this message.
    This happens all the time on Ebay, but has never happened on any other website. Has anyone else run into this before? Any ideas what is the cause?
    I am using a Macbook Pro with Leopard 10.5.4.

    So, it's almost impossible to find anything on the 'net or on the Apple site regarding this problem. This puts a major cramp in my browsing activity as, in order to bookmark a page using delicious.com I would need to copy and paste everything into Firefox and go from there, bouncing back and forth between the two on a regular basis. Soooo, until then, I guess I will be giving Firefox a try.
    This is another bug that could really use some immediate attention. It's affecting eBay and delicious, for sure. Who knows what else is being affected.

  • Do you know how to decode a date?

    HI,I need to count students group by their region on each month. The output is
    COUNTRY OCT NOV DEC .....
    USA 5 20 30
    CAN 100 1 0
    MEX 10 20 30
    The date format is 5/19/2007
    This is my code: and thanks for your help
    WITH Q AS (SELECT DISTINCT A.STDID, A.NUMBER, A.ADMIT
                   FROM PROG A
                        JOIN CITIZEN B ON A.STDID = B.STDID
                        JOIN REGION_TBL C ON C.REGION = B.REGION                          
                        AND A.NUMBER = 'PS'
                        AND A.ADMIT IN ('2007','2008'))
    SELECT J.REGION, I.DESCR,
    SUM(DECODE(L.DATE, '9', 1, 0)) SEP_TOTAL,
    SUM(DECODE(L.DATE, '10', 1, 0)) OCT_TOTAL,
    SUM(DECODE(L.DATE, '11', 1, 0)) NOV_TOTAL,
    SUM(DECODE(L.DATE, '12', 1, 0)) DEC_TOTAL,
    SUM(DECODE(L.DATE, '1', 1, 0)) JAN_TOTAL,
    SUM(DECODE(L.DATE, '2', 1, 0)) FEB_TOTAL
    SUM(DECODE(L.DATE, '3', 1, 0)) MAR_TOTAL,
    SUM(DECODE(L.DATE, '4', 1, 0)) ARL_TOTAL,
    SUM(DECODE(L.DATE, '5', 1, 0)) MAY_TOTAL,
    SUM(DECODE(L.DATE, '6', 1, 0)) JUN_TOTAL,
    SUM(DECODE(L.DATE, '7', 1, 0)) JUL_TOTAL,
    SUM(DECODE(L.DATE, '8', 1, 0)) AUG_TOTAL
    FROM CITIZEN J
         JOIN PROG L ON J.STDID = L.STDID
         JOIN Q ON J.STDID = Q.STDID
         AND Q.NUMBER = J.NUMBER
    GROUP BY J.REGION, I.DESCR
    ...

    I think you have to take out the 'MM' part of the date to compare in the decode. By the way, PROG.DATE is really a column name? DATE is a reserved word.
    SQL> create table sample1(date date)
      2  /
    create table sample1(date date)
    ERROR at line 1:
    ORA-00904: : invalid identifier
    SQL> You need to use to_char() to get the month part of the date and then compare it in the DECODE.
    Cheers
    Sarma.

  • Getting the message cannot decode raw data when accessing a Joomla website.

    Getting the message cannot decode raw data when accessing a Joomla website.I can acess the homepage but cannot get on to look at any of the products. Have tried using other peoples iphones to view the same website and the same error appears works fine in a web browse or android.

    Was the other iPhone the same model, running the exact same iOS, accessing the website through the same App?
    Try using Google Chrome.  Do you still have the issue?
    Edit: Just realized you said that the other iPhone had the same issue. 
    Here's how troubleshooting works.
    Look for a single common element. 
    If two iPhones cannot connect to a particular wi-fi router (but CAN connect to other wi-fi routers, like a public one at McDonalds), does that suggest a problem with BOTH iPhones, or a problem with that wi-fi router?
    Now:
    If two iPhones cannot connect to a particular website (but CAN connect to other websites, like a public one like Google or Yahoo), does that suggest a problem with BOTH iPhones, or a problem with that wi-fi router?

  • How can I decode a data stream to jpeg image?

    Hi
    I am using the tranfered jpeg-data stream of a scanner module which I need to decode and display as an image on my vi.
    Question:
    With which method i can do that on the fly?
    or
    do I need to save the data stream (string) first to decode it afterwards with the "Read JPEG file.vi"? If so, how do I save the data in the correct way in the way that LabView can read it?
    thanks in advance
                             Norick
    Solved!
    Go to Solution.

    For Windows I use .NET to do this type of conversion without resorting to writing temporary files.  This VI will convert most formats (bmp,jpg,gif,tif) to a PNG string and then you can use the native PNG data to LV image VI.  Why they do not provide string based versions for all image formats is beyond me (idea perhaps?).
    Attachments:
    StringToImage.vi ‏33 KB

  • "cannot decode raw data" - Safari (3.1) can't open the page..

    Hi all,
    I've been experiencing continuing issues with the Safari browser (3.1). I have emptied cache and reset safari, but to no avail!
    Every time i try to load certain web pages, ie. eBay, You Tube, i receive the following message:
    +Safari can’t open the page “http://k2b-bulk.ebay.co.uk/ws/eBayISAPI.dl?MyEbaySellingActiveListings&ssPageNam e=STRK:ME:LNL”. The error was: “cannot decode raw data” (NSURLErrorDomain:-1015) Please choose Report Bugs to Apple from the Safari menu, note the error number, and describe what you did before you saw this message.+
    Has anyone else experienced similar problems? Webpages i try to load in Safari work fine in Firefox and Flock!
    Many thanks

    Yes, all of a sudden I have a very similar error trying to access www.macworld. ie Safari can’t open the page “http://www.macworld.com/”. The error was: “cannot decode raw data” (NSURLErrorDomain:-1015)
    Just started happening out of the blue! And then on one other shopping web page.
    Gavin

  • Passing serialized object and data as byte stream over same stream

    I am writing a chat program, I am keeping online user List as Vector A would like to pass online user List to client as Vector object also the client message is sended as byte stream. Is it possible to pass object and data as byte stream over the same stream.

    I am writing a chat program, I am keeping online user
    List as Vector A would like to pass online user List
    to client as Vector object also the client message is
    sended as byte stream. Is it possible to pass object
    and data as byte stream over the same stream.Why are you sending the client message as a byte stream?
    String seems a much more logical type. I would assume that you're reading strings from one client, and printing them on the others. If you translate to bytes in the middle, you're going to have to ensure that you decode those streams correctly on the other side.
    And if I were implementing this, I probably wouldn't send the raw Vector or List ... instead, I'd create a Message object, which wraps the Vector/String, and a MessageDispatcher interface, which the client implements to handle incoming messages.

Maybe you are looking for