Help with CASE ORDER BY...

Need to use a CASE in my order by..similiar to sql server syntax. It works fine in sql server but am getting strange errors in oracle.
Can someone look at my sql order:
CREATE OR REPLACE PROCEDURE RSP_RELEASE_TASKS_BY_WEEK
     IN_SUBJECT IN varchar2 :=NULL,
     IN_AUTHOR IN varchar2 :=NULL,
     IN_PROJECTNAME IN varchar2 :=NULL,
     IN_CATEGORY varchar2 :=NULL,
     IN_STARTDATE date :=NULL,
     IN_ENDDATE date :=NULL,
     p_cursor out types.sqlcur
AS
BEGIN
SELECT       
          To_Char(pt.EXPECTED_START_DATE, 'ww') AS WEEKNUMB,
          pt.TEXT_29,
          COUNT(pt.TEXT_29) as CountOfTask
FROM
          PROJ_TASK pt
INNER JOIN
          PROJECT p ON
               p.PROJECTID=pt.PROJECTID
WHERE
(pt.EXPECTED_START_DATE BETWEEN IN_STARTDATE AND IN_ENDDATE OR IN_STARTDATE IS NULL)
AND (p.SUBJECT = IN_SUBJECT OR IN_SUBJECT IS NULL OR IN_SUBJECT='All')
AND (p.AUTHOR = IN_AUTHOR OR IN_AUTHOR IS NULL OR IN_AUTHOR='All')
AND (p.PROJECTNAME = IN_PROJECTNAME OR IN_PROJECTNAME IS NULL OR IN_PROJECTNAME='All')
AND (IN_CATEGORY IS NULL OR p.CATEGORY = IN_CATEGORY OR IN_CATEGORY='All')
AND (pt.TASK_TYPE = 0)
AND (pt.TASK_STATUS <> 2)
AND (p.PROJECT_TYPE = 2) 
AND
     pt.TEXT_29= 'RLL-M' OR
     pt.TEXT_29='RXLL' OR
     pt.TEXT_29='RLL-E' OR
     pt.TEXT_29='BOM-E' OR
     pt.TEXT_29='RLL-F' OR
     pt.TEXT_29='R-GM' OR
     pt.TEXT_29='BOM-F' OR
     pt.TEXT_29 = 'BOM-M' OR
     pt.TEXT_29 = 'REC' OR
     pt.TEXT_29= 'S-BOM-M' OR
     pt.TEXT_29='S-BOM-E' OR
     pt.TEXT_29='S-REC'
AND      pt.TASK_STATUS <> 2
GROUP BY 
     To_Char(pt.EXPECTED_START_DATE, 'ww'), pt.TEXT_29;
ORDER BY
     CASE
          WHEN pt.TEXT_29 = 'BOM-E' THEN 'a'
          WHEN pt.TEXT_29 = 'BOM-M' THEN 'b'
          WHEN pt.TEXT_29 = 'BOM-F' THEN 'c'
          WHEN pt.TEXT_29 = 'R-GM' THEN 'd'
          WHEN pt.TEXT_29 = 'RLL-E' THEN 'e'
          WHEN pt.TEXT_29 = 'RLL-F' THEN 'f'
          WHEN pt.TEXT_29 = 'RLL-M' THEN 'g'
          WHEN pt.TEXT_29 = 'RXLL' THEN 'h'
          WHEN pt.TEXT_29 =  'REC' THEN 'i'
          WHEN pt.TEXT_29 = 'S-BOM-M' THEN 'j'
          WHEN pt.TEXT_29 = 'S-BOM-E' THEN 'k'
          WHEN pt.TEXT_29 = 'S-REC' THEN 'l'
     END, To_Char(pt.EXPECTED_START_DATE, 'ww'), pt.TEXT_29;
END;
/Thanks,
Jon

Those errors are strange, I have never seen invisible errors before.
In theory case in order by works
SQL> select * from dual
  2  order by case when 1 = 1 then 'a'
  3           when 1 = 2 then 'b' end;
D
X

