Help in search query for schema

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE     10.2.0.4.0     Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
  I want to get all function name whoes text having  string like  "prm_fn_xyz ( sss , 'O' , rrrr )
   here xvz is not fixed means we can user "%"  for this xyz  , only prm_fn_ is fixed
   and   parameter of this function  (prm_fn_)  should contain atleast capital  "O"
thanx

prm_fn_xyz ( sss , 'O' , rrrr )If this is a procedure and is not used dynimically in the code you can query the user_dependencies.
select *
  from user_dependencies
where referenced_name like 'PRM/_FN/_%' escape '/'

Similar Messages

  • How to run a search query for a particular folder in KM related to portal

    Hi,
    Can any one tell me the steps for : how to run a search query for a particular folder in knowledge management related to portal.
    Answers will be rewarded.
    Thanks in advance.
    KN
    Edited by: KN on Mar 18, 2008 6:33 AM

    Ok u may not require a coding
    But u req configuration
    U should first make a search option set
    Link: [Search Option set|http://help.sap.com/saphelp_nw04/helpdata/en/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Then u need 2 duplicate a KM Command by the name Search From here
    and customize it to include the Search Option that u have created
    Link: [Search from here|http://help.sap.com/saphelp_nw04/helpdata/en/2a/4ff640365d8566e10000000a1550b0/frameset.htm]
    Then in the layout add this command.
    Regards
    BP

  • Need helping in writing query for finding percentage of duration

    Can any one please help in writing query for this.
    The table is like this :-
    ID     Region     Month     Duration
    I1 R1     Jan     80
    I2     R2     Jan     70
    I3     R1     Jan     70
    I4     R3     Jan     40
    I5     R1     Feb     80
    I6     R2     Feb     30
    I7     R3     Mar     100
    I want to write a query to find
    % of duration for each and every region against each and every month.
    Please help in solving this query. I am in urgent need of this.
    Thanks in advance.

    I also have to do in MS Access 2003You also have to ask into an other forum since here it's an Oracle forum, to try to find Oracle solution.
    Nicolas.

  • Need help writing a query for following scenario

    Hi all, I need some help writing a query for the following case:
    One Table : My_Table
    Row Count: App 5000
    Columns of Interest: AA and BB
    Scenario: AA contains some names of which BB contains the corresponding ID. Some
    names are appearing more than once with different IDs. For example,
    AA BB
    Dummy 10
    Me 20
    Me 30
    Me 40
    You 70
    Me 50
    Output needed: I need to write a query that will display only all the repeating names with their corresponding IDs excluding all other records.
    I would appreciate any input. Thanks

    Is it possible to have a records with the same values for AA and BB? Are you interested in these rows or do you only care about rows with the same value of AA and different BB?
    With a slight modification of a previous posting you can only select those rows that have distinct values of BB for the same value of AA
    WITH t AS (
    SELECT 'me' aa, 10 bb FROM dual
    UNION ALL
    SELECT 'me' aa, 20 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    SELECT DISTINCT aa, bb
      FROM (SELECT aa, bb, COUNT(DISTINCT bb) OVER(PARTITION BY aa) cnt FROM t)
    WHERE cnt > 1;

  • How do I use "Search Query" for nontrivial searches?

    After a few years in the community, this is my _first_ question to the boards ;-)
    In speaking with a colleague today, I learned about an NI forum feature that would be useful for me. When I tried to configure it, I then learned that I didn't know how to use it. When I tried to learn how to use it, I further learned that it wasn't fully documented. So, I'd like some clarification :-)
    The feature in question is "Search Query" which will send you an email when a forum search matches your query. What I don't know is:
    What are the rules (syntax) for search queries? For example, I would like to search for single words, all the words that I specify, as well as exact phrases. How do I differentiate between multiword queries and exact phrase queries?
    Is it possible to have more than one Search Query?
    If so, how do you delineate them? Would I use commas, a new line, something else?
    I'm asking because the available (and discoverable) documentation doesn't mention what to do when you want more than one Search Query. The help text on the subscription page [1] makes me think that only one query is possible, and says a Search Query:
    Sends you mail every time a message matching your query is submitted. Search queries take up to 15 minutes to take effect. Saving a blank query will disable this feature and will stop any mail from being sent.
    The other place I tried was the NI Forum FAQ [2], which makes me think that more than one query is possible:
    If you add a board, thread, message, or search term to your subscriptions, the system will send you an e-mail every time someone posts to the board, or replies to the message or thread. If you prefer not to receive an e-mail for your subscriptions, you can subscribe to the RSS feed of a board, thread, user, or search term.
    The FAQ goes on about what to do with board, thread, and message subscriptions, but doesn't say anything more about search subscriptions.
    The last place I looked was on the search results page itself. In the blue header that precedes the results, there's a link on the far left that says "Search Options" with a single option that says "Subscribe to this search's RSS Feed". While I could subscribe and use an RSS reader, I really would prefer email. I suppose if only one Search Query is possible, then this will be my workaround.
    As a comment, why does the Search Options menu not also have a "Subscribe to this search" option, which would add another entry in the Search Query box? This is a noticeably different interface than the Thread Options menu.
    [1] Subscriptions & Bookmarks
    http://forums.ni.com/ni/user_subscriptions
    [2] Frequently Asked Questions
    http://forums.ni.com/ni/help_faq
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)
    Solved!
    Go to Solution.

    Hi Joe,
    Thanks for all of the questions and congrats on posting your first question!
    Unfortunately I think all of your questions come from the valid assumption that the search query functionality is more robust than it actually is.  The search query functionality really only serves a single purpose and that is to email you when your phrase has been posted to the forums.  For me, I use it to email me when my name is mentioned in the forums.  It serves this purpose well since I have it set up to work off just a single search term.  However I find that multiple word phrases are combined with an OR which is not as useful.  The search query does not adhere to any common search syntax that you would expect (I believe we are the only community that uses this feature so it has not been improved upon).
    The best way to set up both multiple word queries and multiple different queries is to use the RSS feed as you mentioned.  This way you can tailor your search very specifically using different advanced search options and subscribe to them all in one feed reader without constantly getting emails.  The search query emails do not adhere to the digest subscription settings.  I find that the RSS feeds work very well for searches and I am fond of using them, but I do use an RSS Reader for many things so it is not out of my normal workflow.
    Thank you for reading the Forum FAQ.  I've done some work to improve it but I think it has a long way to go and it's good to know that people read it
    Regards,
    Laura
    Web Support & Operations
    National Instruments

  • Formatted Search Query for BatchNo

    Dear All,
    I am using the following query as formated search for Identifying the batches availble during the creation of  Delivary document
    in a user defined column at row level. When i click on this field it's showing the Batches for the Item with Zero Qty also.
    I need to display only the batches where the QTY >0. This query displaying even the Zero Qty Batches also. Please help me to modify the below query for getting the above. Below is the  query .
    SELECT distinct  T4.[BatchNum] FROM [dbo].[OIBT]  T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN DLN1 T2 ON T1.ItemCode = T2.ItemCode INNER JOIN ODLN T3 ON T2.DocEntry = T3.DocEntry INNER JOIN IBT1 T4 ON T0.BatchNum = T4.BatchNum AND T3.DocNum = T4.BaseNum INNER JOIN OWHS T5 ON T0.WhsCode = T5.WhsCode WHERE T0.[ItemCode] = $[$38.1] AND  T4.[WhsCode] = $[$38.24] AND T0.[Quantity]>=$[$38.11]
    Regards
    Srini

    i removed that T5, But It's  showing the  Batches where the qty in the main warehouse for that batch is Zero.That batch was actually present in another warehouse. And also when i am working on other warehouses it's showing the batches in the main warehouse where the qty is present.
    Regards
    Srini
    Edited by: Srini on May 11, 2010 10:24 PM

  • Formatted Search query for Vacation Accrued

    Hi Experts,
    I have a Client who needs to keep tract on the Vacation Accrued on the Employee Master Data. I have created this UDF on the Master Data, but I could not get the query for the Formatted Search right.
    This Formatted search on the UDF ( must look at the OHEM.startDate field and populate the following:
    If it is a still within year of the system date, it must populate 0,
    If it is > 1 year and < 3 years, it must populate 5,
    etc.
    Any help would be greatly appreciated.
    Marli

    Hi Experts,
    Here is what I did for the query mentioned above:
    {SELECT
    CASE
               WHEN (T0.startDate > GETDATE() -356)
                       THEN 0
               WHEN (T0.startDate > GETDATE() - 712)
                       THEN 5
    END
    As 'Vacation Accrued'
    FROM OHEM T0}
    The issue is that if I link this query to the UDF on the EMD, I get a list of 0 and 5 to choose from. I need to populate automatically.
    Thanks.
    Marli

  • Formatted search query for displaying invoice items details

    hi all,
    i need to display all the items in AP invoice.kindly suggest me a query for that.
    in AP invoice
    Ex. row items
    code--descqtyprice--
    total
    I0001--XXXXXXX5--
    100 -
    500
    query should display this row as
    code--desc--
    price
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    I0001--XXXXXXX--
    100
    =================================
    the query should display as the qty is 5 so it will display the same item 5 times
    kindly suggest me some query for formatted search
    its very urgent
    regards
    sandip

    Hi Sandip,
    DoQuery("Select b.ItemCode from OINV a,INV1 b Where a.DocEntry=b.DocEntry")
    Hope its help for you
    Give me reward points,
    Regards,
    G.Suresh.

  • Help needed in query for Materialized View

    Hi,
    I want to create a materialized view which has some precalcultaed values.
    I have four dimension tables out of which one is a Time Dimension table with levels as Year->Quarter->Month.
    The precalculations are the moving averages and cummulative values of Sales Amt on the dimension values over a period of 4 Months.
    The dimension tables are Clients, Products, Channel, Time.
    Fact Table is Sales_Fact which will have the sales amount for different members of the dimension.
    Since my fact table is very huge, i want to create a materialized view where i could store the required calculated measures, here Moving Average of Sales Amt for each Client, Product, Channel dimensions over a period of 4 Months.
    Can anybody help with writing the query for this..Any help in this regard will be appreciated..
    Please give me suggestions for this..

    Check this link.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/aggreg.htm#sthref1612
    Regards
    Raj

  • Help to rewirte query for best performance

    Hi All,
    can you kindly help me to rewirte the below mentioned query for best performance. this is taking more than 20 min in our production server.
    SELECT cp.name,mis.secondary_type U_NAME,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-161,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-154,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-154,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-147,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-147,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-140,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-140,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-133,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-133,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-126,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-126,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-119,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-119,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-112,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-112,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-105,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-105,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-98,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-98,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-91,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-91,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-84,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-84,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-77,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-77,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-70,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-70,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-63,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-63,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-56,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-56,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-49,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-49,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-42,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-42,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-35,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-35,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-28,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-28,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-21,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-21,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-14,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage,
    count(CASE WHEN (mis.start_time between To_DATE(to_char(next_day (sysdate-14,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-7,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))THEN mis.event_audit_id END) Usage
    FROM mis_event_audit mis,USER u,com_pros cp where
    mis.user_id=u.email_address and u.cp_id=cp.cp_id
    and (mis.start_time between To_DATE(to_char(next_day (sysdate-161,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy') and To_DATE(to_char(next_day (sysdate-7,'monday'),'MM/DD/YYYY'),'mm/dd/yyyy'))
    GROUP BY cp.name, mis.secondary_type;
    Thanks,
    krish

    Hi, Krish,
    Something like this will probably be faster, because it cuts out most of the function calls:
    WITH     got_cnt          AS
         SELECT    cp.name
         ,       mis.secondary_type          AS u_name
         ,       COUNT (mis.event_audit_id)     AS cnt
         ,       ( TRUNC (mis.start_time, 'IW')
                - TRUNC (SYSDATE,        'IW')
                ) / 7                    AS week_num
         FROM      mis_event_audit  mis
         JOIN       user_table        u     ON   mis.user_id  = u.email_address     -- USER is not a good table name
         JOIN       com_pros        cp     ON   u.cp_id       = cp.cp_id
         WHERE       mis.start_time   >= TRUNC (SYSDATE, 'IW') - 161
         AND       mis.start_time   <  TRUNC (SYSDATE, 'IW')
         GROUP BY  cp.name
         ,            mis.secondary_type
         ,       TRUNC (mis.start_time, 'IW')
    SELECT       name
    ,       secondary_type
    ,       SUM (CASE WHEN week_num = 22 THEN cnt END)     AS week_23
    ,       SUM (CASE WHEN week_num = 21 THEN cnt END)     AS week_22
    ,       SUM (CASE WHEN week_num = 20 THEN cnt END)     AS week_21
    ,       SUM (CASE WHEN week_num =  0  THEN cnt END)     AS week_1
    FROM       got_cnt
    GROUP BY  name
    ,            secondary_type
    ;TRUNC (d, 'IW')       is midnight on the last Monday before or equal to the DATE d. It does not depend on you NLS settings.
    Whenever you're tempted to write an exprssion as complicated as
    ,     COUNT ( CASE
                       WHEN ( mis.start_time BETWEEN TO_DATE ( TO_CHAR ( NEXT_DAY  ( SYSDATE - 161
                                                                       , 'monday'
                                                  , 'MM/DD/YYYY'
                                        , 'MM/DD/YYYY'
                              AND     TO_DATE ( TO_CHAR ( NEXT_DAY ( SYSDATE - 154
                                                                 ,'monday'
                                                , 'MM/DD/YYYY'
                                          , 'MM/DD/YYYY'
                  THEN mis.event_audit_id
               END
             )               AS usageseek alternate ways. Oracle provides several handy functions, especially for manipulating DATEs. In particular "TO_DATE (TO_CHAR ...)" is almost never needed; think very carefully before doing a round-trip conversion like that.
    Besides being more efficient, this will be easier to debug and maintain.
    If you're using Oracle 11.1 (or higher), then you can also use SELECT ... PIVOT in the main query, but I doubt that will be any faster, and it might not be any simpler.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Simplify the problem as much as possible. For example, instead of posting a problem that covers the last 23 weeks, pretend that you're only interested in the last 3 weeks. You'll get a solution that's easy to adapt to any number of weeks.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    For performance problems, there's another page of the forum FAQ {message:id=9360003}, but, before you start that process, let's get a cleaner query, without so many functions.
    Edited by: Frank Kulash on Oct 2, 2012 11:50 AM
    Changed week_num to be non-negative

  • Generating dynamic search query for search formular

    Hallo guys,
    a theoretical question I have there for you.
    I have a search form in HTML with several input fields, so the user can search for particular features in a db.
    My queiston: How can I generate a dynamic query, depending on which fields the user had filled in?
    It should look like this:
    > look at the input fields:
    > if request.getParameter("art) !=null : Query "+" age
    > if request.getParameter("experience") !=0 : Query "+" experience
    > if request.getParameter("instrument") != null : Query "+" instrument
    > .... and so on
    final query = SELECT art, experience,instrument FROM x, y, z WHERE x.art = art AND y.experience > experience AND z.instrument LIKE '%instrumen%' ;I hope I have explained it somehow understandable.
    Any help is deeply appreciated! Thank you in advance...
    fankoff
    Edited by: fankoff on Jun 21, 2010 9:55 AM

    for every ? in your preparedQuery, you need a preparedQuery.set...
    why do you use reflection to get the length of an array? why not use:
    int[] ar = {1,2,3,4};
    System.out.println(ar.length);you might want to consider using "... WHERE title IN (title1, title2, ..) OR content IN (content1, content2,...)"
    now unfortunatly jdbc seems to be not properly specified with the #setArray, oracle uses it in above mentioned context(e.g. "... WHERE title IN ?" and you set a string-array) mysql doesn't.(you would need something like "...WHERE title IN (?,?,?,?,?)"
    but in either of this case, or yours, its usually better to create a prepared query once, and than just insert the values with each fetch. just use enough ?'s and set the not-needed ones to NULL. it will still be more efficient than creating a query everytime.

  • Need Help with complex query for productio database

    Hello again,
    i need your help again, for an query how Shows me how long every production step takes per Order.
    See sample data and what i expect.
    Thank you all for your help.
    We use Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Here the sample data tables:
    CREATE      TABLE      TABLE_2
    (     "ORDER_NR"      VARCHAR2 (12)
    ,      "PRIORITY"      VARCHAR2 (2)
    ,      "WO_STEP"      VARCHAR2 (1)
    ,      "STEP_DATE"      DATE
    CREATE      TABLE      TABLE_1
    (     "ORDER_NR"           VARCHAR2     (12) PRIMARY KEY
    ,      "PRIORITY"           VARCHAR2      (2)
    ,      "CREATE_DATE"      DATE
    ,     "ACT_STEP"          VARCHAR2     (2)
    ,     "STEP_DATE"          DATE
    ,     "EMPLOYEE"          VARCHAR2     (5)
    ,     "DESCRIPTION"     VARCHAR2     (20)
    INSERT      INTO      TABLE_1      (ORDER_NR,               PRIORITY,      CREATE_DATE,                                                        ACT_STEP,     STEP_DATE,                                                            EMPLOYEE,     DESCRIPTION)
                        VALUES           ('1KKA1T205634',     '12',          TO_DATE('10-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'),     'U',          TO_DATE('28-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'),     'W0010',     'CLEAN HOUSE');
    INSERT      INTO      TABLE_1      (ORDER_NR,               PRIORITY,     CREATE_DATE,                                                        ACT_STEP,     STEP_DATE,                                                            EMPLOYEE,     DESCRIPTION)
                        VALUES           ('1KKA1Z300612',     '12',          TO_DATE('08-FEB-13 14:00:00','DD-MON-RR HH24:MI:SS'),     'F',          TO_DATE('20-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'),     'K0052',     'REPAIR CAR');
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'A',          TO_DATE('12-FEB-13 13:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          '5',          TO_DATE('13-FEB-13 09:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'K',          TO_DATE('13-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          '5',          TO_DATE('13-FEB-13 11:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'K',          TO_DATE('13-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          '5',          TO_DATE('13-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'C',          TO_DATE('14-FEB-13 08:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'B',          TO_DATE('14-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'E',          TO_DATE('18-FEB-13 13:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'F',          TO_DATE('20-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'S',          TO_DATE('21-FEB-13 08:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'R',          TO_DATE('21-FEB-13 09:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1T205634',     '12',          'U',          TO_DATE('28-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'A',          TO_DATE('12-FEB-13 13:52:42','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          '5',          TO_DATE('13-FEB-13 09:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'K',          TO_DATE('13-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          '5',          TO_DATE('13-FEB-13 11:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'K',          TO_DATE('13-FEB-13 12:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          '5',          TO_DATE('13-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'C',          TO_DATE('14-FEB-13 08:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'B',          TO_DATE('14-FEB-13 10:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'E',          TO_DATE('18-FEB-13 13:00:00','DD-MON-RR HH24:MI:SS'));
    INSERT     INTO      TABLE_2      (ORDER_NR,               PRIORITY,     WO_STEP,     STEP_DATE)
                        VALUES           ('1KKA1Z300612',     '12',          'F',          TO_DATE('20-FEB-13 16:00:00','DD-MON-RR HH24:MI:SS'));
    COMMIT;And here is what i expect from my query:
    SYSDATE     28.Feb.13 14:00                                                                                     
    ORDER_NR     PRIORITYCREATE_DATE     STATUS     STATUS_DATE     DESCRIPTION     AGE_1     AGE_2     WAITNG     STEP_A     STEP_B     STEP_C     STEP_5     STEP_K     STEP_E     STEP_F     STEP_S     STEP_R     
    1KKA1T205634     12     10.Feb.13 10:00     U     28.Feb.13 12:00     CLEAN HOUSE     18,083     8,833     2,125     0,833     4,125     0,083     0,750     0,208     2,125     0,666     0,042     7,125     
    1KKA1Z300612     12     08.Feb.13 14:00     F     20.Feb.13 16:00     REPAIR CAR     20,000     16,042     2,125     0,833     4,125     0,083     0,750     0,208     2,125     0,666          And now the explanation to the query result:
    The AGE_1 is the difference in days between the 'CREATE_DATE' and IF EXSIST the STEP 'U' then STEP_DATE or if the STEP 'U' is not found in TABLE_2 then it should show the difference in days between the 'CREATE_DATE' and the 'SYSDATE'
    The AGE_2 is the difference in days between the STEP 'A' STEP_DATE and IF EXSIST the STEP 'R' then STEP_DATE or if the STEP 'R' is not found in TABLE_2 then it should show the difference in days between the 'CREATE_DATE' and the 'SYSDATE'
    The WAITING is the difference in days between CREATE_DATE and STEP 'A' STEP_DATE
    The following columns show the days how long the ORDER_NR stays in these STEP, if an ORDER_NR comes into the same STEP more then one time it should be calculated together.
    If the ORDER_NR skips a step it should show a zero in the specific field.
    I hope my explanation is good enough, my english skills are far away from good.
    Thanks all for your help.
    Greets Reinhard W.

    Hi,
    i changed this query:
    with t2 as (
                select  t.*,
                        lead(step_date) over(partition by order_nr order by step_date) next_step_date
                  from  table_2 t
    select  t1.*,
            nvl(
                max(
                    case t2.wo_step
                      when 'U' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_1,
            nvl(
                max(
                    case t2.wo_step
                      when 'R' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_2,
            sum(
                case t2.wo_step
                  when 'B' then t2.next_step_date - t2.step_date
                end
               ) step_b
      from  table_1 t1,
            t2
      where t2.order_nr = t1.order_nr
      group by t1.order_nr,
               t1.priority,
               t1.create_date,
               t1.act_step,
               t1.step_date,
               t1.employee,
               t1.descriptionTo this:
    with t2 as (
                select  t.*,
                        lead(step_date) over(partition by order_nr order by step_date) next_step_date
                  from  table_2 t
    select  t1.order_nr,
            nvl(
                max(
                    case t2.wo_step
                      when 'U' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_1,
            nvl(
                max(
                    case t2.wo_step
                      when 'R' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_2,
            sum(
                case t2.wo_step
                  when 'B' then t2.next_step_date - t2.step_date
                end
               ) step_b
      from  table_1 t1,
            t2
      where t2.order_nr = t1.order_nr
      group by t1.order_nrthen i get the ORA-00979 Error.
    Whats wrong?
    I have another question.
    How can i handle i i want to group to or more 'STEP's in one Column.
    in Case of this i want that the column 'STEP_B' contains all days for STEP 'B' and STEP '5'.
    I tried already with a + Operation like this:
    with t2 as (
                select  t.*,
                        lead(step_date) over(partition by order_nr order by step_date) next_step_date
                  from  table_2 t
    select  t1.*,
            nvl(
                max(
                    case t2.wo_step
                      when 'U' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_1,
            nvl(
                max(
                    case t2.wo_step
                      when 'R' then t2.step_date
                    end
               sysdate
              ) - t1.create_date age_2,
            Round( sum(
                case t2.wo_step
                  when 'B' then t2.next_step_date - t2.step_date
                end
               ) +
            sum(
                case t2.wo_step
                  when '5' then t2.next_step_date - t2.step_date
                end
               ), 3 ) step_b
      from  table_1 t1,
            t2
      where t2.order_nr = t1.order_nr
      group by t1.order_nr,
               t1.priority,
               t1.create_date,
               t1.act_step,
               t1.step_date,
               t1.employee,
               t1.descriptionBut this does reply evertime a NULL.
    Thank You.

  • Formatted Search Query for Variable field

    Hi Experts,
    I have a client who wants a UDF on the Delivery Document to auto populate wiht a Variable field in the Administration module. This variable field was added by a Add-on.
    The system information is:
    Form: ShipOpt
    Item: Boxes
    Pane: 1
    Column: Box Name
    Row: 0
    Variable: 3
    How do you specify a Variable field in the Query?
    Any help would be appreciated.
    Thanks,
    Marli

    Hi Marli,
    You may only use Current form variable for FMS query.  I believe you need UDF on the Delivery. SO the other form will not be available to your query.
    Thanks,
    Gordon

  • Help needed: Search function for custom Repository Manager

    Hi there,
    i'm writing my own Repository Manager for EP 6.0 SP2 PL4.
    I've serious problems getting the search function running. I'm using the 'new', Netweaver-based API.
    I think, there are some general questions to answer:
    - My Repository Manager exposes lots of custom 
       properties to the system. I create the properties
       for example using following code:
       IProperty newProp = new StringSingleValueProperty(
         PropertyName.getPropertyName(
                  "{}" + myAttName),
         myAttVal,                         PropertyFlags.constructFlags(
                  true, false, true, false)
        Is there any convention for the propertie's name?
        I think it has to be written in lowercase only?
        Can I use ANY namespace I want instead of the
        empty default namespace? (For example:
    - After indexing my resources (of course, containing my
       custom properties), the TREX-Monitoring screen for my
       index shows all my custom properties in the 'Document
       Properties' area, but all uppercase chars are escaped
       somewhat. Is this OK?
    - Trying to use the index above to search for particular
       resources in my repository by my custom properties
       fails all the time ('no docs found...'); searching for
       any system property works fine. What's the reason?
    - How can I force the (Property-) search uses my
       custom namespace-manager's methods
       isQueryPropertyNameUnderstood() and
       getQueryBuilder()
       to perform a 'pure' property search by the repository
       manager? It seems that the TREX always handles the
       queries by itself, because my methods are never called.
    Thanx for you help,
    Daniel

    I created a new manager and copied the classes exactly from the "simple" example and I see similar behavior. Actually, when I do this, folders are recursively copied, but not files. Again, browsing and viewing of files work fine. Again, I am not seeing any unexpected exceptions.
    The only thing that changed were the names and namespaces. Nothing else at all was changed.
    This makes me think I am missing some configuration somewhere or there is something special about the example project that the wizards are not creating. The only difference I see in the project file is an additional nature (com.tssap.selena.cmf.PatternNature), but I am not sure that is relevant.
    Wow, I am really stumped.
    -Alex

  • Need help with sq01 query for FI data

    hello,
      i have created a simple query whihc requires document header and line item information , bkpf and bsis works for this, but another requirement is that business needs vendor and customer accounts to be displayed also .
    bsis does not have vendor and customer , bseg has this info but bseg cannot be used in query ,
    kindly assist with this , thanks in advance.

    hi,
    you'll find the required info in BSID (customers) and BSIK (vendors) tables (BSAD and BSAK for closed items).
    hope this helps
    ec

Maybe you are looking for