Need help with responsibility/ functions query

hi,
we are working in oracle applications 11i.
I have a requirement to extract the responsibility list of functions and menus.
I need to omit the excluded menus from each responsibility
this what I have so far (after researching the internet):
SELECT
FRTL.RESPONSIBILITY_NAME,
FFL.USER_FUNCTION_NAME, FFF.FUNCTION_NAME,ft.RESPONSIBILITY_NAME
FROM
FND_USER_RESP_GROUPS FURG,
fnd_responsibility_tl ft ,
FND_RESPONSIBILITY FR,
FND_COMPILED_MENU_FUNCTIONS FCMF,
FND_FORM_FUNCTIONS FFF,
FND_RESPONSIBILITY_TL FRTL,
FND_FORM_FUNCTIONS_TL FFL
WHERE
FURG.RESPONSIBILITY_ID = FR.RESPONSIBILITY_ID
and ft.RESPONSIBILITY_ID(+)= fr.RESPONSIBILITY_ID
AND FURG.RESPONSIBILITY_APPLICATION_ID = FR.APPLICATION_ID
AND FR.MENU_ID = FCMF.MENU_ID
AND FCMF.GRANT_FLAG = 'Y'
AND FCMF.FUNCTION_ID = FFF.FUNCTION_ID
AND SYSDATE BETWEEN FR.START_DATE AND NVL(FR.END_DATE, SYSDATE+1)
and fr.CREATION_DATE >= to_date('01-jan-2005','dd-mon-yyyy')
AND FURG.RESPONSIBILITY_ID = FRTL.RESPONSIBILITY_ID
AND FR.RESPONSIBILITY_ID = FRTL.RESPONSIBILITY_ID
AND FRTL.LANGUAGE = 'US'
AND FFL.LANGUAGE = 'US'
AND FFF.FUNCTION_ID = FFL.FUNCTION_ID
AND (FURG.END_DATE > SYSDATE
OR FURG.END_DATE IS NULL)
AND FFF.FUNCTION_NAME NOT IN
SELECT FF.FUNCTION_NAME
FROM FND_RESPONSIBILITY R, FND_USER_RESP_GROUPS RG
, FND_RESP_FUNCTIONS RF, FND_FORM_FUNCTIONS FF, FND_RESPONSIBILITY_TL FRTL
WHERE RG.RESPONSIBILITY_ID = R.RESPONSIBILITY_ID
AND RF.RESPONSIBILITY_ID = R.RESPONSIBILITY_ID
AND RF.RULE_TYPE = 'F'
AND FF.FUNCTION_ID = RF.ACTION_ID
AND FRTL.RESPONSIBILITY_ID = R.RESPONSIBILITY_ID
AND FRTL.RESPONSIBILITY_ID = RG.RESPONSIBILITY_ID
AND FRTL.LANGUAGE = 'US'
help me please to exclude the menus.

tried it and had the following error:
if((tbl_menu_id.FIRST is NULL) or (tbl_menu_id.FIRST 1)) then
ERROR at line 136:
ORA-06550: line 136, column 54:
PLS-00103: Encountered the symbol "1" when expecting one of the following:
*. ( ) , * @ % & | = - + < / > at in is mod not range rem =>*
*.. <an exponent (**)> <> or != or ~= >= <= <> and or like*
between ||
The symbol "," was substituted for "1" to continue.
from another perspective, from applications front end, when I press ctrl +L on any responsibility menu, I get the list of the forms names.
which database tables can I get that from?

