SQL-Tokenizer based on regular-expressions does not work

I'm on 10gR2
Following SQL-Tokenizer converts string :str to rows using :delim as the delimiter-char (:str and :delim are parameters):
select level, regexp_replace(regexp_substr( :in_str || :in_delimiter, '(.*?)' || :in_delimiter, 1, level ), :in_delimiter, '') as token
from dual
connect by regexp_instr( :in_str || :in_delimiter, '(.*?)' || :in_delimiter, 1, level ) > 0
order by level asc ;
When using the pipe-symbol "|" as the delimiter, it doesn't work; the rows are processed, but the tokens are null. Using an other char as delimiter (e.g. ";") works fine.
:str = "123;456;A1;67X;0;-8" & :delim = ";" => works fine
:str = "123|456|A1|67X|0|-8" & :delim = "|" => does not work
I think the bug is in the regexp-parameter for the pattern, isn't it?
Why doesn't work the pipe-symbol as delimiter?
Can anybody give me a hint for using the correct regexp-pattern?
thx
Nuerni

select level, rtrim(regexp_substr( :in_str || :in_delimiter, '(.*?)' || :in_delimiter, 1, level ),:in_delimiter ) as token
from dual
connect by regexp_instr( :in_str || :in_delimiter, '(.*?)' || :in_delimiter, 1, level ) > 0
order by level asc ;use a rtrim instead of regexp_replace then it works...
Ravi Kumar

