SQL query for Menu list for a responsibility

Dear All
I want a Query to extract all menu prompt for a responsibility like
Responsibility -------------------------- menu with prompt
System Administrator-------------------------- Concurrent\Requests
System Administrator-------------------------- Concurrent\Set
System Administrator-------------------------- Concurrent\Conflicts Domains
System Administrator-------------------------- Concurrent\Manager\Administer
System Administrator-------------------------- Concurrent\Manager\Define
System Administrator-------------------------- Concurrent\Manager\WorkShifts
System Administrator-------------------------- Concurrent\Manager\Rule
System Administrator-------------------------- Concurrent\Program\Define
System Administrator-------------------------- Concurrent\Program\Executable
System Administrator-------------------------- Concurrent\Program\Types
System Administrator-------------------------- Profile\System
System Administrator-------------------------- Profile\Personal
list should be in order which is defined in apps menu.
I will be great thankful you all.
Regards
Aamir

I did not realize that the procedure has bugs. Sorry about that.
It took some time to figure out but once fixed, the script works properly.
I can't post the full code (due to Metalink restrictions) but here are the fixes I had to do.
1) Do not cut and paste the whole code. It does not get formatted properly. Do small sections at a time.
2) Change the quotes around the "STACK OVERFLOW". They are not proper.
3) The code needs labels for the goto statements to work. Replace the first <> with <<label_outer>>. Replace the second <> with <<label_inner>>
Sandeep Gandhi