Similar Messages

  • I need help with a SELECT query - help!

    Hello, I need help with a select statement.
    I have a table with 2 fields as shown below
    Name | Type
    John | 1
    John | 2
    John | 3
    Paul | 1
    Paul | 2
    Paul | 3
    Mark | 1
    Mark | 2
    I need a query that returns everything where the name has type 1 or 2 but not type 3. So in the example above the qery should bring back all the "Mark" records.
    Thanks,
    Ian

    Or, if the types are sequential from 1 upwards you could simply do:-
    SQL> create table t as
      2  select 'John' as name, 1 as type from dual union
      3  select 'John',2 from dual union
      4  select 'John',3 from dual union
      5  select 'Paul',1 from dual union
      6  select 'Paul',2 from dual union
      7  select 'Paul',3 from dual union
      8  select 'Paul',4 from dual union
      9  select 'Mark',1 from dual union
    10  select 'Mark',2 from dual;
    Table created.
    SQL> select name
      2  from t
      3  group by name
      4  having count(*) <= 2;
    NAME
    Mark
    SQL>Or another alternative if they aren't sequential:
    SQL> ed
    Wrote file afiedt.buf
      1  select name from (
      2    select name, max(type) t
      3    from t
      4    group by name
      5    )
      6* where t < 3
    SQL> /
    NAME
    Mark
    SQL>Message was edited by:
    blushadow

  • Need help with writing a query with dynamic FROM clause

    Hi Folks,
    I need help with an query that should generate the "FROM" clause dynamically.
    My main query is as follows
    select DT_SKEY, count(*)
    from *???*
    where DT_SKEY between 20110601 and 20110719
    group by DT_SKEY
    having count(*) = 0
    order by 1; The "from" clause of the above query should be generated as below
    select 'Schema_Name'||'.'||TABLE_NAME
    from dba_tables
    where OWNER = 'Schema_Name'Simply sticking the later query in the first query does not work.
    Any pointers will be appreciated.
    Thanks
    rogers42

    Hi,
    rogers42 wrote:
    Hi Folks,
    I need help with an query that should generate the "FROM" clause dynamically.
    My main query is as follows
    select DT_SKEY, count(*)
    from *???*
    where DT_SKEY between 20110601 and 20110719
    group by DT_SKEY
    having count(*) = 0
    order by 1; The "from" clause of the above query should be generated as below
    select 'Schema_Name'||'.'||TABLE_NAME
    from dba_tables
    where OWNER = 'Schema_Name'
    Remember that anything inside quotes is case-sensitive. Is the owner really "Schema_Name" with a capital S and a capital N, and 8 lower-case letters?
    Simply sticking the later query in the first query does not work.Right; the table name must be given when you compile the query. It's not an expression that you can generate in the query itself.
    Any pointers will be appreciated.In SQL*Plus, you can do something like the query bleow.
    Say you want to count the rows in scott.emp, but you're not certain that the name is emp; it could be emp_2011 or emp_august, or anything else that starts with e. (And the name could change every day, so you can't just look it up now and hard-code it in a query that you want to run in the future.)
    Typically, how dynamic SQL works is that some code (such as a preliminary query) gets some of the information you need to write the query first, and you use that information in a SQL statement that is compiled and run after that. For example:
    -- Preliminary Query:
    COLUMN     my_table_name_col     NEW_VALUE my_table_name
    SELECT     table_name     AS my_table_name_col
    FROM     all_tables
    WHERE     owner          = 'SCOTT'
    AND     table_name     LIKE 'E%';
    -- Main Query:
    SELECT     COUNT (*)     AS cnt
    FROM     scott.&my_table_name
    ;This assumes that the preliminary query will find exactly one row; that is, it assumes that SCOTT has exactly one table whose name starts with E. Could you have 0 tables in the schema, or more than 1? If so, what results would you want? Give a concrete example, preferably suing commonly available tables (like those in the SCOTT schema) so that the poepl who want to help you can re-create the problem and test their ideas.
    Edited by: Frank Kulash on Aug 11, 2011 2:30 PM

  • I need help with Analytic Function

    Hi,
    I have this little problem that I need help with.
    My datafile has thousands of records that look like...
    Client_Id Region Countries
    [1] [1] [USA, Canada]
    [1] [2] [Australia, France, Germany]
    [1] [3] [China, India, Korea]
    [1] [4] [Brazil, Mexico]
    [8] [1] [USA, Canada]
    [9] [1] [USA, Canada]
    [9] [4] [Argentina, Brazil]
    [13] [1] [USA, Canada]
    [15] [1] [USA]
    [15] [4] [Argentina, Brazil]
    etc
    My task is is to create a report with 2 columns - Client_Id and Countries, to look something like...
    Client_Id Countries
    [1] [USA, Canada, Australia, France, Germany, China, India, Korea, Brazil, Mexico]
    [8] [USA, Canada]
    [9] [USA, Canada, Argentina, Brazil]
    [13] [USA, Canada]
    [15] [USA, Argentina, Brazil]
    etc.
    How can I achieve this using Analytic Function(s)?
    Thanks.
    BDF

    Hi,
    That's called String Aggregation , and the following site shows many ways to do it:
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
    Which one should you use? That depends on which version of Oracle you're using, and your exact requirements.
    For example, is order importatn? You said the results shoudl include:
    CLIENT_ID  COUNTRIES
    1        USA, Canada, Australia, France, Germany, China, India, Korea, Brazil, Mexicobut would you be equally happy with
    CLIENT_ID  COUNTRIES
    1        Australia, France, Germany, China, India, Korea, Brazil, Mexico, USA, Canadaor
    CLIENT_ID  COUNTRIES
    1        Australia, France, Germany, USA, Canada, Brazil, Mexico, China, India, Korea?
    Mwalimu wrote:
    ... How can I achieve this using Analytic Function(s)?The best solution may not involve analytic functions at all. Is that okay?
    If you'd like help, post your best attempt, a little sample data (CREATE TABLE and INSERT statements), the results you want from that data, and an explanation of how you get those results from that data.
    Always say which version of Oracle you're using.
    Edited by: Frank Kulash on Aug 29, 2011 3:05 PM

  • Need help with LikeFilter for querying the keyset instead of value

    Hi,
    I'm looking for help with the LikeFilter.
    I need to query the cache to get all entries with key starting with a particular string.
    I could see samples using LikeFilter for querying the values in the cache but not the keyset.
    Can someone help?
    E.g:
    Cache Entries:
    abc123 - value1
    abc234 - value2
    bcd123 - value3
    I want to get all entries with key starting with 'abc'.
    thanks,
    rama.

    NJ, thanks for the quick reply.
    I tried something similar (as below) but this code gives me 'java.lang.NoClassDefFoundError: com/tangosol/util/ValueExtractor'.
    KeyExtractor extractor = new KeyExtractor("getKey");
    Filter filter = new LikeFilter(extractor, id+":%",'-',false);
    -rama.
    Edited by: 911950 on Feb 2, 2012 1:18 PM

  • Need help with the following query

    I have the following data
    INVOICE_ID PAID_AMT PYMNT_GROSS_AMT DISCOUNT
    10151 1375 1375 55
    10151DC -44.81 -44.81 0
    20017 25 25 7
    Ok the data I want to grab the discount field is paid_amt = pymnt_gross_amt and discount <> 0. If however there is another invoice_id out there (same invoice ID except with a DC appended to it like 10151DC) then you want to select the differece between the discount field without the DC and the Invoice ID with the DC the paid_amt field.
    So the results would be.
    Invoice_ID Discount
    10151 10.19
    20017 7
    Thanks for all your help!

    Why scan same table twice when it can be achived using single scan :
    Hope this helps :
    with inv_data as
    (select '10151' invoice_id,
    1375 paid_amt,
              1375 pymnt_gross_amt,
              55 discount from dual
    union all
    select '10151DC' invoice_id,
    -44.81 paid_amt,
              -44.81 pymnt_gross_amt,
              0 discount from dual
    union all
    select '20017' invoice_id,
    25 paid_amt,
              25 pymnt_gross_amt,
              7 discount from dual)
    select replace(invoice_id,'DC') invoice_id,
    sum(case when invoice_id like '%DC' then pymnt_gross_amt
         else discount end) discount
    from inv_data
    group by replace(invoice_id,'DC')
    INVOICE DISCOUNT
    10151 10.19
    20017 7
    2 rows selected.

  • Need help with Responsive HTML5 screen layout in RoboHelp HTML 11

    I have a few questions/issues regarding screen layouts for Responsive HTML5 output in RoboHelp HTML 11.
    First off, I decided to just use the Theme1_Standard layout that came with the program (only other default option was Theme2_Government) and started customizing the layout. I originally added a company logo to the 'Header' component in the Customization dialog, but have since decided to remove it. I can't seem to do this from the dialog, so I tried just deleting the image file from the whole project. The file is gone, but the logo is still there. This is only displayed in the header when a topic is displayed, it does not appear in the header at the TOC, Index, Search screen, etc. How do I get rid of this???
    Secondly, the text in the header for the topic screens appears differently than the one on the screens for the TOC, Index, Search, etc. In the former of these, the header is displayed in maroon text in a much smaller font, similar to that used in the topics. In the latter, the topic is displayed based on what I configured in the Layout Customization dialog; much larger in white text on a black background. In each case the heading text serves as a link to the default display topic shown when the help file is launched, which is fine. However, how do I get the header to be consistent across all screens (topics and TOC, Index, etc. alike)???
    As a result of these issues with the Theme1_Standard layout, I'm trying to import a different Responsive HTML5 screen layout than the two provided within RoboHelp HTML 11 (Standard and Government). I did some digging in the program help and found another layout I'd like to use (Theme3_Black.zip) at RoboHelp screen profiles and layouts. I tried importing the new layout, but it's looking for a .SLZ file and the only one in the files that came with the ZIP file is SLZConfig.xml, and I don't think that's what I need, though quite honestly, I don't know.
    I extracted the contents of the ZIP folder to a folder in the !ScreenLayout! folder within the RoboHelp project, but when I open the project, I don't see Theme3_Black as an option. I need to figure out how to import this screen layout because the color scheme matches the one used in the program for which I am writing the help. How do I import and apply this other screen layout???
    Any tips, tricks, or guidance on any or all of these items would be GREATLY appreciated.
    Thanks much in advance,
    Dave

    Item two of the original post is also something I am having issues with:
    "Secondly, the text in the header for the topic screens appears differently than the one on the screens for the TOC, Index, Search, etc. In the former of these, the header is displayed in maroon text in a much smaller font, similar to that used in the topics. In the latter, the topic is displayed based on what I configured in the Layout Customization dialog; much larger in white text on a black background. In each case the heading text serves as a link to the default display topic shown when the help file is launched, which is fine. However, how do I get the header to be consistent across all screens (topics and TOC, Index, etc. alike)???"
    We have the text toggle between red, white and blue depending upon the topic selected. In the customize Selected Layout we have the title color set to white. It seems to think that it is a link and I would like to know how I can force the text to be white and to stay that way no matter which topic is selected.

  • Need help with a JOIN query

    Hi,
    I am looking for the following result:
    PROVIDER_ID     SPECIALTY     BUCKET     CODE     RATING     FEE
         1     FP                 EM     100     9     20
         1     FP                 SP     300     15     0
         1     INFUS                 EM     100     3     20
         1     INFUS                 EM     200     6     15The base tables are provided below in the with clause. What I am trying to do is, where "code" matches show the fee from t1 else show 0.
    I tried a few variotions but just can't seem to get it right.
    with t1 as
    select 1 as provider_id, 100 as code, 20 as fee, 10 as default_multiplier from dual union all
    select 1 as provider_id, 200 as code, 15 as fee, 30 as default_multiplier from dual
    , t2 as
    select 100 as code, 'INFUS' AS specialty, 'EM' AS bucket, 3 as rating from dual union all
    select 200 as code, 'INFUS' AS specialty, 'EM' AS bucket, 6 as rating from dual union all
    select 100 as code, 'FP' AS specialty, 'EM' AS bucket, 9 as rating from dual union all
    select 300 as code, 'FP' AS specialty, 'SP' AS bucket, 15 as rating from dual
    SELECT   t1.provider_id
           , t2.specialty
           , t2.bucket
           , t2.code
           , t2.rating
           , t1.fee
    FROM     t1, t2
    ORDER BY 1, 2, 3Any help will be appreciated.
    Thanks.

    Could I possibly add one more twist to this.
    The current result:
    PROVIDER_ID SPECI BU       CODE     RATING        FEE
              1 FP    EM        100          9         20
              1 FP    SP        300         15          0
              1 INFUS EM        100          3         20
              1 INFUS EM        200          6         75
              2 FP    EM        100          9         40
              2 FP    SP        300         15          0
              2 INFUS EM        100          3         40
              2 INFUS EM        200          6          0
              3 FP    EM        100          9          0
              3 FP    SP        300         15          0
              3 INFUS EM        100          3          0
              3 INFUS EM        200          6         60The current code:
    with t1 as
    select 1 as provider_id, 100 as code, 20 as fee, 10 as default_multiplier from dual union all
    select 1 as provider_id, 200 as code, 75 as fee, 10 as default_multiplier from dual union all
    select 1 as provider_id, 500 as code, 75 as fee, 10 as default_multiplier from dual union all
    select 2 as provider_id, 100 as code, 40 as fee, 20 as default_multiplier from dual union all
    select 3 as provider_id, 200 as code, 60 as fee, 30 as default_multiplier from dual
    , t2 as
    select 100 as code, 'INFUS' AS specialty, 'EM' AS bucket, 3 as rating from dual union all
    select 200 as code, 'INFUS' AS specialty, 'EM' AS bucket, 6 as rating from dual union all
    select 100 as code, 'FP' AS specialty, 'EM' AS bucket, 9 as rating from dual union all
    select 300 as code, 'FP' AS specialty, 'SP' AS bucket, 15 as rating from dual
    , t3 as
    SELECT   t1.provider_id
           , t2.specialty
           , t2.bucket
           , t2.code
           , t2.rating
           , CASE t1.code
                WHEN t2.code
                   THEN t1.fee
                ELSE 0
             END AS fee
           , RANK () OVER (PARTITION BY t1.provider_id, t2.specialty, t2.bucket, t2.code ORDER BY CASE t1.code
                 WHEN t2.code
                    THEN t1.fee
                 ELSE 0
              END DESC) AS the_rank
        FROM t1
           , t2
    SELECT DISTINCT provider_id
                  , specialty
                  , bucket
                  , code
                  , rating
                  , fee
               FROM t3
              WHERE the_rank = 1
           ORDER BY 1
                  , 2
                  , 3
                  , 4I added the code 500 to t1. Howevere, I don't want this code to show up in the result becuase it is does not exist in t2.
    I also added code 200 to t1, to see if that shows properly.
    I had to do the rank, becuase I need the proper count of rows.
    In reality the row counts are:
    t1: 20 Million
    t2: 10 Thousand.
    So, I would like to avoid doing DISTINCT and ANALYTIC functions on this large set, so any better way of achiving the same result, with a better statement.
    Thanks.

  • Need help with MAX function to return values

    I am trying to create a report to return slow moving inventory data. One of the requests is that it return only the latest date that an item transacted upon. One sheet will show the last receipt date for a part, another will show the last time a part was issued or shipped on a sales order.
    The hiccup is that it is returning every single last time that an item was received, and every single last issuance of the material (on the second sheet) of items on hand.
    Could someone help me to define the max value function? As listed below, and many variations, the sheet comes up with no data or corrupt dates.
    MAX(Transaction Date MAX) OVER(PARTITION BY Material Transactions.Item ORDER BY Material Transactions.Item )
    Still returns both the following when in reality I just want the one with the most recent date (April 2010).
    100034     BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT     A400M     AB01D..     $0.00     WIP component issue     11-Sep-2009     -3
    100034     BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT     A400M     AD01D..     $0.00     WIP component issue     13-Apr-2010     -16
    Thank you for your assistance.
    Becka

    Hi Becka
    It does look correct. When I look at your data I can see 2 different items:
    100034 BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT A400M AB01D.. $0.00 WIP component issue 11-Sep-2009 -3
    100034 BNDSCE-105 - QUALITY BEARINGS OR EQUIVILANT A400M AD01D.. $0.00 WIP component issue 13-Apr-2010 -16
    One is AB01D and the other being AD01D. Is this expected?
    To get the right date you might want to PARTITION BY the BNDSCE-105 which might be the Item Number?
    If you can get your calculation to return the correct date then you next need to put in a new condition where the Transaction Date = MAX Transaction Date
    One part of the function that I would question is the use of MAX in both parts like this: MAX(Transaction Date MAX). You might be better just using MAX(Transaction Date) OVER ......
    Does this help?
    Best wishes
    Michael

  • Need help with converting a query to maxDB

    Hello,
    I'm experienced in SQL Server however not yet familiar with the MaxDB functions very well.
    I need to convert the following WHERE clause in a query to one that can run on MaxDB:
    WHERE DATEADD(MILLISECOND, Timestamp, '19000101') >= DATEADD(YEAR, DATEDIFF(YEAR, '19000101', DATEADD(DAY, -10, GETDATE())), '19000101')
       AND DATEADD(MILLISECOND, Timestamp, '19000101') < DATEADD(DAY, -9, DATEADD(DAY, DATEDIFF(DAY, '19000101', GETDATE()), '19000101'))
    Rgds,
    Roy

    Hi Elke,
    Thanks, I'll try that.
    I don't want any data from the last 9 days not from the first 9 days of the year, so if today is 17/5/2010 the BETWEEN will be: 1/1/2010 and 8/5/2010 and if today was 10/2/2010 for example the BETWEEN would have been: 1/1/2010-1/2/2010.
    HOWEVER, if today was 5/1/2010 then the BETWEEN should automatically adjust itself to 2009 and check for: 1/1/2009-27/12/2009 since when rolling 5/1/2010 10 days backwards we're still in 2009, so the query needs to first rollback and then make the dates reference.
    I don't believe that what you have provided answers these requirements but than again I might be wrong...
    Rgds,
    Roy

  • Need help with multi database query.

    Hello,
    I am working on a query between multiple databases to be view on a web app.  We have multiple web apps and we are integrating some functionality between them all into one page. 
    The data will be for a delegate someone sets for themselves (they can have more then one also).  I need a way to pull the data view it as follows.
    User, UserNumber, DelegateName, ForApp, ForApp, ForApp, ForApp, ForApp, ForApp
    I have had no problem pulling the delegates themselves and which apps they are a delegate for,  but not which person they are the delegate for.
    SELECT DISTINCT
    dbo.Employee.Position_Num AS Delegate_Position, dbo.Employee.Name AS [Delegate Name],
    (CASE WHEN Hierarchy.dbo.Employee.Position_Num = CVI_Delegate.Delegate THEN 1 ELSE 0 END) AS For_CVI,
    (CASE WHEN Hierarchy.dbo.Employee.Position_Num = Travel_Delegate.Delegate THEN 1 ELSE 0 END) AS For_Travel,
    (CASE WHEN Hierarchy.dbo.Employee.Position_Num = Dept_Deposits_Delegate.Delegate THEN 1 ELSE 0 END) AS For_DeptDeposit,
    dbo.OKCorral_Delegate.For_UserRoles AS For_OkCorralUR, dbo.OKCorral_Delegate.For_FiscalApprover AS For_OkCorralFA,
    (CASE WHEN Hierarchy.dbo.Employee.Position_Num = Reqs_Delegate.Delegate THEN 1 ELSE 0 END) AS For_Reqs
    FROM dbo.Employee LEFT OUTER JOIN
    Reqs.dbo.Delegate AS Reqs_Delegate ON dbo.Employee.Position_Num = Reqs_Delegate.Position LEFT OUTER JOIN
    DeptDeposits.dbo.Delegate AS Dept_Deposits_Delegate ON dbo.Employee.Position_Num = Dept_Deposits_Delegate.Position LEFT OUTER JOIN
    CVI.dbo.Delegate AS CVI_Delegate ON dbo.Employee.Position_Num = CVI_Delegate.Position LEFT OUTER JOIN
    dbo.OKCorral_Delegate ON dbo.Employee.Position_Num = dbo.OKCorral_Delegate.Position LEFT OUTER JOIN
    Travel.dbo.Delegate AS Travel_Delegate ON dbo.Employee.Position_Num = Travel_Delegate.Position
    This query works fine.  The problem I run into is I have to use the same Employee table to get the EmployeeName and Number
    Which will be used for both the person and the delegate.  Any ideas will be a great help.  It had been suggested I use a procedure to accomplish this, but I have no idea where to start that at.  I also have tried a nested sbu-query but since
    a person can have more then one delegate for an app,  this through errors.  Thanks.
    George Fields

    Ok,  here are the tables Travel Application Database/Delegate Table
    INSERT INTO [Travel].[dbo].[Delegate]
    ([Position]
    ,[Delegate]
    ,[StartDate]
    ,[EndDate]
    ,[CreateDate]
    ,[EditDate])
    VALUES
    (<Position, char(6),>
    ,<Delegate, char(6),>
    ,<StartDate, datetime,>
    ,<EndDate, datetime,>
    ,<CreateDate, datetime,>
    ,<EditDate, datetime,>)
    GO
    Requistions Application /Table Delegates
    INSERT INTO [Reqs].[dbo].[Delegate]
    ([Position]
    ,[Delegate]
    ,[StartDate]
    ,[EndDate]
    ,[CreateDate]
    ,[EditDate])
    VALUES
    (<Position, char(6),>
    ,<Delegate, char(6),>
    ,<StartDate, datetime,>
    ,<EndDate, datetime,>
    ,<CreateDate, datetime,>
    ,<EditDate, datetime,>)
    GO
    Heirarchy Database for Purchasing Application / Delegates Table
    INSERT INTO [Hierarchy].[dbo].[OKCorral_Delegate]
    ([Dept_Campus]
    ,[For_DeptNum]
    ,[Position]
    ,[Delegate]
    ,[StartDate]
    ,[EndDate]
    ,[CreateDate]
    ,[EditDate]
    ,[For_FiscalApprover]
    ,[For_UserRoles])
    VALUES
    (<Dept_Campus, char(2),>
    ,<For_DeptNum, char(5),>
    ,<Position, char(6),>
    ,<Delegate, char(6),>
    ,<StartDate, datetime,>
    ,<EndDate, datetime,>
    ,<CreateDate, datetime,>
    ,<EditDate, datetime,>
    ,<For_FiscalApprover, bit,>
    ,<For_UserRoles, bit,>)
    GO
    Heirarchy Database / Employee Table
    INSERT INTO [Hierarchy].[dbo].[Employee]
    ([Dept_Num]
    ,[Position_Num]
    ,[Email]
    ,[Name]
    ,[Campus]
    ,[CWID]
    ,[Student]
    ,[Employee]
    ,[OPID]
    ,[Gender]
    ,[Birth_Date])
    VALUES
    (<Dept_Num, char(5),>
    ,<Position_Num, char(6),>
    ,<Email, varchar(75),>
    ,<Name, varchar(150),>
    ,<Campus, char(2),>
    ,<CWID, varchar(16),>
    ,<Student, char(1),>
    ,<Employee, char(1),>
    ,<OPID, char(4),>
    ,<Gender, char(1),>
    ,<Birth_Date, char(8),>)
    GO
    The other two databases also have a delegate table similar to the ones above.  As you can see all information about an employee is linked by their position number in the Employee Table.
    The Position Number is used in the Position field and Delegate field of all the Delegate tables.
    I am needing to pull an employee (actually all of them) List them and then show delegates for them by which applications the delegate holds permissions too. Which is the purpose of the delegate.  So a delegate may only be a delegate for one application
    or multiple which is why I am pulling from multiple databases.
    George Fields

  • Need help with effect / function stop!

    Hi all!
    I tried to build some kind of custom pop-up-menu with fade
    in/out effect, however the menu sometimes (< very often, but not
    always) disappears while the mouse is still over it.
    So i defined a function to stop/abort the effects, but this
    doesn't work right.
    Could anybody please tell me, how to stop all functions,
    while the mouse is over a link?
    /// This is the container to appear / disappear:
    <div id="navislide" style="height:292px;
    overflow:hidden;">
    <a href="mylink.html" onMouseOver="killall();"
    onMouseOut="hideit();">mylink</a>
    </div>
    /// This is the link to show the container:
    <a href="#"
    onMouseOver="slidefadein.start();">mylink</a>
    <script type="text/javascript">
    function displayblock() {
    var thediv = document.getElementById('navislide');
    thediv.style.display= "block";
    slidetimer = setTimeout('slidefadeout.start();', 2000);
    hideit = function() {
    slidetimer = setTimeout('slidefadeout.start();', 2000);
    function displaynone() {
    var thediv = document.getElementById('navislide');
    thediv.style.display= "none";
    killall = function() {
    clearTimeout(slidetimer);
    slidefadeout.stop();
    slidefadein.stop();
    displayblock();
    slidefadeup.start();
    var slidefadein = new Spry.Effect.Fade("navislide", {from:0,
    to:100, toggle:false, setup:displayblock, finish:hideit});
    var slidefadeout = new Spry.Effect.Fade("navislide",
    {from:100, to:0, toggle:false, finish:displaynone});
    var slidefadeup = new Spry.Effect.Fade("navislide",
    {from:100, to:100, toggle:false});
    </script>
    Probably, its all about the "killall"-function, because when
    the mouse moves over the link, the function to abort all other
    effects, does not take effect.
    Thank you so much vor any kind of help or hint!!
    Cheers,
    idefix

    I would be most interested in a reply to this for I asked
    weeks ago how to use an onClick stop() function for the links in my
    page. I was given the stop function by VFusion (it is to stop
    panels from rotating), but I could never figure out how to actually
    get the function to stop the panels and could not get it no matter
    what I tried, eventually had to take the panel rotation out.

  • Newbie - need help with a SQL query for a bar chart

    Hi,
    I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORY
    Order by COUNT(PROJECT_ID) DESC
    The code from the other app was:
    select null link
    , FUNCTIONAL_AREA label
    , count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
    , count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
    , count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
    from PM_V2
    where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
    group by FUNCTIONAL_AREA
    Order by COUNT(PROJECT_ID) DESC
    I'm getting a "Failed to parse SQL query!" error when I try to run validation.
    Is this enough info for some assistance? Any help would really be appreciated.
    Thanks,
    Rachel

    Hello,
    This is more of an SQL question, rather than specifically APEX-related. It's notable that you say: I'm a new user on APEX with no real SQL knowledgeWhich is fine (we all have to start somewhere, afterall) but it might be worth de-coupling the problem from APEX in the first instance. I'd also strongly recommend either taking a course, reading a book (e.g. http://books.google.co.uk/books?id=r5vbGgz7TFsC&printsec=frontcover&dq=Mastering+Oracle+SQL&hl=en#v=onepage&q=Mastering%20Oracle%20SQL&f=false) or looking for a basic SQL tutorial - it will save you a whole lot of heartache, I promise you. Search the oracle forums for the terms "Basic SQL Tutorial" and you should come up with a bunch of results.
    Given that you've copied your query template from another, I would suggest ensuring that the actual query works first of all. Try running it in either:
    * SQL Editor
    * SQL*Plus
    * an IDE like SQL Developer (available free from the OTN: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html ) or TOAD or similar.
    You may find there are syntax errors associated with the query - it's difficult to tell without looking at your data model.
    select null link
    , CATEGORY label
    , count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
    , count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
    , count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
    , count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
    , count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
    from GRAPO_PROHEADTRK
    where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
    group by CATEGORYNote that your "order by" clause references a field called "PROJECT_ID", which exists in the old query but you've changed other similar references to "PROJECT_STATUS" - is it possible you've just missed this one? The perils of copy-paste coding I'm afraid...

  • Need help with this sql query

    the following query returns me the correct no of rows:
    select col1 from tab1 where
    col1 like '%'||chr(32)||'%';
    but i need to use my query in the following form and it doesn't return any row:
    select col1 from tab1 where
    col1 IN ('%'||chr(32)||'%');
    what am I doing worng?
    thanks in advance.

    Or in 10g (just recycling another example):
    WITH t AS (SELECT 'OPTI1457' || CHR(32) col1
                 FROM dual
                UNION
               SELECT 'OPT123' || CHR(9)
                 FROM dual
                UNION
               SELECT 'OPTIM12345'
                 FROM dual
    SELECT t.*
      FROM t
    WHERE REGEXP_LIKE(t.col1, CHR(32) || '|' || CHR(9))
    ;       C.

  • Need help with Update Join Query

    Hello, I am trying to update PID of #child table with PID of #parent table if "lastname & firstname are matches in both table" but my update query is giving some error. Please help and correct the update query. I am also trying to remove any
    blank space from starting and ending.
    drop table #parent,#child
    create table #parent (PID varchar(10), lastname varchar(50), firstname varchar(50))
    insert into #parent values ('100','Josheph','Sumali')
    insert into #parent values ('400','Karen','Hunsa')
    insert into #parent values ('600','Mursan  ','  Terry')
    create table #child (PID varchar(10), lastname varchar(50), firstname varchar(50))
    insert into #child values ('2','Josheph ','Sumali   ')
    insert into #child values ('5','Karen','Kunsi')
    insert into #child values ('6','Mursan ','Terry ')
    Update #child
    set PID = p.PID
    from #child C Join
    #parent p ON c.LTRIM(RTRIM(lastname) = p.LTRIM(RTRIM(lastname)
    AND c.LTRIM(RTRIM(firstname) = p.LTRIM(RTRIM(firstname)
    /* Requested Output */
    PID        lastname      firstname
    100        Josheph       Sumali
    600        Mursan        Terry

    create table #parent (PID varchar(10), lastname varchar(50), firstname varchar(50))
    insert into #parent values ('100','Josheph','Sumali')
    insert into #parent values ('400','Karen','Hunsa')
    insert into #parent values ('600','Mursan ',' Terry')
    create table #child (PID varchar(10), lastname varchar(50), firstname varchar(50))
    insert into #child values ('2','Josheph ','Sumali ')
    insert into #child values ('5','Karen','Kunsi')
    insert into #child values ('6','Mursan ','Terry ')
    Merge #child as t
    Using #parent as p ON (LTRIM(RTRIM(t.lastname)) = LTRIM(RTRIM(p.lastname))
    AND LTRIM(RTRIM(t.firstname)) = LTRIM(RTRIM(p.firstname)) )
    When Matched Then
    Update
    set PID = p.PID;
    update #child
    Set lastname=LTRIM(RTRIM(lastname)), firstname= LTRIM(RTRIM(firstname));
    update #parent
    Set lastname=LTRIM(RTRIM(lastname)), firstname = LTRIM(RTRIM(firstname));
    select * from #child
    select * from #parent
    drop table #parent,#child

Maybe you are looking for