Similar Messages

  • Help with an order form

    I'm a newbie to javascript and need help with the simplest way to create an order form.  The fields required are Order No., Description, Unit, Price, Quantity and Total.  The user would enter an order number which would automatically complete the Description, Unit and Price fields.  I have 448 products on the order form.
    Product used:
    Adobe Livecycle Designer ES in Adobe Professional 9 

    Hi,
    There are a few things to consider first:
    Where is the data coming from? Will the form connect to a database?
    Is the data in an XML file?
    Will it be OK to hard wire the data into the form? This is harder to maintain.
    448 is a lot of codes for the user to process. Can these be split into groups, so that one dropdown with 10 options, would populate second with say 40 options.
    What you are looking for is possible, but will require some scripting to get it to work and will probably require maintenance going forward.
    Maybe a bit more info would help,
    Niall
    Steve has a solution for you ;-)

  • LSMW - Need help with Sales Order (Modification VA01)

    Hi,
    I need help with an LSMW for Sales Order (VA01).
    I need to do the following:
    1. Copy the Standard Sales Order LSMW
    2. They (users) would like to be able to pick the batch (lot) from the sales order.
    3. Also, they would like to have functionality, where from the list of Sales Order numbers, they would be able to switch one part number for another.
    Please help with the above 3 needs.
    Thanks,
    Laura

    Hi
    Run transaction SE38, insert your program (RVINVB10), select DOCUMENTATION option and press display
    Just only you need to consider the BDC program needs to read afile with all informations to create a sales order, so you have to create a program to prepare a file arraged as RVINVB10 needs, the documentaion explains how the file has to be created.
    Max

  • Help with CASE MANAGEMENT

    Hi Experts,
    I am working with Case Management, and I have to create Cases with all its specifications automatically. Anybody knows how I can create it? or Anybody have any suggestion or documentation to start with this.
    Thanks in advance.
    Regards,
    Beatriz.

    Hi,
    Easy transaction to Case Management customizing is SCASE_CUSTOMIZING. There you have an overview of the customizing of case management.
    Also carryon these steps one by one...
    Case Management Basic Settings :
    Define Number Range Intervals for Case
    Define Case Types
    Determine Permitted values for attribute
    Create values for "Category" attribute
    Create values for "Cause" attributes
    Create values for "Priority" attribute
    Create values for "Reason" for escalation attribute
    Assign escalation reasons to an attribute profile
    Create values for "Authorization level" attribute
    System Modifications
    Create status profile
    Create Text profile
    Create Text Ids
    Create Text Profile
    Define Logical system for external objects
    Enhanced System modifications
    Note About Enhanced System Modifications
    Define Processes
    Set up registry
    Create/Change Case Record Model
    Create Profiles
    Create attribute profile
    Create function profile
    Create terminology profile
    Create Activities for authorization check
    Activate application log
    Define processes
    Create/Change Case Record Model
    When u open the Transaction SCASE_CUSTOMIZING , there will be Registry Steps...
    Follow them step by step.
    For any queries reply.
    Regards,
    Eswari.

  • SQL query help with CASE

    Hi All,
    I have 2 tables like below. now i have a requirement which i need to do it in CASE OR DECODE. because i have to implement this logic IN SELECT STATEMENT for a column.
    In table T1 if Lang = 1 and State = 'P' then display Lang = 'english' in table T2(which is Lang=2 in table T1) Or else display null.
    Can we do this logic using CASE or DECODE? pls help
    T1
    Lang  State
    1      P
    2      N
    T2
    Lang  Dscr
    1     central
    2     english

    Something like this ?
    SQL> ed
    Wrote file afiedt.buf
      1  WITH t1 AS (SELECT 1 lang, 'P' STATE FROM DUAL UNION ALL
      2              SELECT 2 lang, 'N' STATE FROM DUAL
      3             )
      4     , t2 AS (SELECT 1 lang, 'central' dscr FROM DUAL UNION ALL
      5              SELECT 2 lang, 'english' dscr FROM DUAL
      6             )
      7  SELECT t1.lang,t1.state,CASE
      8           WHEN t1.lang=1 AND t1.state='P'
      9           THEN (SELECT t2.lang FROM t2 WHERE dscr='english')
    10           ELSE NULL
    11           END "lang"
    12* FROM t1
    SQL> /
          LANG S       lang
             1 P          2
             2 N

  • Still need help with case sensitive strings

    Hello guy! Sorry to trouble you with the same problem again,
    but i still need help!
    "I am trying to create a scrypt that will compare a String
    with an editable text that the user should type to match that
    String. I was able to do that, but the problem is that is not case
    sensitive, even with the adobe help telling me that strings are
    case sensitive. Do you guys know how to make that comparison match
    only if all the field has the right upper and lower case letters?
    on exitframe
    if field "t:texto1" = "Residencial Serra Verde"then
    go to next
    end if
    end
    |----> thats the one Im using!"
    There were 2 replys but both of them didnt work, and the
    second one even made the director crash, corrupting even previously
    files that had nothing to do with the initial problem..
    first solution given --
    If you put each item that you are comparing into a list, it
    magically
    makes it case sensitive. Just put list brackets around each
    item.
    on exitframe
    if [field "t:texto1"] = ["Residencial Serra Verde"] then
    go to next
    end if
    end
    Second solution given--
    The = operator is not case-sensitive when used on strings,
    but the < and > operators are case-sensitive.
    So another way to do this is to check if the string is
    neither greater than nor less than the target string:
    vExpected = "Residencial Serra Verde"
    vInput = field "t:texto 1"
    if vExpected < vInput then
    -- ignore
    else if vExpected > vInput then
    -- ignore
    else
    -- vExpected is a case-sensitive match for vInput
    go next
    end if
    So any new solutions??
    Thanks in advance!!
    joao rsm

    The first solution does in fact work and is probably the most
    efficient way
    of doing it. You can verify that it works by starting with a
    new director
    movie and adding a field named "t:texto1" into the cast with
    the text
    "Residencial Serra Verde" in the field. Next type the
    following command in
    the message window and press Enter
    put [field "t:texto1"] = ["Residencial Serra Verde"]
    You will see it return 1 which means True. Next, make the R
    in the field
    lower case and execute the command in the message window, it
    will return 0
    (true).
    Now that you know this works, you need to dig deeper in your
    code to find
    what the problem is. Any more info you can supply?

  • HELP WITH MY ORDER

    I ordered my iphone6+ 64 Gig in Grey on October 5th it told me i would have a ship date of October 14th.. It still shows its processing.. Can you help me out with this please.
    My ORder Number is (removed)
    >> Edited to comply with the Verizon Wireless Terms of Service <<
    Message was edited by: Verizon Moderator

        No worries, K.Dale!
    We know everyone is super exited about these amazing phones. As your order moves through the process, you can check the status at http://bit.ly/RjmCUB. You may not be able to see a change from Processing until it officially ships, then you'll see the tracking number. If you've received a confirmation email that your order was submitted, any additional information throughout the fulfillment process will be sent to that same email address.
    TanishaS1_VZW
    Follow us on Twitter @VZWSupport

  • Help with Sales Order

    Hi i am a new developer in abap, i need to load a massive information of sales order, wit the nexts fields:
    VBAK-AUART
    VBAK-VKORG
    VBAK-VTWEG
    VBAK-SPART
    KUAGV-KUNNR
    KVWEG-KUNNR
    VBKD-BSTKD
    VBKD-BSTDK
    RV45A-MABNR
    RV45A-KWMENG
    KOMV-KSCHL
    KOMV-KBETR
    my leeder recommends me use the Program RVINVB10, but i never used it before and i dont know how to, could some one help me?
    Moderator Message: Please take a classroom training first. This is not a training forum. A basic knowledge level is required.
    Edited by: kishan P on Nov 8, 2010 9:34 AM

    Hi
    Run transaction SE38, insert your program (RVINVB10), select DOCUMENTATION option and press display
    Just only you need to consider the BDC program needs to read afile with all informations to create a sales order, so you have to create a program to prepare a file arraged as RVINVB10 needs, the documentaion explains how the file has to be created.
    Max

  • Help with Move order

    Hello,
    Please help me with a query that presents the history of move order
    thanks

    Seems its related to Oracle Applications E-Business Suite issue. Please post it in Oracle Applications E-Business Suite General Discussion forums.
    If you have access to Apps, you can find view name by clicking on HELP-> Record History in Move Order history screen.
    Cheers,
    Suri

  • Help with CASE

    Hello people.
    TABLE PHONECALLS FIELDS: EMP_ID, TELNO, COST, TYPE
    TYPE can be DATA or VOICE
    1 EMP_ID owns more than 1 TELNO
    I need a report with the following columns:
    EMP_ID, TELNO, VOICE_COST, DATA_COST
    I need something like:
    SELECT EMP_ID , TELNO, SUM(COST),
    SUM(CASE COST WHEN TYPE = DATE THEN ...... END) AS VOICE,
    SUM(CASE COST WHEN TYPE = VOICE ...... END) AS DATA
    FROM PHONECALLS
    GROUP BY EMP_ID, TELNO
    ORDER BY EMP_ID ASC;Thank you in advance.

    Something like this?
    SELECT EMP_ID , TELNO, SUM(COST),
    SUM(CASE TYPE WHEN 'DATE' THEN COST END) AS VOICE,
    SUM(CASE TYPE WHEN 'VOICE' THEN COST END) AS DATA
    FROM PHONECALLS
    GROUP BY EMP_ID, TELNO
    ORDER BY EMP_ID ASC;Or the alternative way of using CASE:
    SELECT EMP_ID , TELNO, SUM(COST),
    SUM(CASE WHEN TYPE = 'DATE' THEN COST END) AS VOICE,
    SUM(CASE WHEN TYPE = 'VOICE' THEN COST END) AS DATA
    FROM PHONECALLS
    GROUP BY EMP_ID, TELNO
    ORDER BY EMP_ID ASC;The first use of CASE is simple - the other can have as complex expressions as needed ;-)

  • Help with case suggestion

    I need the searching power of the Apple Community, for my efforts have produced few results!
    I was a blackberry user (the 8310 Curve) and I really liked the case I had. Leather case, magnetic strap, swivel clip and I was able to pull the phone out whenever I needed to.
    I am trying to find something similar if not exactly like this for the iphone. Slim is nice, but I really want that swivel clip so that I can angle the case and pull out the phone whenever i need too. (I see some cases have a strap overtop)
    Any suggestions are greatly appreciated.

    It depends on your budget. I plumped for one of these http://www.vajacases.com/ as i've had them in the past and the quality is top notch. However, I couldn't decide between two different ones so I also went with one of these as well and i'll chop & change as & when I feel like a change. I couldn't resist as they look so cool http://www.miniot.com/miniot/index.htm
    I also like the blackberry cases, however, i've found that the belt clip doesn't last all that long. One has broken on me and the second one is on it's way out now. The first option from vaja sounds more like what you are looking for though. Hope this helps.

  • Need help with case.

    Hi,
    I have spent since Sunday playing phone tag in regrades to my case. I called yesterday and explaned everything about my case to a supervisior and was told it would be handled and I would receive points to my account for $25.00. I was not given a case number, but was told it was put into the system. So far, nothing was been resolved. I am losing faith and patience in this and need some help.
    Thanks
    Chris

    Hello Seminole30-
    Welcome to Best Buy Unboxed! We appreciate your patience in receiving the point adjustment on your MyBestBuy account.
    Using the email address you used to register onto the forum, I was able to find the pending fund. It looks like everything is in order and your fund is being processed accordingly. To the best of my knowledge, a fund can take up to 5 business days after the fund was issued to reflect on your MyBestBuy account.
    Thank you for your time,
    Karina|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Need help with case cracking - Defect?

    I have a macbook (white) a1181 that I purchased in 2008...
    I handle my computers very delicatly and if they travel with me, they are packed very well with support...
    The body (case) of the laptop back by the fan underneath has a long hairline crack.
    There is also one where the front lip is as well.
    NOW,
    Apple Genius Bar wants ME to pay outright to get it fixed.
    It was not my fault at all!!!!! And it was not accidental damage either.
    SO I called Apple who wouldn't help me because I don't have phone support Or apple care. So if I pay the $50 for phone support, they'll tell me the same thing they told me in the store the operator told me.
    FIRST OFF, I didn't know that my Apple Care expired and even if I had it, it wouldn't really help me I was told...
    I paid so much money for this laptop and scrimped and saved up and I feel like I'm being dragged through the mud.
    I need to contact someone higher-up ASAP - this is absolutely ridiculous.
    I did not do anything to cause this cracking..
    I am so upset as I really saved up for years for this computer only for 3-4 years later for it to be cracking worse and worse. I paid so much...
    Any advice or help would be greatly appreciated.
    Thanks,
    aj

    ajsonnick wrote:
    I need to contact someone higher-up ASAP - this is absolutely ridiculous.
    Did you ask to speak to a manager while you were at the Apple store?

  • Help with purchase order detail

    Hello Experts,
    I am currently trying to get information on a purchase order, but not having any luck.  I need to find the PO Number, and PO Approval Date.  I cannot find either of these.  I have tried using BBP_PD_PO_GETDETAIL, but have no luck with this.  here is what I have:
    move w_result-sc_guid TO lv_guid.
            CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
             EXPORTING
               I_GUID                           = lv_guid
               I_OBJECT_ID                      = w_zwkflw_rep-object_id
               I_WITH_ITEMDATA                  = 'X'
               I_READ_FROM_ARCHIVE              = 'X'
             IMPORTING
               E_HEADER                         = ls_e_header
             TABLES
               E_ITEM                           = lt_e_item
    All I have available is shopping cart number.  Can anyone assist please?  Thank you.

    hi,
    try below steps to retrieve purchase order details from a shopping cart.
    get the purchase order GUID in ET_HEADER_REL parameter of BBP_PD_SC_GETDETAIL fm using the shopping cart number or GUID.
    then to get the purchase order details, use BBP_PD_PO_GETDETAIL importing I_GUID = purchase order GUID from ET_HEADER_REL.
    regards.

  • Help with purchase order

    hie all, i have a problem with a custom purchase order. The item text  for a line item is over shadowing the line item, they are sitting on top of each other.. how ever if i comment out the item text the line item is displayed properly. the Item text is attached to the last line item on the order. please help

    Hi,
    increase line spacing in your smartstyles instead of null of that paragraph format.
    Thanks,
    Sree.