Similar Messages

  • Regular expression does not work in IE

    Hi,
    I'm having a regular expression which should check the content of an inputText field: it should contain a number, a character and the size should be at least 6. It's working when I test it in FireFox but it always fails to succeed in IE:
              <af:inputText>
                <af:validateRegExp pattern="^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]{6,24}$"
                                   noMatchMessageDetail="Does not match."/>
              </af:inputText>How comes it does not work in IE (6.0)?
    JDeveloper 10.1.3.3
    Thanks in advance,
    Koen Verhulst

    hi Koen
    The web page you refer to ...
    http://www.fileformat.info/tool/regex.htm
    ... seems to be doing server side Java regular expressions (and as such will behave the same in both FF and IE).
    The af:validateRegExp component you want to use does client side evaluation of the regular expression, using scripting, hence the apparent difference between FF and IE.
    There is also this web page ...
    http://www.regular-expressions.info/javascriptexample.html
    ... that seems to behave similar to the markup and scripting resulting from the af:validateRegExp component.
    Besides the value "2abcdef" there seem to be others that are accepted by IE for the regular expression "^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]{6,24}$", values like these:
    "a2abcdef", "a2abcde", "abcdef2abcde", "2a3cdef", "2a34567"
    Although these values are not accepted by IE (but are accepted in FF):
    "2abcde", "23bcdef"
    success
    Jan

  • Hi, The Airport Express does not work with iOS 7.0.4, I appreciate your help to resolve this event. Thank you,

    Hi, The Airport Express does not work with iOS 7.0.4, I appreciate your help to resolve this event. Thank you,

    Please locate the model number of the AirPort Express and post back that information.
    The model number is located on the side of the AirPort Express. It begins with an "A" followed by four numbers.
    We are not sure what you mean by "does not work".  Does this mean that the AirPort Express worked at one time and has just recently stopped working?
    Have you installed a newer operating system on your iOS device recently?
    Or, is this a new AirPort Express that you are trying to configure for the first time?
    If yes, what service will the AirPort Express perform on your network?
    Please remember that we cannot see your network, so we only know as much about your problem as you can tell us.

  • Sorting based on a parameter does not work

    Hi All
    I am using BI Publisher Reports with Siebel CRM 8.1.1.6. I have declared a parameter called "inputsort" in the CRM application as well as in the template by using <?param@begin:inputsort?> within the template. I can display the current value of the parameter using <?$inputsort?> without issues.
    However, when I try using this parameter for sorting, it doesn work:
    The report is created for a list of event attendees. When I do this, sorting works:
    <?for-each:EeventsEventCheckAttendee?><?sort:ContactLastName?>
    BUT when I do this, sorting does not work:
    <?for-each:EeventsEventCheckAttendee?><?sort:$inputsort?>
    although the parameter $inputsort does have a value of "ContactLastName".
    What could be the reason??

    never mind, I found the solution myself. For some reason, the correct way is:
    <?for-each:EeventsEventCheckAttendee?><?sort:./*[name(.) = $inputsort]?>
    I don't know why, but it works.

  • Match Regular Expression does not match what Match Pattern does

    I have read through a lot of posts about how Match Pattern does not match what Match Regular Expression will due to not processing some characters.
    However, I found a problem with the other way. A simple Reg-Ex that works in Match Pattern but not Match Regular Expression.
    What I have here is just an example. I want to use Match Regular Expression so I can specify some sub-matches.
    The reg-ex is for: one or more non-numeric characters, a space, one or more numeric characters. At the start of the string.
    How can I get this working in Match Regular Expression? I am working in LabVIEW 2010f2 32 bit. Here is the code snippet and the results:
    Rob
    Solved!
    Go to Solution.

    Robert Cole wrote:
    I think I prefer the ~ for negation since ^ is also used for beginning of the string. But we work with what we have.
    Let me offer you a tip and perhaps defend the honor of the regex a little bit.  One of my favorite features of regexes is the ability to specify character classes (and their negation).  One of the reasons I have to think about the ~ versus ^ is that I rarely use ^ in a regex alternative. 
    Some examples:
    [0-9] = \d (digit)
    [^0-9] = \D (not a digit)
    The equivalent regex for your case is: \D+ \d+

  • Regular expression does not execute runtime

    Hello adobe collegue's,
    I am currently stumbling on a strange issue regarding javascript embedded to compress a string:
    // main function to compress any string, removing all non-word characters and making the string all lowercase
    function compressString(input){
        var patt=new RegExp("\\W","g");
        patt.compile(patt);
        var output = input.toLowerCase().replace(patt,"")+"YESS";
        return output;
    Somehow this code does execute perfectly while previewing in adobe designer 9.0.0.2 but runtime all javascript does execute except for the part mentioned above.
    I know this part is executed because in the result i see the string "YESS" added to the response of this function.
    Somehow the pattern is not compiled, or executed runtime...
    I also tried more simple regular expressions but none of them actually worked.
    For the templates the option client is set where to execute the javascript, although while testing the options to solve the issue is also tried settings both and server. None provided the solution.
    Can someone provide any help...it's appreciated!
    Thanks,
    Marcel

    Hi,
    you can make your function more simple.
    function compressString(input){
              return input.toLowerCase().replace(/\W/g,"") + "YESS";

  • Regular Expression replacement not working

    I am trying to use a regular expression to replace non-ascii characters on a file, and I'm afraid I've reached the end of my regex knowledge. 
    Here is the specific code
    'Set the Regular Expression paramaters
    Set RegEx = CreateObject("VBScript.Regexp")
    RegEx.Global = True
    RegEx.Pattern = "[^\u0000-\u007F]"
    RegEx.IgnoreCase = True
    'Replace the UTF-8 characters
    ReplacedText = RegEx.Replace(FileText, "\u0020")
    If I understand regular expressions correctly the pattern of "[^\u0000-\u007F]" should replace any character that is not an ascii character, and then replace it with a space (which I understand is "\u0020").  What am I doing wrong?

    Simply use
    ReplacedText = RegEx.Replace(FileText, " ")
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • SQL Plus Bug/Question: 'COMPUTE' command does not work in script.(BUG?!)

    Good Day to ALL!
    I have a script of SQLPlus that creates a report. I have 8/9 numeric columns which are 'SUM'ed up thru 'COMPUTE' command. It works for all BUT 2 columns. If I put these two columns, compute does not take affect. If I remove these two columns ( just cut) 'COMPUTE' works fine!!! These two coulumns use DB Function. But I have other column that also use DB Function. These two columns has some extra additions. Any thing wrong with the script/column defn.
    Thanks - Pradip (Pradip Biswas @Singapore) Could you pl. reply to [email protected]
    Here is bit of script. Sorry about the length of the cut and paste.
    COLUMN OPEN_QTY_BAL           FORMAT 9,99,990          HEADING 'Opening|Qty'           Justify LEFT
    COLUMN OPEN_QTY_VALUE          FORMAT 99,999,990      HEADING 'Opening|S$'           Justify LEFT
    COLUMN PO_RECEIPTS_QTY      FORMAT 99,990          HEADING 'PO Rec|QTY '          Justify LEFT
    COLUMN PO_RECEIPTS_QTY_VALUE     FORMAT 9,999,990      Heading 'PO Rec|S$'           Justify LEFT
    COLUMN MISC_RECEIPTS_QTY     Format 99,990          Heading 'Misc |Qty'          Justify LEFT
    Column MISC_RECEIPTS_QTY_VALUE      Format 9,999,990      Heading 'Misc|S$'          Justify LEFT
    COLUMN WORKORDER_QTY           FORMAT 99,990          HEADING 'WorkOrd|Qty'          Justify LEFT
    COLUMN WorkOrder_QTY_VALUE      Format 9,999,990      HEADING 'WorkOrd|S$'          Justify LEFT
    COLUMN SALES_SHIPMENT_QTY      FOrmat 99,990          Heading 'SalesShip|Qty'          Justify LEFT
    COLUMN SALES_SHIPMENT_QTY_VALUE FOrmat 9,999,990      Heading 'SalesShip|S$'          Justify LEFT
    COLUMN MISC_ISSUE_QTY     Format 99,999          HEADing 'Misc|Qty'          Justify LEFT
    COLUMN MISC_ISSUE_QTY_VALUE Format 9,999,990 heading 'Misc|S$'          Justify LEFT
    COLUMN TRANSFER_QTY          format 99,990          heading 'Transfer|Qty'          Justify LEFT
    COLUMN TRANSFER_QTY_VALUE     format 99,999,990     heading 'Transfer|S$'          Justify LEFT
    COLUMN REVAL_VALUE Format 99,990          Heading 'Reval|S$'          Justify LEFT
    COLUMN ON_HAND_QTY           FORMAT 9,99,990      HEADING 'Closing|Qty'           Justify LEFT
    COLUMN ON_HAND_QTY_VALUE     FORMAT 99,999,999,990      HEADING 'Closing|S$'           Justify LEFT
    REPHEADER on
    REPHEADER left ' GL Period From: &&P_GL_PERIOD_NAME_FROM ' skip left ' GL Period To : &&P_GL_PERIOD_NAME_TO ' skip left ' Inv Org Code : &&P_INV_ORG_CODE ' skip left 'SubInventory Code : &&P_SUBINVENTORY_CODE ' skip 2
    TTITLE left 'H - Inv Inventory Movement Report as at:' TTITLE_DATE RIGHT 'PAGE:' FORMAT 999 SQL.PNO SKIP 2
    BTITLE skip 1 CENTER 'COMPANY CONFIDENTIAL - Printed on ' TTITLE_DATE
    BREAK on REPORT skip 1;
    --rem(1) compute SUM label 'Total' of OPEN_QTY_VALUE PO_RECEIPTS_QTY_VALUE MISC_RECEIPTS_QTY_VALUE WorkOrder_QTY_VALUE SALES_SHIPMENT_QTY_VALUE MISC_ISSUE_QTY_VALUE TRANSFER_QTY_VALUE REVAL_VALUE on report;
    --REM(2) compute SUM label 'Total $S: ' of OPEN_QTY_VALUE REVAL_VALUE on report;
    --REM(3) compute SUM label 'Total $S: ' of OPEN_QTY_VALUE REVAL_VALUE  ON_HAND_QTY_VALUE on report;
    compute SUM label 'Total $S:' of OPEN_QTY_VALUE PO_RECEIPTS_QTY_VALUE MISC_RECEIPTS_QTY_VALUE WorkOrder_QTY_VALUE SALES_SHIPMENT_QTY_VALUE MISC_ISSUE_QTY_VALUE TRANSFER_QTY_VALUE REVAL_VALUE on report;
    WHENEVER SQLERROR EXIT FAILURE
    select
    --     MSI.ORGANIZATION_ID                          ORGANIZATION_ID,
    -- MSI.INVENTORY_ITEM_ID                                   INVENTORY_ITEM_ID,
         MSI.SEGMENT1||'//'||MSI.DESCRIPTION                                   ITEM,
    -- MSI.DESCRIPTION                                             DESCRIPTION,
    All_Item_subinv.SUBINVENTORY_CODE                              SUBINVENTORY,
    MSIV.PRIMARY_UOM_CODE                                        UOM,
         --NVL(MOQ_OPen_BAL.OPEN_QTY_BAL ,0)                               OPEN_QTY_BAL ,
    -- NVL(MOQ_OPen_BAL.OPEN_QTY_BAL,0) * NVL(AVG_ITEM_COST1.ITEM_COST,0)           OPEN_QTY_VALUE,
    (MOQ_OPen_BAL( All_Item_subinv.SUBINVENTORY_CODE,
              MSI.ORGANIZATION_ID,
    MSI.INVENTORY_ITEM_ID,
    '&P_GL_PERIOD_NAME_FROM') )     OPEN_QTY_BAL ,
    (MOQ_OPen_BAL_VAL( All_Item_subinv.SUBINVENTORY_CODE,
              mSI.ORGANIZATION_ID,
    MSI.INVENTORY_ITEM_ID,
    '&P_GL_PERIOD_NAME_FROM')
         )                                             OPEN_QTY_VALUE,
    NVL(AGGREGATED_MTT.PO_RECEIPTS_QTY,0)                              PO_RECEIPTS_QTY,
         NVL(AGGREGATED_MTT.PO_RECEIPTS_QTY_VALUE,0)                          PO_RECEIPTS_QTY_VALUE,
         NVL(AGGREGATED_MTT.MISC_RECEIPTS_QTY,0)                              MISC_RECEIPTS_QTY,
         NVL(AGGREGATED_MTT.MISC_RECEIPTS_QTY_VALUE,0)                          MISC_RECEIPTS_QTY_VALUE,
         NVL(AGGREGATED_MTT.WORKORDER_QTY,0)                              WORKORDER_QTY,
         NVL(AGGREGATED_MTT.WorkOrder_QTY_VALUE,0)                          WorkOrder_QTY_VALUE,
    NVL(AGGREGATED_MTT.SALES_SHIPMENT_QTY,0)                         SALES_SHIPMENT_QTY,
         NVL(AGGREGATED_MTT.SALES_SHIPMENT_QTY_VALUE,0)                         SALES_SHIPMENT_QTY_VALUE,
         NVL(AGGREGATED_MTT.MISC_ISSUE_QTY,0)                              MISC_ISSUE_QTY,
         NVL(AGGREGATED_MTT.MISC_ISSUE_QTY_VALUE,0)                          MISC_ISSUE_QTY_VALUE,
         NVL(AGGREGATED_MTT.TRANSFER_QTY,0)                              TRANSFER_QTY,
         NVL(AGGREGATED_MTT.TRANSFER_QTY_VALUE,0)                         TRANSFER_QTY_VALUE,
         NVL(AGGREGATED_MTT.REVAL_VALUE,0)                              REVAL_VALUE,
              (MOQ_OPen_BAL(All_Item_subinv.SUBINVENTORY_CODE,
              MSI.ORGANIZATION_ID,
    MSI.INVENTORY_ITEM_ID,
    '&P_GL_PERIOD_NAME_FROM')
              +
              nvl(AGGREGATED_MTT.PO_RECEIPTS_QTY,0)      +
              nvl(AGGREGATED_MTT.MISC_RECEIPTS_QTY,0)     +
              nvl(AGGREGATED_MTT.WORKORDER_QTY,0)     +
              nvl(AGGREGATED_MTT.SALES_SHIPMENT_QTY,0)     +
              nvl(AGGREGATED_MTT.MISC_ISSUE_QTY,0)          +
              nvl(AGGREGATED_MTT.TRANSFER_QTY,0)     )                ON_HAND_QTY,
    ((MOQ_OPen_BAL_VAL( All_Item_subinv.SUBINVENTORY_CODE,MSI.ORGANIZATION_ID,MSI.INVENTORY_ITEM_ID,'&P_GL_PERIOD_NAME_FROM'))
    +(nvl( AGGREGATED_MTT.PO_RECEIPTS_QTY_VALUE,0) )     
    +(nvl( AGGREGATED_MTT.MISC_RECEIPTS_QTY_VALUE,0) )
    +(nvl( AGGREGATED_MTT.WorkOrder_QTY_VALUE,0) )
    +(nvl( AGGREGATED_MTT.sALES_SHIPMENT_QTY_VALUE,0) )
    +(nvl( AGGREGATED_MTT.MISC_ISSUE_QTY_VALUE,0) )
    +(nvl( AGGREGATED_MTT.TRANSFER_QTY_VALUE,0) )
    +nvl( AGGREGATED_MTT.REVAL_VALUE,0))                               ON_HAND_QTY_VALUE -- column alias
    FROM
    -- In line View for MSI
    (select distinct MMT.ORGANIZATION_ID, MMT.INVENTORY_ITEM_ID, MMT.SUBINVENTORY_CODE
    From MTL_MATERIAL_TRANSACTIONS      MMT,
    ORG_ORGANIZATION_DEFINITIONS      OOD,
    MTL_ONHAND_QUANTITIES moq
    where
         OOD.organization_code           = '&P_INV_ORG_CODE' --'HS' --'&P_INV_ORG_CODE'
    AND OOD.inventory_enabled_flag = 'Y'
    AND OOD.operating_unit          = fnd_profile.value('ORG_ID') --83 --fnd_profile.value('ORG_ID')
    AND OOD.SET_OF_BOOKS_ID          = fnd_profile.value('GL_SET_OF_BKS_ID') --1 --fnd_profile.value('GL_SET_OF_BKS_ID')
    AND     MMT.ORGANIZATION_ID          = OOD.organization_id
    AND MMT.SUBINVENTORY_CODE          = NVL('&P_SUBINVENTORY_CODE', MMT.SUBINVENTORY_CODE)
    and MMT.ORGANIZATION_ID      = MOQ.ORGANIZATION_ID -- to eliminate consigend items:2007Jan04:PKB
    and MMT.INVENTORY_ITEM_ID = MOQ.INVENTORY_ITEM_ID --,,
    and MMT.SUBINVENTORY_CODE = MOQ.SUBINVENTORY_CODE --,,
    UNION
    Select distinct      MOQ.ORGANIZATION_ID,      MOQ.INVENTORY_ITEM_ID,     MOQ.SUBINVENTORY_CODE
    from      MTL_ONHAND_QUANTITIES                MOQ,
         ORG_ORGANIZATION_DEFINITIONS           OOD2
    WHERE
         OOD2.organization_code           = '&P_INV_ORG_CODE' --'HS' --'&P_INV_ORG_CODE'
    AND OOD2.inventory_enabled_flag      = 'Y'
    AND OOD2.operating_unit          = fnd_profile.value('ORG_ID') --83 --fnd_profile.value('ORG_ID')
    AND OOD2.SET_OF_BOOKS_ID          = fnd_profile.value('GL_SET_OF_BKS_ID') --1 --fnd_profile.value('GL_SET_OF_BKS_ID')
    AND moq.ORGANIZATION_ID          = OOD2.organization_id
    AND moq.SUBINVENTORY_CODE          = NVL('&P_SUBINVENTORY_CODE', moq.SUBINVENTORY_CODE)
    ) ALL_Item_SUBInv,
    MTL_SYSTEM_ITEMS_B MSI,
    Mtl_System_Items_Vl MSIV,
    (SELECT
         MMT.ORGANIZATION_ID ORGANIZATION_ID,
    MMT.INVENTORY_ITEM_ID          INVENTORY_ITEM_ID,
    MMT.SUBINVENTORY_CODE          SUBINVENTORY_CODE,
    -- PO RECEIPTS.
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Purchase order')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('PO Receipt','PO Rcpt Adjust','Return to Vendor')
    THEN
                   --MMT.TRANSACTION_QUANTITY
                   mmt.primary_quantity
    ELSE 0
    END
    ELSE 0
    END ) PO_RECEIPTS_QTY,
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Purchase order')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('PO Receipt','PO Rcpt Adjust','Return to Vendor')
    THEN
                   NVL(MMT.ACTUAL_COST,0)* nvl(mmt.primary_quantity,0)
                   MMT.TRANSACTION_COST * NVL(AVG_ITEM_COST.ITEM_COST,0)
    ELSE 0
    END
    ELSE 0
    END ) PO_RECEIPTS_QTY_VALUE,
    -- MISC RECEIPTS.
    SUM( CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Account','Inventory')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Account receipt','Miscellaneous receipt')
    THEN
                   --MMT.TRANSACTION_QUANTITY
                   mmt.primary_quantity
    ELSE 0
    END
    ELSE 0
    END ) MISC_RECEIPTS_QTY,
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Account', 'Inventory')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Account receipt','Miscellaneous receipt')
    THEN
                   NVL(MMT.ACTUAL_COST,0) * nvl(mmt.primary_quantity,0)
                        MMT.TRANSACTION_COST NVL(AVG_ITEM_COST.ITEM_COST,0)
    ELSE 0
    END
    ELSE 0
    END ) MISC_RECEIPTS_QTY_VALUE,
    -- WorkOrder Qty and S$
    SUM( CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Job or Schedule')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('WIP Assembly Return','WIP Assy Completion','WIP component issue','WIP Component Return')
    THEN
                   --MMT.TRANSACTION_QUANTITY
                   mmt.primary_quantity
    ELSE 0
    END
    ELSE 0
    END ) WORKORDER_QTY,
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Job or Schedule')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('WIP Assembly Return','WIP Assy Completion','WIP component issue','WIP Component Return')
    THEN
                   NVL(MMT.ACTUAL_COST,0) * nvl(mmt.primary_quantity,0)
                        MMT.TRANSACTION_COST NVL(AVG_ITEM_COST.ITEM_COST,0)
    ELSE 0
    END
    ELSE 0
    END ) WorkOrder_QTY_VALUE,
    -- Sales Shipment
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ( 'Sales order','RMA')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Sales order issue','Sales Order Pick','RMA Return','RMA Receipt')
    THEN
                   --MMT.TRANSACTION_QUANTITY
                   mmt.primary_quantity
    ELSE 0
    END
    ELSE 0
    END ) SALES_SHIPMENT_QTY,
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ( 'Sales order','RMA')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Sales order issue','Sales Order Pick','RMA Return','RMA Receipt')
    THEN
                   NVL(MMT.ACTUAL_COST,0) * nvl(mmt.primary_quantity,0)
                   MMT.TRANSACTION_COST NVL(AVG_ITEM_COST.ITEM_COST,0)
    ELSE 0
    END
    ELSE 0
    END ) SALES_SHIPMENT_QTY_VALUE,
    -- MISC ISSUE
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Inventory','Account' )
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Miscellaneous issue','Account issue')
    THEN
                   --MMT.TRANSACTION_QUANTITY
                   mmt.primary_quantity
    ELSE 0
    END
    ELSE 0
    END ) MISC_ISSUE_QTY,
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ('Inventory','Account' )
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Miscellaneous issue','Account issue')
    THEN
                   NVL(MMT.ACTUAL_COST,0) * nvl(mmt.primary_quantity,0)
                   MMT.TRANSACTION_COST NVL(AVG_ITEM_COST.ITEM_COST,0)
    ELSE 0
    END
    ELSE 0
    END ) MISC_ISSUE_QTY_VALUE,
    -- Transfers
    SUM( CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ( 'Inventory' )
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Subinventory Transfer')
    THEN
                   --MMT.TRANSACTION_QUANTITY
                   mmt.primary_quantity
    ELSE 0
    END
    ELSE 0
    END ) TRANSFER_QTY,
    SUM( CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ( 'Inventory')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Subinventory Transfer')
    THEN      NVL(MMT.ACTUAL_COST,0) * nvl(mmt.primary_quantity,0)
                   MMT.TRANSACTION_COST NVL(AVG_ITEM_COST.ITEM_COST,0)
    ELSE 0
    END
    ELSE 0
    END ) TRANSFER_QTY_VALUE,
    -- Adjustment to Cost (Revaluation)
    SUM(CASE
         WHEN MTST.TRANSACTION_SOURCE_TYPE_NAME in
    ( 'Standard cost update','Job or Schedule')
         THEN
              CASE
              WHEN MTT.TRANSACTION_TYPE_NAME in
    ('Standard cost update','WIP cost update')
    THEN
                   --2007JAN03:PKB MMT.TRANSACTION_COST
    MMT.TRANSACTION_COST* MMT.QUANTITY_ADJUSTED
    ELSE 0
    END
    ELSE 0
    END ) REVAL_VALUE
         FROM
         MTL_MATERIAL_TRANSACTIONS                MMT,
         --GL_PERIODS                          GP,
         MTL_TRANSACTION_TYPES                MTT,
         MTL_TXN_SOURCE_TYPES                    MTST,
    ORG_ORGANIZATION_DEFINITIONS                OOD
    WHERE     
    OOD.organization_code           = '&P_INV_ORG_CODE' --'HS' --'&P_INV_ORG_CODE'
    AND OOD.inventory_enabled_flag = 'Y'
    AND OOD.operating_unit          = fnd_profile.value('ORG_ID') --83 --fnd_profile.value('ORG_ID')
    AND OOD.SET_OF_BOOKS_ID          = fnd_profile.value('GL_SET_OF_BKS_ID') --1 --fnd_profile.value('GL_SET_OF_BKS_ID')
    AND     MMT.ORGANIZATION_ID          = OOD.organization_id
    AND MMT.SUBINVENTORY_CODE          = NVL('&P_SUBINVENTORY_CODE', MMT.SUBINVENTORY_CODE)
    -- AND GP.PERIOD_SET_NAME          = 'HF-ACCTG-CAL' -- Hardcoded PKB
    AND
         (     (EXISTS
         ( select GP.Period_name
    FROM GL_PERIODS GP
    where TO_DATE(TO_CHAR(MMT.TRANSACTION_DATE,'DD-MM-YYYY'),'DD-MM-YYYY')
                   >= TO_DATE(TO_CHAR(GP.START_DATE,'DD-MM-YYYY'),'DD-MM-YYYY') --Between GP.START_DATE and GP.END_DATE
         AND GP.PERIOD_NAME      = '&P_GL_PERIOD_NAME_FROM'
              and GP.PERIOD_SET_NAME          = 'HF-ACCTG-CAL'
    AND NVL('&P_GL_PERIOD_NAME_FROM','ALL')      != 'ALL'
    OR (NVL('&P_GL_PERIOD_NAME_FROM' ,'ALL')               = 'ALL')
    AND
         (     (EXISTS
         ( select GP.Period_name
    FROM GL_PERIODS GP
    where TO_DATE(TO_CHAR(MMT.TRANSACTION_DATE,'DD-MM-YYYY'),'DD-MM-YYYY')
                   <= TO_DATE(TO_CHAR(GP.END_DATE,'DD-MM-YYYY'),'DD-MM-YYYY')
         AND GP.PERIOD_NAME      = '&P_GL_PERIOD_NAME_TO'
              and GP.PERIOD_SET_NAME          = 'HF-ACCTG-CAL'
    AND NVL('&P_GL_PERIOD_NAME_TO','ALL')      != 'ALL'
    OR (NVL('&P_GL_PERIOD_NAME_TO','ALL')               = 'ALL')
    AND MMT.TRANSACTION_TYPE_ID          = MTT.TRANSACTION_TYPE_ID
    AND MMT.TRANSACTION_SOURCE_TYPE_ID          = MTST.TRANSACTION_SOURCE_TYPE_ID
    group by
         MMT.ORGANIZATION_ID,
    MMT.INVENTORY_ITEM_ID,
    MMT.SUBINVENTORY_CODE
    )                    AGGREGATED_MTT,
    -- Inline Table for AVG_ITEM_COSTs 2nd time,
    (SELECT
         CIC.ORGANIZATION_ID     ORGANIZATION_ID,
    CIC.INVENTORY_ITEM_ID INVENTORY_ITEM_ID,
    CIC.COST_TYPE_ID COST_TYPE_ID,
    CCT.COST_TYPE     COST_TYPE,
    NVL(CIC.ITEM_COST ,0) ITEM_COST
    FROM
         CST_ITEM_COSTS           CIC,
         CST_COST_TYPES           ccT,
    ORG_ORGANIZATION_DEFINITIONS                OOD1
    WHERE
         CCT.COST_TYPE_ID           = CIC.COST_TYPE_ID
         /*AND (
         (CCT.COST_TYPE          = 'Average' and '&P_INV_ORG_CODE' = 'HS')
              OR
    (CCT.COST_TYPE          = 'Frozen' and '&P_INV_ORG_CODE' = 'HL')
    AND CCT.COST_TYPE_ID =
              ( select      m.primary_cost_method
              from      mtl_parameters m
    where      m.organization_id      = OOD1.ORGANIZATION_ID
         and OOD1.organization_code      = '&P_INV_ORG_CODE' --'HS' --'&P_INV_ORG_CODE'
         AND OOD1.inventory_enabled_flag = 'Y'
         AND OOD1.operating_unit          = fnd_profile.value('ORG_ID') 83 --fnd_profile.value('ORG_ID')
         AND OOD1.SET_OF_BOOKS_ID     = fnd_profile.value('GL_SET_OF_BKS_ID') 1 --fnd_profile.value('GL_SET_OF_BKS_ID')
         AND cic.ORGANIZATION_ID          = OOD1.organization_id
         )                               AVG_ITEM_COST1
    WHERE
    AGGREGATED_MTT.ORGANIZATION_ID(+)          = All_Item_subinv.ORGANIZATION_ID
    AND AGGREGATED_MTT.INVENTORY_ITEM_ID(+) = All_Item_subinv.INVENTORY_ITEM_ID
    AND AGGREGATED_MTT.subinventory_code(+)     = All_Item_subinv.subinventory_code
    AND All_Item_subinv.ORGANIZATION_ID          = MSI.ORGANIZATION_ID
    AND ALL_Item_SUBInv.INVENTORY_ITEM_ID          = MSI.INVENTORY_ITEM_ID
    AND AVG_ITEM_COST1.ORGANIZATION_ID(+)     = MSI.ORGANIZATION_ID
    AND AVG_ITEM_COST1.INVENTORY_ITEM_ID(+)      = MSI.INVENTORY_ITEM_ID
    and msi.ROWID                         = MSIV.ROW_ID
    and msi.ORGANIZATION_ID                    = fnd_profile.value('ORG_ID') --83 --fnd_profile.value('ORG_ID')
    and sysdate between NVL(msi.start_date_active,sysdate -1 )
    and NVL(msi.end_date_active,sysdate+1)
    Order BY
         MSI.SEGMENT1,
    MSI.DESCRIPTION     ,
    All_Item_subinv.SUBINVENTORY_CODE
    /

    Hi Barry and All: This indeed is a bug in SQLPLUS ! Version 9.2.0.1.0 as well.
    Thanks for asking the version no of SQLLPLUs. I was working thru Oracle Apps 11i.10 (concurrent program). So I did not get any message from SQLPLUS.
    I tested independently in SQLPLUS and got the message! Thanks Oracle!!!
    The Bug is in the name of COLUMN NAME or ALIAS Name. I renamed the columns from ON_HAND_QTY and ON_HAND_VALUE to CLOSE_QTY and CLOSE_QTY_VALUE. It worked!! The string 'ON' in the column/alias name is taken as 'ON' keyword/clause for 'compute' statement for SQLPLUS.
    Here is the message from SQLPLUS
    " SP2-0084: COMPUTE ON keyword specified already"
    See these two line and compare
    --compute SUM label 'Total $S: ' of SALARY ON_SALARY  on report;
    compute SUM label 'Total $S: ' of SALARY on report;
    Thanks - Pradip
    Here is the sample code to simulate. (not Big :))
    WHENEVER SQLERROR EXIT FAILURE
    CLEAR computes
    CLEAR BREAKS
    clear column
    TTITLE OFF
    BTITLE OFF
    set verify off
    set feedback off
    set echo off
    set heading off
    set termout off
    set linesize 203
    set pagesize 30
    set termout on
    SET UNDERLINE =
    set heading on
    COLUMN SALARY               FORMAT 9,999,990      Heading 'SALARY'           
    COLUMN ON_SALARY          format 9,999,990 Heading 'ON Salary'
    column ENAME format a20 heading 'NAME'
    COLUMN EMPNO Format 99999 HEADING 'EMPNO'
    BREAK on REPORT skip 3;
    --compute SUM label 'Total $S: ' of SALARY ON_SALARY  on report;
    compute SUM label 'Total $S: ' of SALARY on report;
    WHENEVER SQLERROR EXIT FAILURE
    select empno, ename, sal SALARY, sal ON_SALARY from scott.emp;

  • SSRS 2008 Gauge ToolTips - expression does not work?

    Hi,
    I'm attempting to use various SSRS 2008 gauges in a report.  When I attempt to use an expression in a tooltip such as '=Sum(Fields!ID.Value)' , the tooltip does not show up.
    However if I replace that expression with a static value such as '1' it pops up.
    It seems that an expression should work?  Any reason that it would not?
    Thanks

    Hi,
    I could reproduce the scenario you posted.
    It is caused that string type is required for the
    ToolTip property of the Gauge Pointer. So, please change the expression to
    =CStr(Sum(Fields!ID.Value)).
    If you have any question, please feel free to ask.
    Thanks,
    Tony Chain
    Tony Chain [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Why my older Airport Express does not work with OS-X 10.9?

    After getting my new iMac and upgrading to Marveric, I can not get my older AirPort Express work. Why?

    Mavericks does not support the older "b/g" wireless versions of the AirPorts, only the newer "n" wireless versions.
    You can use another Mac running Leopard or Snow Leopard, or a PC to administer the older AirPort Express.

  • Help Needed: Airport Express does not work

    My Airport Express was ok until one day I setup it under bridge mode in a hotel room. Now neither my iMac and Dell laptop can update the settings in the Airport Express. It always shows error in reading the settings.
    I have tried soft, hard reset and also tried to bring it back to factory settings. However, all these trials were not successful. It did not even blink with green light when I tried to reset it to factory settings (hold the reset pin, plug in power socket and then release the pin... I believe I did it right).
    Also the network name I created in this Airport Express did not change to default name. The Airport Express name was restored to default though.
    Does anyone know how to fix this? Do I have to send the hardware to Apple to fix it or it is just a software failure that I can fix at home with you guys help?
    Thanks!

    Same problem here -- followed instructions to do factory reset to a "T", never saw blinking green LED. Instead led blinks yellow. Always get an error in Airport Utility.
    Apple had best quit poking fun at how lousy Microsoft stuff is before someone sees the large number of product complaints logged in the forums. It isn't smart to toss stones in a glass house.

  • One SQL/PLSQL query out of several does not work

    I have a report with search filters and most of the search fields are text fields. I have no problem searching by these fields until i add in a select list to search by. Once i apply the select list filter(:P21_COUNTY), it displays the correct information but then all the text fields stop displaying the correct info. Does it work differently if using a select list vs. other field types? Thanks, Deanna
    There is a sample app on apex.oracle.com
    Workspace:DEANNA2
    Username:[email protected]
    Password:Dclipse03
    Page 21
    Login:[email protected]
    Password:Dclipse03

    Looks like a Application express Question
    Post it [Here | http://forums.oracle.com/forums/forum.jspa?forumID=137]
    SS

  • Complex JDOQL expression does not work. Or maybe I'm doing something stupid?

    Hi!
    I have several related objects: Customer, Contract and AccessKey.
    Each Customer has 1-to-many relationship with Contracts (so it can have
    several contracts) and each Contract has 1-to-many relationship with
    AccessKeys (so that contract can have several access keys).
    I'm trying to obtain customer by property of access key using the
    following code:
    Query q = pm.newQuery(Customer.class, "contracts.contains(c) && " +
    "c.accessKeys.contains(a) && " +
    "a.pinCode == pin";
    q.declareParameters("String pin");
    q.declareVariables("Contract c");
    q.declareVariables("AccessKey a");
    Collection result = (Collection) q.execute("123");
    All these objects (Customer, Contract and AccessKey) are
    PersistenceCapable and located in the same package.
    In result I get the following exception:
    javax.jdo.JDOUserException: The field "c" of type "class
    net.xtrim.crm.customer.object.Customer" does not exist or is not persistent.
         at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.getExpression(JDBCQuery.java:181)
         at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:787)
         at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
         at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:609)
    What's wrong with such query? Maybe the problem is that I'm trying to
    navigate through the field of the object obtained from the collection of
    source object?
    Thank you in advance.
    Best regards,
    Alexey Maslov

    Variable and Parameter declarations are a one-time deal:
    // note the ; seperator
    q.declareVariables ("Contract c; AccessKey a");
    // note the , separator
    q.declareParameters ("String pin, String forExample");
    So when you declare the access key variable, the query "forgets" about
    c, and expects it to be a field, and no longer a variable.
    Hope that solves your problem!
    Alexey Maslov wrote:
    Hi!
    I have several related objects: Customer, Contract and AccessKey. Each
    Customer has 1-to-many relationship with Contracts (so it can have
    several contracts) and each Contract has 1-to-many relationship with
    AccessKeys (so that contract can have several access keys).
    I'm trying to obtain customer by property of access key using the
    following code:
    Query q = pm.newQuery(Customer.class, "contracts.contains(c) && " +
    "c.accessKeys.contains(a) && " +
    "a.pinCode == pin";
    q.declareParameters("String pin");
    q.declareVariables("Contract c");
    q.declareVariables("AccessKey a");
    Collection result = (Collection) q.execute("123");
    All these objects (Customer, Contract and AccessKey) are
    PersistenceCapable and located in the same package.
    In result I get the following exception:
    javax.jdo.JDOUserException: The field "c" of type "class
    net.xtrim.crm.customer.object.Customer" does not exist or is not
    persistent.
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.getExpression(JDBCQuery.java:181)
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:787)
    at
    com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:609)
    What's wrong with such query? Maybe the problem is that I'm trying to
    navigate through the field of the object obtained from the collection of
    source object?
    Thank you in advance.
    Best regards,
    Alexey Maslov
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Regular speaker does not work but speaker phone does?

    I have a Iphone 3G that the regular speaker has quit working on but the speakerphone works fine? What could be wrong with my phone and can I fix it? Or how can I diagnose the problem?

    try plugging your headphones into the headphone jack a the top of your phone,mine did that and i was calling apple and my husband found online that they get dust in them sometimes and need to be cleaned out,so try that,even the guy from apple said the same thing,let me know

  • Bussines Hours shedule in unity express does not work properly

    Hi,
    End user has a unity express 8.0.5 version. I created an script with Editor Express where I defined a Bussines Hours Shedule.
    I have noticed that sometimes the main menu prompts is played eventhough is not a working hours.Other times Bussiness Closed promts is played correctly but after it the main menu prompt is played (I expected to finish the script when the Bussiness Closed prompt is played).
    I have checked several times but the problems remains, I do not know why. I attach the screen shot of script.
    regards

    You can ask advice at this forum.
    *http://stackoverflow.com/questions/
    It looks that the code that calculates the menu width and position isn't triggered unless you resize the window (changing the width 1px by dragging the border or zooming the page works), so the menu flyout still has the default setting.
    I see:
    <pre><nowiki><ul style="width: 51px; left: 1100px; display: none;" class="sub-container flmenu">
    </nowiki></pre>
    After a resize this changes to:
    <pre><nowiki><ul style="width: 898px; left: 252px; display: none;" class="sub-container flmenu">
    </nowiki></pre>
    I don't know how this onresize event ($(window).on('resize', function()) would have to be triggered to initialize the menu properly.

Maybe you are looking for

  • Table Maintenance(SM30) not working for a custom View..

    Hi, I have the below case which is not working at the moment. we have standard table T024 and the requirement is to update the table directly in production. To update the standard table i have created a custom maintenance view on this table and creat

  • New Mac Mini Running Fine-Mavericks 10.9.5

    I am an Apple convert from Microsoft. Giving up Windows after years of the gut wrenching abuse over the years of XP only to have Microsoft kill it. That being said and out of the way. I find my old school computer self coming from the 4 color Amiga D

  • Can we Change the backround color of an Input field in Webdynpro for ABAP.

    Hi Experts ? Can we change the background color of an Input field in WebDynpro for ABAP based on results we receive from any function module or BAPI?? . Thanks in advance . Regards , LAS

  • Rework Order Problem

    Hi Experts, Please suggest me for the following problem: 1. I have created Rework order (settlement rule against parent order) 2. Confirmed the Rework order 3. GR done for the Parent order (MB31) Here the Parent production order quantity is getting r

  • Could i get some help with this one

    the aim of this project is to make a n by n maze and traverse this. if, while traversing the maze the system realises that there is a dead end it turns back. My problem is that sometimes it turns back and sometimes it doesnt. Here, below is the metho