Similar Messages

  • How to know which sql query is taking time for concurrent program

       Hi sir,
    I am running concurrent program,that is taking time to execute ,i want to know which sql query causing performance
    Thanaks,
    Sreekanth

    Hi,
    My Learning: Diagnosing Oracle Applications Concurrent Programmes - 11i/R12
    How to run a Trace for a Concurrent Program? (Doc ID 415640.1)
    FAQ: Common Tracing Techniques in Oracle E-Business Applications 11i and R12 (Doc ID 296559.1)
    How To Get Level 12 Trace And FND Debug File For Concurrent Programs (Doc ID 726039.1)
    How To Trace a Concurrent Request And Generate TKPROF File (Doc ID 453527.1)
    Regards
    Yoonas

  • SQL Query - store the result for optimization?

    Good day experts,
    I am looking for advice on a report. I did a lot of analytic functions to get core data that I need to make my report and its takes around 50 min for SQL to complete. Now with this data I need to create 3 different reports and I cant use the same SQL since there is a lot of agregation (example would be group by product in one case and by client in 2nd). For each of those different group bys I need a different report.
    So how to create 3 reports from 1 SQL query without running the query 3 times?
    First thing that comes to mind is to store the result set into a dummy table and then query the table since the core data I get is around 300 rows and then do different group bys.
    Best regards,
    Igor

    So how to create 3 reports from 1 SQL query without running the query 3 times?
    You already know the obvious answer - store the data 'somewhere'.
    The appropriate 'somewhere' depends on your actual business requirements and you did not provide ALL of them.
    MV - if the query is always the same you could use an MV and do a complete refresh when you want new data. The data is permanent and can be queried by other sessions but the query that accesses the data will be frozen into the MV definition.
    GTT (global temp table) - if a NEW data load AND the three reports will ALWAYS be executed by a single session and then the data is NOT needed anymore then a GTT can work. The query that loads the GTT can be different for each run but the data will only be available for a single session and ONLY for the life of that session. So if anything goes wrong and the session terminates the data is gone.
    First thing that comes to mind is to store the result set into a dummy table and then query the table since the core data I get is around 300 rows and then do different group bys.
    That is commonly referred to as a 'REPORT-READY table'. Those are useful when the data needs to be permanent and available to multiple sessions/users. Typically there is a batch process (e.g. package procedure) that periodically refreshes/updates the data during an outage window. Or the table can have a column (e.g. AS_OF) that lets it contain multiple sets of data and the update process leaves existing data alone and creates a new set of data.
    If your core data is around 300 rows you may want to consider a report-ready table and even using it to contain multiple sets of data. Then the reports can be written to query the data using an AS_OF value that rolls up and returns the proper data. You don't need an outage window since older data is always available (but can be deleted when you no longer need it.
    If you only need one set of data you could use a partitioned work table (with only one partition) to gather the new set of data and then an EXCHANGE PARTITION to 'swap' in the new data. That 'exchange' only takes a fraction of a second and avoids an outage window. Once the swap is done any user query will get the new data.

  • Sql query to betwen clause for date

    i have a interface there user can enter two dates . in my servlet program i am getting it as string by using request .get parameter. i wanan to know how to write sql query for selecting data from database with between clause

    i have a interface there user can enter two dates . in my servlet program i am getting it as string by using request .get parameter. i wanan to know how to write sql query for selecting data from database with between clause

  • SQL query to get DDL for Adding PK.

    Guys,
    I'm looking for SQL query that gets me the "ALTER TABLE <TABLE_NAME> ADD CONSTRAINT <constraint_name> PRIMARY KEY (X,Y,...);" statments of all tables in my schema containing Primary Keys.
    Could someone help me with the query please?
    Regards,
    Bhagat

    You need this
    SELECT 'ALTER TABLE '||table_name||' ADD CONSTRAINT '||constraint_name||' PRIMARY KEY ('||column_name||');'
      FROM ( SELECT uc.table_name
                   ,uc.constraint_name
                   ,RTRIM (XMLAGG (XMLELEMENT (ucc, column_name || ',')).extract ('//text()'), ',')  column_name
              FROM user_constraints        uc
                  ,user_cons_columns       ucc
             WHERE uc.constraint_type      = 'P'
               AND uc.constraint_name      = ucc.constraint_name
          GROUP BY uc.table_name
                  ,uc.constraint_name
    ORDER BY table_name;   Regards
    Arun

  • SQL query, function or SP for converting varbinary to image(.jpg format).

    Dear Sir/Mam
    I want SQL query, function or SP which converts binary data to image (.jpg format).
    I m able to convert image (.jpg format) to varbinary. But not able to convert vice versa.
    thanks in advance.

    Binary data is binary data - "image" is only an intrepretation of binary data.  Therefore your question makes little sense in the context of sql server since it does not have any facilities to utilize images.  Since you provide no context, I'm
    guessing that you are trying to retrieve an image stored in the database in a varbinary column and have your application use it as an image.  If so, you should post your question to a forum that is specific to your development environment.  

  • Sql query question - been trying for two days

    Hi guys im trying to carry out an sql query
    Im using a left join to do a query, which gives me a set of results:
    select COURSESTUDENT.StudentNo, COURSESTUDENT.CourseCode, COURSESTUDENT.Year, MARKS.ExamMark, MARKS.EntryNo FROM COURSESTUDENT LEFT JOIN MARKS ON COURSESTUDENT.StudentNo=MARKS.StudentNo AND COURSESTUDENT.CourseCode=MARKS.CourseCode AND COURSESTUDENT.Year=MARKS.Year
    but I would like to do a select on this result but do not want to use a create view as if more than one person access this page at a time then if the servlet tries to create the view an error will occur.
    I would like to do the following select statement on the results of the query above..
    select * from (above) where CourseCode='ELE304' AND Year=1999;
    Is this possible, im using postgres..
    Please help......
    thanks
    tzaf

    Sorry, I have never used postgres, but in several databases, the following syntax would work and provide the correct ResultSet.
    select *
    from (
         SELECT
             COURSESTUDENT.StudentNo,
             COURSESTUDENT.CourseCode,
             COURSESTUDENT.Year,
             MARKS.ExamMark,
             MARKS.EntryNo
         FROM
             COURSESTUDENT LEFT JOIN MARKS ON
             COURSESTUDENT.StudentNo=MARKS.StudentNo AND
             COURSESTUDENT.CourseCode=MARKS.CourseCode AND 
             COURSESTUDENT.Year=MARKS.Year
         ) A
    WHERE
        CourseCode='ELE304' AND
        Year=1999

  • Discoverer Report - SQL Query to retrieve list of parameters

    Hi
    We have around 100 Discoverer reports and I'm trying to find the list of parameters used in each report.
    Is there any SQL query that I can use to find the parameters used for each report
    or
    should I open the reports one by one to fetch the list of parameters used.
    I checked the tables in EUL4_US schema but no luck.
    - Amarnath.K

    give this a try for starters. It looks at the custom folders defined in the business area, which is where any LOV's defined for you parameters would be. As far as looking at the workbooks themselves, no, there is no way to do that in sql.
    select
    decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') Origin,
    eb.ba_name business_area,
    eo.OBJ_TYPE,
    decode(eo.obj_type, 'SOBJ','From Database', 'CUO', 'Custom Query', 'COBJ', 'Complex Folder', eo.obj_type) obj_type_desc,
    eo.OBJ_NAME folder,
    eo.OBJ_DESCRIPTION folder_description,
    decode(eo.sobj_ext_table, NULL, NULL, eo.obj_ext_owner || '.' || eo.sobj_ext_table) base_object,
    decode(es.seg_obj_id, null, UPPER(trim(eo.obj_object_sql1)||trim(eo.obj_object_sql2)||trim(eo.obj_object_sql3))
    , UPPER(trim(es.seg_chunk1) || trim(es.seg_chunk2) || trim(es.seg_chunk3) || trim(es.seg_chunk4))) SQL
    from
    eul4_us.EUL5_BAS eb,
    eul4_us.EUL5_objs eo,
    eul4_us.EUL5_BA_OBJ_LINKS ebol,
    eul4_us.eul5_segments es
    where
    eb.BA_ID = ebol.BOL_BA_ID and
    ebol.BOL_OBJ_ID = eo.OBJ_ID and
    eo.obj_id = es.seg_obj_id (+) and
    decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') = 'Custom'
    order by
    /*decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom'), */eb.ba_name, ebol.BOL_SEQUENCE, es.seg_sequence

  • Bapi for invoice lists for a customer

    Can some one tell me the bapi which can be used to view all the invoice lists for a customer for date range.

    Hello
    I am not sure if there is such a BAPI available. However, you could try a two-step-approach:
    (1) Read sales orders of customer using BAPI_SALESORDER_GETLIST
    (2) Feed selected sales orders into REFDOCRANGE of BAPI_BILLINGDOC_GETLIST
    Regards
      Uwe

  • SQL query in ART database for incoming calls

    This is the sql statement I am using to pull records from ART database below. After looking at the data pulled I am not getting incoming calls. What colum do I need to include.
    select user_id, orig_party_number, orig_called_party_number, final_destination, connect_date, disconnect_date, (disconnect_date - connect_date) as duration, call_type, call_classification from Tbl_Billing_Data where orig_party_number = '50656' and timestamp > '2006-01-03' and timestamp < '2006-01-31'

    Query the CDR DB directly instead of ART and use this query for inbound:
    PARAMETERS [Called Number] Text ( 255 ), [Start Date] DateTime, [End Date] DateTime;
    SELECT DateAdd("s",[dateTimeOrigination],"31-Dec-1969 19:00:00") AS [Origin DateTime], IIf(dateTimeConnect<>0,DateAdd("s",[dateTimeConnect],"31-Dec-1969 19:00:00"),DateAdd("s",[dateTimeDisconnect],"31-Dec-1969 19:00:00")) AS ConnectDateTime, DateAdd("s",[dateTimeDisconnect],"31-Dec-1969 19:00:00") AS DisconectDateTime, dbo_CallDetailRecord.callingPartyNumber, dbo_CallDetailRecord.finalCalledPartyNumber, dbo_CallDetailRecord.duration AS Duration
    FROM dbo_CallDetailRecord
    WHERE (((dbo_CallDetailRecord.callingPartyNumber)<>"") And ((dbo_CallDetailRecord.finalCalledPartyNumber)=[Called Number]) And ((dbo_CallDetailRecord.dateTimeOrigination)>=DateDiff("s",#31/12/1969 19:0:0#,[Start Date]) And (dbo_CallDetailRecord.dateTimeOrigination)<=DateDiff("s",#31/12/1969 19:0:0#,[End Date])));
    adignan - berbee

  • How do I make a good menu list for a launcher? (Automator)

    First of all, sorry... I know this isn't exactly a Dev topic, but I didn't know what community to put it in. I currently have a simple Automator program that:
    1. Launches
    2. Finds all items with the Tag:Games
    3. Presents said items in a list to be picked from
    4. Launches the one that is picked
    What I am wondering is how to make a better looking selection window. At the moment, it shows the file paths to the .exe's (I use this for my WINE games), and all of them are selected by default, and I obviously don't want to launch all of them at once, and the file path looks a bit ugly and is hard to find the right game. I just need a way to make a simple window where you click on the right application, and it launches (In automator, preferably).

    If you put the following into an Automator Run AppleScript action it may help:
    on run
              set name_list to {}
              set path_list to {}
              set {old_tids, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "."}
              repeat with each_item in (every paragraph of (do shell script "mdfind \"kMDItemUserTags == Games\""))
                        set the_file to POSIX file each_item
                        copy the_file to end of path_list
                        tell application "Finder" to set file_name to text item 1 of (name of file the_file as text)
                        copy file_name to end of name_list
              end repeat
              set AppleScript's text item delimiters to old_tids
              set game_chosen to item 1 of (choose from list name_list with title "Choose a game" with prompt "Choose a game:" without multiple selections allowed)
              repeat with x from 1 to (count name_list)
                        if game_chosen = item x of name_list then exit repeat
              end repeat
              tell application "Finder" to open file (item x of path_list)
    end run

  • Double spry:repeat for menue list

    Hi,
    My first 12 h with spry and ajax were quite succesfull but
    now there is a point were I can't get along.
    Ich have extendet the galleries.xml file with another
    dimension:
    <kategories>
    <kategory>
    <targetname>Kategory1</targetname>
    <galleries>
    <gallery base="island/" file="photos.xml">
    <region>Gallerie1</region>
    </gallery>
    <gallery base="iceland/" file="photos.xml">
    <region>Gallery2</region>
    </gallery>
    </galleries>
    </kategory>
    </kategories>
    My goal is to create a vertical navigation menue like:
    Kategory1
    Gallery1
    Gallery2
    Kategory2
    Gallery3
    Gallery4
    I wanted to archieve this with a douple spry:repeat in the
    following code:
    <div spry:region="dsKategories dsGalleries" >
    <div spry:repeat="dsKategories">
    <div >{dsKategories::targetname</div>
    <div spry:repeatchildren="dsGalleries">
    <div>{dsGalleries::region}</div>
    </div>
    </div>
    </div>
    but the result looks like that:
    Kategory1
    Gallery1
    Gallery2
    Kategory2
    Gallery1
    Gallery2
    Can anyone give me a hint, what I'm doing wrong or what I
    might have misunderstood?
    Greeting from Cologne, Germany
    Markus

    Hi pygmaleon,
    The reason you don't get what you expect is because your
    dsGalleries data set is only selecting the first gallery for the
    first category because of the XPath you set on it. If you want to
    use Spry to accomplish what you want, you'll have to do some slight
    restrucuring of your XML. Perhaps something like this:
    <galleries>
    <kategories>
    <kategory id="1">
    <targetname>Kategory1</targetname>
    </kategory>
    <kategory id="2">
    <targetname>Kategory2</targetname>
    </kategory>
    </kategories>
    <gallery base="g1/" file="photos.xml" kategory="1">
    <region>Gallerie 1</region>
    </gallery>
    <gallery base="g2/" file="photos.xml" kategory="1">
    <region>Gallerie 2</region>
    </gallery>
    <gallery base="g3/" file="photos.xml" kategory="2">
    <region>Gallerie 3</region>
    </gallery>
    </galleries>
    And then you can do something like:
    var dsKategories = new
    Spry.Data.XMLDataSet("galleries/kategories.xml",
    "/galleries/kategories/kategory" )
    var dsGalleries = new
    Spry.Data.XMLDataSet("galleries/kategories.xml",
    "/galleries/gallery" );
    <div spry:region="dsKategories dsGalleries" >
    <div spry:repeat="dsKategories">
    <div >{dsKategories::targetname</div>
    <div spry:repeatchildren="dsGalleries">
    <div spry:if="{dsKategories::@id} ==
    {dsGalleries::@kategory}">{dsGalleries::region}</div>
    </div>
    </div>
    </div>
    --== Kin ==--

  • Sql query to find dependencies for a table

    Hi All,
    I am having a table (REPT_ALL) with dependent objects on it ( child tables, indexes, constraints, views, synonyms, sequences , packages,procedures,functions,triggers).
    I want the query to find out all the above dependencies for the above table(REP_ALL).
    I m looking for the query to find dependencies inorder to find out the risks before dropping the above table(drop table REP_ALL cascade constraints)?
    Thnx

    To find foreign key constraints for a table you cannot use DBA_DEPENDENCIES but you have to use DBA_CONSTRAINTS.
    Example Re: Find out foreign key column

  • Need efficient SQL query to retrieve data for MLM website

    Table cd_members
    MemberID LeftID RightID
    1 2 3
    2 4 5
    3 6 7
    4 8 -
    5 - -
    6 - -
    7 - -
    8 9 10
    9 - -
    10 - -
    i want to execute a query to retrieve downline of a member say MemberID 2
    o/p should be Records with MemberID 4,5,8,9,10
    i am using this query but don't know how to start from MembeID=2
    select a.memberid, a.tradingid, a.refid, a.parentid, a.node, a.leftid, a.rightid, b.memberid from cd_members a, cd_members b
    where (a.leftid=b.memberid or a.rightid=b.memberid)

    Again, assuming that the number of levels is known, you can just do N self joins (note that I intentionally go one level further than necessary in this case
    SQL> ed
    Wrote file afiedt.buf
      1  with t
      2    as
      3   (
      4      select 1 person, 2 left, 3 right from dual union all
      5      select 2, 4, 5 from dual union all
      6      select 3, 6, 7 from dual union all
      7      select 4, 8, null from dual union all
      8      select 5, null, null from dual union all
      9      select 6, null, null from dual union all
    10      select 7, null, null from dual union all
    11      select 8, 9, 10 from dual union all
    12      select 9, null, null from dual union all
    13      select 10, null, null from dual
    14   )
    15   select t1.left, t1.right, t2.left, t2.right, t3.left, t3.right, t4.left, t
    4.right
    16     from t t1,
    17          t t2,
    18          t t3,
    19          t t4
    20    where t1.person = 2
    21      and t1.left = t2.person(+)
    22      and t2.left = t3.person(+)
    23*     and t3.left = t4.person(+)
    SQL> /
          LEFT      RIGHT       LEFT      RIGHT       LEFT      RIGHT       LEFT
         RIGHT
             4          5          8                     9         10Justin

  • Tuning SQL query with similar subqueries for select columns

    Hi all,
    My query is something like below:
    1> SELECT
    2> A.COL1,
    3> SUM(CASE WHEN A.flag=100 AND NVL(B.flag,0)=0 AND
    4> EXISTS (
    5> SELECT 'ROW_EXISTS'
    6> FROM A A0
    7> WHERE A0.COL2=100 AND NVL(A0.flag,0)=0 AND 0.DIRN<>A.DIRN)
    8> THEN 1
    9> ELSE 0
    10> END) SUM_COLUMN1,
    11>SUM(CASE WHEN A.flag=100 AND
    12> EXISTS (
    13> SELECT 'ROW_EXISTS'
    14> FROM A A0
    15> WHERE A0.COL2=100 AND A0.DIRN<>A.DIRN)
    16> THEN 1
    17> ELSE 0
    18>END) SUM_COLUMN2
    19>FROM A,B
    20>WHERE A.COL=B.KEY_COL
    21>GROUP BY A.COL1
    My problem is that I need to index scan the tables A aliased as A0 in the two exist queries. Lines: 5-7 and 13-15.
    The major performance degradation i see with the query is that it has to scan A0 twice to compute SUM_COLUMN1 and SUM_COLUMN2.
    Is there any way by which i can use the same subquery to scan the table just once to compute the columns.
    The table A has more than a 100million records. So i need to improve performance of this query though it is a small issue.
    Please feel free to ask me more if i'm not clear with the example.
    Thanks in advance,
    Raj

    Also you could use analytic functions:
    SQL> select deptno, sum(case when e.mgr is not null and
      2  exists (select 1 from emp e1 where e1.empno <> e.empno
      3  and e1.deptno = 10 and e1.sal >= 1500)
      4  then 1 else 0 end) sum1,
      5  sum(case when e.mgr is not null and e.sal >= 1200 and
      6  exists (select 1 from emp e1 where e1.empno <> e.empno and e1.deptno = 10)
      7  then 1 else 0 end) sum2
      8  from emp e
      9  group by deptno
    10  /
        DEPTNO       SUM1       SUM2
            10          2          2
            20          5          3
            30          6          5
    SQL> select deptno, sum(case when mgr is not null and
      2  (d12 != empno or empno !=d11) then 1 else 0 end) sum1,
      3  sum(case when mgr is not null and (d21 != empno or empno !=d22)
      4  and sal >= 1200 then 1 else 0 end) sum2
      5  from (
      6  select deptno, empno, mgr, sal,
      7  min(case when deptno = 10 and sal >= 1500
      8  then empno else -1 end) over(order by null) d11,
      9  max(case when deptno = 10 and sal >= 1500
    10  then empno else -1 end) over(order by null) d12,
    11  min(case when deptno = 10 then empno else -1 end) over(order by null) d21,
    12  max(case when deptno = 10 then empno else -1 end) over(order by null) d22
    13  from emp e
    14  )
    15  group by deptno
    16  /
        DEPTNO       SUM1       SUM2
            10          2          2
            20          5          3
            30          6          5In your case it could be something like
    SELECT COL1,
    SUM( CASE WHEN a_flag = 100 and nvl(b_flag,0)=0 and
    (DIRN != MIN_A OR DIRN != MAX_A) THEN 1 ELSE 0 END) SUM_COLUMN1,
    SUM( CASE WHEN a_flag = 100 and
    (DIRN != MIN_B OR DIRN != MAX_B) THEN 1 ELSE 0 END) SUM_COLUMN2
    FROM (
    SELECT A.COL1, A.FLAG A_FLAG, B.FLAG B_FLAG, A.DIRN,
    MIN(CASE WHEN A.COL2=100 and NVL(A.flag,0) = 0 THEN A.DIRN ELSE null END) OVER(order by null) MIN_A,
    MAX(CASE WHEN A.COL2=100 and NVL(A.flag,0) = 0 THEN A.DIRN ELSE null END) OVER(order by null) MAX_A,
    MIN(CASE WHEN A.COL2=100 THEN A.DIRN ELSE null END) OVER(order by null) MIN_B,
    MAX(CASE WHEN A.COL2=100 THEN A.DIRN ELSE null END) OVER(order by null) MAX_B
    FROM A,B
    WHERE A.COL=B.KEY_COL
    GROUP BY COL1
    Rgds.

Maybe you are looking for

  • In costing view in material master

    we are running some customized report The values are from costing view2 at the time of running the customized report ,some value is zero for some material because at the time of running the report,there is no costing for that material after running t

  • TiTNS operation timed out

    Hi All, DB 10.2.0. I have one issue , where my tnsping is timing out. I have done some investigation and found, when I do a ping to host , it's pingable as given in listener.ora file, but strange to see the ip is different. it seems to me the servet

  • Formatting my new external HD

    Hey guys, I just received my OWC Mercury Elite Pro 500 GB and I need to format it. I'm not really good with the technical stuff on a computer so, please be easy on me. 1) I got the external HD because, I want to move my music, photos, and docs off my

  • Photoshop elements 12 - convert a catalog

    My PC has three drives C for the programs, D for the photos and F for the backup photos With the upgrade to Elements 12, C is nearly maxed out Except for "C" there are multiple catalogs on each drive, C should have none I do not see an ability to con

  • Grabbing the filename of the document a dynamic stamp is being placed into.

    I need to get the filename of the "parent" document a stamp is being placed into to put into one of the stamps textfields. This was what I was hoping would work inside of stamps textfield custom calculation: event.value = app.activeDocs[0].documentFi