Maybe you are looking for

  • Running reports on Flat file schemas when OBIEE server is on Unix

    Hello we would like to know how Unix OBIEE work with flat file. Currently, in our environment our Development and Production OBIEE are running on Unix AIX machine while our local OBIEE environment is on Windows. As our devolepment and configuration g

  • Can no longer update computer (network error)

    So I may or may not have been on a questionable site looking for some app add on's for my ipad and I may or may not have gotten a disease. Since being on these unnamed sites Im unable to update my computer in anyway, or connect to the app store. I ge

  • Rounded/curved edge/corner in page window frame/box of SAPscript

    Hello, Can anyone tell me whether SAP ECC6.0 has any functionality which allows a page window frame/box within a SAPscript form to have rounded/curved corners for the rectangular shape?. I have reviewed various documentation and forum posts, sap note

  • 24 points for a single answer

    Hi SDN team, i can't stop complaining about getting more than 10 points for a single answer Please have a look at this Re: Inexisting BAPI_FLIGHT_GETLIST in our SAP system IDES. There are 4 * 6 points rewarded, which is nice, but not correct at all.

  • Battery Life-Dead when not used

    I have noticed that if I do not use my ipod for about 2 days, the battery will die even if it is fully charged. I know for a fact that it is not being turned on. is anybody else having this problem? do i need to return it?