Interactive Report - Distinct

Maybe I’m missing something but in an interactive report, can you perform a “Distinct” on selected columns? For example, an interactive report starts with 10 columns and every row is unique. A user then hides 5 columns. The result set now includes non unique rows. How does a user perform a distinct on these remaining 5 columns? I know group by is there, but that has a 3 column limit. What am I missing?

Hi Jari,
do you know if this feature is planned for the future?
I've the same request as T.H., i.e. selecting distinct rows in an interactive report.
Thank's,
Kirsten

Similar Messages

  • Count a distinct column value in an interactive report

    Hi,
    I'm struggling with this and would appreciate any pointers.
    I have built a view here:
    http://apex.oracle.com/pls/otn/f?p=11189:1
    The report can have duplicate column values. I'm tying to find a way using the interactive report functionality (i.e. without modifying the underlying SQL) to count a distinct column value. For example, in the example following the link I'd like to be able to count the unique customer_ids and return 7.
    This may be fundametally impossible depending on the way the SQL is generated for the interactive reports. If this is the case can anyone confirm this?
    Many thanks
    Yog.

    <B>"Not modifying views is fair enough. But not wrapping a SELECT around them? Really? Why? And as I said, that's imposible, the IR already does it."</B>
    This is not a problem. However for the IR's it's a development decision to keep all reported columns ( and analysis on these columns ) as a seperate development process to be controlled centrally by a seperate team. The point to remember is that the app looks at hundereds of views and it was decided that modifying each report to fit each instance would become cumbersome to manage and to put it simply there are not the resources to do it.
    again, I'm not here to justify any of that!
    <B>SELECT *" ? Every single time? Even when you want to populate a LOV with some names</B>
    No just the Reports. It is a very very simple app; a big list an a page for each report.
    <B>"I think you should always ask what you want, not less, not more"</B>
    I agree, and that should include select * from view.
    <B>"Why fetch data you don't want to see"</B>
    Some users will want to see some data from the view and other users will want to see other data, Over the whole user base someone somewhere will want to see all of it.
    <B> Actually, there is something good in this, in the future, when you will be asked to check and try to improve the load time of some page, here is the first place where you should look</B>
    Brilliant! Like it!!
    <B>Does it by any chance fetch a bunch of 20 meg LOBS and then discards them</B>
    No, Thankfully a few varchar2 columns and a lot of numeric columns, nothing huge. The reports are acutally pretty fast at the moment...

  • Interactive Report and DISTINCT keyword problem

    Hi,
    I am having a strange problem
    The following query works fine in SQL Developer and return ONLY 202 records.
    SELECT distinct "ATT_WARNINGS"."ID", "ATT_WARNINGS"."WARNING_NUM", "ATT_WARNINGS"."ISSUED", "ATT_WARNINGS"."ISSUED_DATE", "ATT_WARNINGS"."STDN_ID", "ATT_WARNINGS"."TOTAL_MISSED", "ATT_WARNINGS"."ISSUED_BY", "ATT_WARNINGS"."TERM_CODE_KEY", "ATT_VETI"."BLOCK_GROUP", "ATT_VETI"."STDN_NAME"
    bq. FROM "ATT_WARNINGS", "ATT_VETI"
    bq. bq. WHERE ( "ATT_VETI"."STDN_ID" = "ATT_WARNINGS"."STDN_ID" ) \\ AND ( "ATT_WARNINGS"."TERM_CODE_KEY" = '200920') \\ AND ("ATT_VETI"."BLOCK_GROUP" LIKE '%Day')
    When using that in Interactive Report I get the following:
    {color:#ff0000}+This query returns more then 10,000 rows, please filter your data to ensure complete results.+
    {color:#000000}Looks like the IR does not understand the keyword DISTINCT
    Can you help me guys?
    Thank you
    {color}{color}

    I must be sleepy.
    I was setting the max row count to 25 only!!
    I changed to 1000 and it works now :)

  • Interactive report performance problem over database link - Oracle Gateway

    Hello all;
    This is regarding a thread Interactive report performance problem over database link that was posted by Samo.
    The issue that I am facing is when I use Oracle function like (apex_item.check_box) the query slow down by 45 seconds.
    query like this: (due to sensitivity issue, I can not disclose real table name)
    SELECT apex_item.checkbox(1,b.col3)
    , a.col1
    , a.col2
    FROM table_one a
    , table_two b
    WHERE a.col3 = 12345
    AND a.col4 = 100
    AND b.col5 = a.col5
    table_one and table_two are remote tables (non-oracle) which are connected using Oracle Gateway.
    Now if I run above queries without apex_item.checkbox function the query return or response is less than a second but if I have apex_item.checkbox then the query run more than 30 seconds. I have resolved the issues by creating a collection but it’s not a good practice.
    I would like to get ideas from people how to resolve or speed-up the query?
    Any idea how to use sub-factoring for the above scenario? Or others method (creating view or materialized view are not an option).
    Thank you.
    Shaun S.

    Hi Shaun
    Okay, I have a million questions (could you tell me if both tables are from the same remote source, it looks like they're possibly not?), but let's just try some things first.
    By now you should understand the idea of what I termed 'sub-factoring' in a previous post. This is to do with using the WITH blah AS (SELECT... syntax. Now in most circumstances this 'materialises' the results of the inner select statement. This means that we 'get' the results then do something with them afterwards. It's a handy trick when dealing with remote sites as sometimes you want the remote database to do the work. The reason that I ask you to use the MATERIALIZE hint for testing is just to force this, in 99.99% of cases this can be removed later. Using the WITH statement is also handled differently to inline view like SELECT * FROM (SELECT... but the same result can be mimicked with a NO_MERGE hint.
    Looking at your case I would be interested to see what the explain plan and results would be for something like the following two statements (sorry - you're going have to check them, it's late!)
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two),
    sourceqry AS
    (SELECT  b.col3 x
           , a.col1 y
           , a.col2 z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5)
    SELECT apex_item.checkbox(1,x), y , z
    FROM sourceqry
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two)
    SELECT  apex_item.checkbox(1,x), y , z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5If the remote tables are at the same site, then you should have the same results. If they aren't you should get the same results but different to the original query.
    We aren't being told the real cardinality of the inners select here so the explain plan is distorted (this is normal for queries on remote and especially non-oracle sites). This hinders tuning normally but I don't think this is your problem at all. How many distinct values do you normally get of the column aliased 'x' and how many rows are normally returned in total? Also how are you testing response times, in APEX, SQL Developer, Toad SQLplus etc?
    Sorry for all the questions but it helps to answer the question, if I can.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Sum on Interactive Report.

    Hello, I've created an Interactive Report the contains a colummun whith hours like that "15:00"
    and I'm having a problem to sum this on the end of report.
    Someone have any ideia how i can do that?
    Thaks everybody!
    Edited by: LéoVic on 14/11/2012 07:40

    LéoVic wrote:
    Hello, I've created an Interactive Report the contains a colummun whith hours like that "15:00"A column like that should be of type INTERVAL DAY TO SECOND. Is it?
    and I'm having a problem to sum this on the end of report. APEX does not support INTERVAL data types in either standard or interactive reports.
    Someone have any ideia how i can do that?For an interactive report all I can suggest is converting the interval to decimal in the query and using that column in the IR sum, which will lose the interval formatting.
    It's possible to create a user-defined aggregate function to sum intervals, and use this in a standard APEX report: +{message:id=9371014}+
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.

  • Interactive Report (IR) column heading: filtered items number & flashlight

    Hello everyone
    several hours of searching through the forum did not provide me with leads or answers to 2 questions. Both are related to the IR column heading menu and options. Let's start with a copy of the relevant portion of the interactive report help screen:
    Column Heading Menu
    Clicking on any column heading exposes a column heading menu.
    [snip]
    Text Area is used to enter case insensitive search criteria (no need for wild cards). Entering a value will reduce the list of values at the bottom of the menu. You can then select a value from the bottom and the selected value will be created as a filter using '=' (e.g. column = 'ABC'). Alternatively, you can click the flashlight icon and the entered value will be created as a filter with the 'LIKE' modifier (e.g. column LIKE '%ABC%').
    List of Unique Values contains the first 500 unique values that meet your filters. If the column is a date, a list of date ranges is displayed instead. If you select a value, a filter will be created using '=' (e.g. column = 'ABC').
    Q1: Why do I not see a flashlight icon? I looked everywhere in the report definition to "enable" it, to no avail.
    Q2: Although we've found IRs to be incredibly useful and embraced by end users, we are having issues when dealing with large datasets. Let's look at searching for people's first/last name in our CONTACTS table. The table is ~28,000 names long. If one attempts to use Column Heading menu to "filter" for any name outside the first 500 unique values, the search does not work. Yes, I know that a workaround is to use Actions Menu icon filter... but, it sure is misleading to have a search which does not go beyond letter B in the list of last names. Furthermore, I do not see a way to DISABLE Column Heading Text Area, and avoid user confusion.
    I suspect that "List of Unique Values contains the first 500 unique values" was set for the performance purposes. Is there a way to set that number anywhere? Have it customized for each column? (columns county and state could be <100, for example)
    Thanks an advance to any advice.
    Vojin

    @Prabodh: what you say is only changing the default image for the column selector at the search bar level. What i think is being looked for is an icon on the popup when a column header is clicked in an IR. Don't bother: there is none.
    @Vojin, Tonibony:
    I also ran into this problem with IRs and the useless column header box. If you want to hide the unique values list, it is a bother. First of all, you can't disable the finding of values, this is embedded in the widget ajax code. Then if you want to just hide the list, there is no real event you can hook up to. The poping up of the box is an ajax callback, and is part of the IR javascript, but this callback does not trigger any event (no apexafterrefresh for example, which is understandable). I've worked around this by overriding/extending the method which is called when ajax is done loading within the IR code. Here is a piece of code which does this (call it on page load):
       // _Finished_Loading is called when the IR is done with a GET action
       // because the posts are synchronous in this report, and no events
       // or hooks are available, the best way to preserve functionality
       // yet extending it is to override the original function, yet
       // keep the base code
       // apexafterrefresh cant be used since it is not triggered after
       // the widget ajax
       var or_Finished_Loading = gReport._Finished_Loading;
       gReport._Finished_Loading = function(){
           //overriden, but still have to call orinigal!
          or_Finished_Loading();
          //SORT_WIDGET is the widget containing all the header elements
          if(gReport.current_control=='SORT_WIDGET'){
             // hide the original dropdown box
             $("#apexir_rollover_content").hide();
       };If you're interested, i've recently developed a plugin for use in my interactive reports which works around some of these limitations. For me, the headers are much more userfriendly than the actions > filter menu. So what i've done is: hide the orignal dropdown, and turn the searchfield into an autocompletion field, which will progressively search through the distinct column values in the IR with ajax. I've even made an option to have the searching behave like a "contains" or a "like". I'm working on a post about it, with background, documentation and source code. I'll add a post here when i finish it up, you can see if that helps you.
    I also would like to add a button later on which will simply add the entered value as a "like %value%" filter. I know how to do this and what to do, i'm just a bit short on time at the moment. I actually think that adding the button in the layout may be the hardest part... :')

  • Interactive report - order column by other column values

    Hi Oracle experts,
    could you please advise how to order column A by values of column B in Interactive report ?
    When clicking on header of "Countries" column in order to sort it acs/desc I would like to order it by values of column "Sort_order" which stores values from 1 to 100.
    The goal is to order "Countries" not alphabetically, but according to values of "Sort_order" column.
    Any ideas?
    Thanks in advance for your help.
    Best regards,
    Konrad

    962622 wrote:
    Hi Oracle experts,Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "962622".
    When you have a problem you'll get a faster, more effective response by providing as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    could you please advise how to order column A by values of column B in Interactive report ?
    When clicking on header of "Countries" column in order to sort it acs/desc I would like to order it by values of column "Sort_order" which stores values from 1 to 100.
    The goal is to order "Countries" not alphabetically, but according to values of "Sort_order" column.
    Any ideas?I'm not an expert on Interactive Reports, so there may be a less brute force method using the built-in features, but here's an approach that's worked in the past.
    Modify the query to generate the column as:
    '<!-- '|| to_char(sort_order, '009') || ' -->' || countryi.e. prefix the country name with an HTML comment containing the required ordinal number. This won't be visible in the report, but will be considered when sorting in SQL.
    In the IR Column Attributes set the column's Display Text As property to Standard Report Column so APEX won't escape the HTML tags.
    This method has side effects: some IR filters won't work; aggregate calculations can't be applied to the column; and report exports contain the HTML rather than the expected value.
    Edited by: fac586 on 02-Oct-2012 13:28
    From APEX 4.2 IR columns have support for HTML Expressions, so Re: Report formatting/sorting issue using a hidden column and HTML Expression should be used, as it's purely declarative and provides better separation of concerns. (Still a problem on report exports though. Whilst the sort column can be suppressed using a condition, the hidden column can't be "unhidden" to replace it.)

  • Interactive report: How to display "count" column on total data set?

    Hi,
    I'm a relative newbie to APEX and would appreciate some help with the following:
    I have an interactive report that will usually contain around 8000 rows.
    I need to report the total number of distinct values in one of the columns - but I need to get around the limitation of APEX where it only counts the number of rows displayed on the screen.
    I thought to create a separate region and use a separate SQL query to show the full total regardless of the number of rows displayed - however, I've now got the problem of not being able to access the interactive report "query", so, for example, if someone running the report adds a filter, I need the total to report with this new filter applied.
    Does anyone know if I can:
    a) get around the the limitation of only counting the number of rows displayed?
    or, if not,
    b) how to access the interactive report "query" that is being run?
    or
    c) any other way of doing this!?
    I do hope this makes sense. Thanks in advance for any help....
    Helen

    Hi all,
    Thanks for your responses. They really are much appreciated.
    I had hoped to spend some time on this over the weekend - but haven't got round to it. I'll work on it again tomorrow and will certainly look at the thread you mentioned Tony.
    Sorry I'm not being very clear about what I want. Why are these things always so hard to explain in words :o)
    I'll have another go....
    I have an interactive report that would report around, say, 8000 rows. Obviously I don't want to display all 8000 on the screen so I'll probably display them in chunks of 15 rows. If I use the aggregation function on the report, I can add a count of the distinct account numbers to the bottom of the display, but it will only count the ones displayed on the screen. I need the count to be of all the rows - so 8000 instead of 15 - but still displaying only 15 rows. When a user then applies a filter to the report, I need the count to change in accordance with the filter - so if the number of rows returned as a result of the filter is now 4000 instead of 8000, I need the count to now say 4000 instead of 8000 even though still only 15 rows are actually displayed on the screen.
    I'll try and pre-empt the questions...
    1) There will always be duplicate account numbers in there so the count will never be the actual number of rows - but I'm simplifying above to help explain the problem better
    2) Why would they want 8000 rows? Don't ask. I'm sure it's something to do with exporting the lot into an excel spreadsheet but they'll never admit it :o)
    I hope this makes more sense......
    Thanks again!!
    Helen
    P.S. Almost forgot again... I'm using Apex 4.1 on the Oracle hosted environment which I assume is 11g.

  • Issues with the Radio Group and interactive report

    Hi,
    I have an interactive report that shows customer names and associated revenues... I want my users to be able to filter customer list by Province and by City in a way that when the user select a province then only associated cities show up (driven by a table)... for the filtration I am using 2 Radio Group items (one for Provinces and the other one for Cities)
    Everything is working fine, except for the fact that when I select a province (let's say Prov A) and then select a city (let's say City A1) and again when I select another Province (let's say Prov B) I get the list of all cities associated to Prov B + city A1... Not sure why my previous selection of City is showing up with the list of new cities when I change the province... I SHOULD BE ABLE TO REST ALL CITIES WHEN A NEW PROVINCE IS SELECTED
    here is the code
    For interactive report
    select     CUSTOMER_NAME,
         SUM(YTD) AS YTD
    from     T_TABLEA
    where
    (PROVINCE=
    CASE
    when :P2_PROV = 'All' THEN PROVINCE
    ELSE :P2_PROV
    END
    and
    (CITY=
    CASE
    when :P2_CITY = 'All' THEN CITY
    ELSE :P2_CITY
    END
    GROUP BY CUSTOMER_NAME
    For Province Radio Group I am using a static list:
    STATIC2:All;All,Alberta;AB,Ontario;ON,Quebec;PQ,British Columbia;BC
    For City, I am using a dynamic list using following code:
    select 'All', 'All' return from dual
    union
    select distinct INITCAP(CITY) display_value, CITY return_value
    from T_TABLEA
    where
    Province = :P2_PROV
    order by 1
    Thanks

    Check the session state of items P2_PROV and *:P2_CITY* when the issue occurs and run the LOV query separately with the session state values.
    If that too fetches it wrongly, then you would need to change your query.

  • How to apply an accent-insensitive search to an interactive report?

    Hello all!
    I'm trying to put an accent-insensitive search on an interactive report here. For example, if I'm on the page that has the interactive report and if I click the column header of the interactive report, I get to see a search bar that dynamically shows the results that match your input. Now, when I enter "jager", I want to see *"Jägermeister"* as a search result. The search must be accent-insensitive, so that I don't have to enter the ä every time.
    My code is as follows:
    SELECT name
    FROM food_1
    WHERE name LIKE 'Jagerme%'
    AND NLSSORT(name) IS NOT NULL
    ORDER BY NLSSORT(name, 'NLS_SORT=GENERIC_M_AI');As you can see, I first tried getting a result through the SQL Command. It should return the row that has "Jägermeister" as name. However, it doesn't. It tells me "No data found". So, how do I alter my NLSSORT to search accent-insensitive?
    Some extra information, I edited the interactive report source to the following:
    SELECT DISTINCT a.name, a.foodid
    FROM food_1 a INNER JOIN foodunit_1 c
    ON a.foodid = c.foodid
    WHERE a.foodlanguageid = :P17_SET_LANGUAGE
    AND NLSSORT(a.name) IS NOT NULL
    ORDER BY NLSSORT(a.name, 'NLS_SORT=GENERIC_M_AI');I also tried doing ALTER SESSION before the SQL code, but it still gives me the same result: No data found.
    I'm using APEX version 4.1.1.00.23.
    Help and suggestions are more than welcome. ;)
    Thanks in advance,
    Magali

    I found it out!
    It's really ridiculous, actually.
    Remember this code?
    execute immediate ('ALTER session SET NLS_COMP=LINGUISTIC');
    execute immediate ('ALTER session SET NLS_SORT=BINARY_AI');Well, this code is perfectly fine. Only, it doesn't execute. This is because it was misplaced...This process is not executed when you place it in the current authentication scheme, under the "Post-Authenticatoin Process" part.
    You might wonder why this is, but I have the explanation to that.
    You see, when you use an interactive report, the page processing isn't executed when you use the search function of that interactive report... Because it's an interactive report, I guess.
    BUT.
    An ALTER SESSION from the security attributes, that will execute.
    So, the solution to my problem was, in this case:
    Go to "Application" --> "Shared Objects" --> "Security Attributes" --> "Database Session" --> "Initialization PL/SQL code". In there, you need to put:
    BEGIN
    EXECUTE IMMEDIATE 'ALTER session SET NLS_COMP=LINGUISTIC';
    EXECUTE IMMEDIATE 'ALTER session SET NLS_SORT=BINARY_AI';
    END;By doing this, there's no longer any need to edit the source code of the report!
    So, that's the solution. I can finally enter text without special characters in it, and get the corresponding data, with special characters... Ahh. :)
    I hope this is helpful to others as well now. ;)

  • How to combine three tables in interactive report in apex

    Hi All,
    How to display the below Query in interactive report apex!!
    select distinct market d, marketid r from (
    select market, marketid,p.productid, h.hubid, s.begin_date, s.stripname
    from d_st s, d_ma x, d_hu h, d_pro p
    where s.ice_strip_id=x.ice_strip_id
    and x.baseproductid=p.productid
    and x.hubid=h.hubid
    and h.hubid=nvl(:P2__HUBID,-2)
    and p.productid=nvl(:P2__PRODUCTID,-2))g
    order by 2
    Thanks,
    Anoo..

    just paste your query into the source field of the interactive report.. thats it.

  • Oracle APEX 4.0  -  Interactive Report - Table Column Filter Issue

    Environment: Oracle APEX 4.0  -  Interactive Report - Table Column header Filter Issue
    We have developed an interactive report using Oracle APEX 4.0, which contains a record count of around 3,000 Rows. All the rows values are unique in nature. When we try to filter the same with the help of column header filter option available in the interactive report,We get only 1000 records.
    Could some one help us, why this behaviour under APEX Table Column Header Filter as if it does not display beyond 1000 distinct values.
    Is there a way or workaround on how to get all the records in the column header filter?
    Thanks in advance.
    Krish

    Hi
    Thanks for the advice and this issue has been moved to the below URL
    Oracle APEX 4.0 - Interactive Report - Table Column Filter Issue Posted: No
    Krish

  • Oracle APEX 4.0 - Interactive Report - Table Column Filter Issue Posted: No

    Environment: Oracle APEX 4.0 - Interactive Report - Table Column header Filter Issue
    We have developed an interactive report using Oracle APEX 4.0, which contains a record count of around 3,000 Rows. All the rows values are unique in nature. When we try to filter the same with the help of column header filter option available in the interactive report,We get only 1000 records.
    Could some one help us, why this behaviour under APEX Table Column Header Filter as if it does not display beyond 1000 distinct values.
    Is there a way or workaround on how to get all the records in the column header filter?
    Thanks in advance.
    Krish

    Krish,
    Interactive report has hard coded limit to display 1000 rows of column filter LOV for performance. Unfortunately, the limit cannot be changed. The workaround is to define a Column Filter LOV for the column instead of using "Default Based on Column Type".
    Regards,
    Christina

  • Increase the Performance of Search In Interactive Report

    Hi,
    I created a report which has about 10000+ records. To load the report it is not taking much time. But when i make a search in interactive report it is taking lot of time. Please suggest me how to increase the performance of interactive search.
    I am using Oracle apex 3.2 and Oracle 10g XE database.
    Please suggest me.
    Thanks
    Sudhir

    Hi,
    1) I am using Row Ranges Pagination from X to Y
    2) To Execute it takes about 1.15 seconds
    3) This is the function am using to make a call
    FUNCTION  FUNC_ORACLE_CONTRACT(P_SERIAL_NUMBER IN VARCHAR2,P_FLAG IN VARCHAR2) 
    RETURN VARCHAR2
    AS
    L_LOCATION_ID    NUMBER;
    L_SYSTEM_ID      VARCHAR2(200);
    L_ENTITLEMENT_ID VARCHAR2(200);
    L_CREATED_DATE   DATE;
    L_COMPANY_NAME   VARCHAR2(500);
    L_LEGAL_NAME     VARCHAR2(500);
           SELECT DISTINCT LOCATION_ID, SYSTEM_ID, ENTITLEMENT_ID, CREATED_DATE       
           FROM CUSTOMER_LICENSES
           WHERE PRODUCT_SERIAL_NUMBER = P_SERIAL_NUMBER OR
                 ENTITLEMENT_ID = P_SERIAL_NUMBER        OR
                 ACTIVATION_ID = P_SERIAL_NUMBER ;
    BEGIN
      OPEN C1;
      FETCH C1 INTO L_LOCATION_ID, L_SYSTEM_ID, L_ENTITLEMENT_ID, L_CREATED_DATE; 
        IF P_FLAG = 'COMPANY_ID' THEN
           SELECT COMPANY_NAME || ' (C)' INTO L_COMPANY_NAME
           FROM CUSTOMER_LOCATIONS
           WHERE LOCATION_ID = L_LOCATION_ID;
             IF L_COMPANY_NAME IS NULL THEN
                 SELECT LEGAL_NAME || ' (P)' INTO L_LEGAL_NAME
                 FROM PARTNER_LOCATIONS
                 WHERE ID = L_LOCATION_ID;
               RETURN L_LEGAL_NAME  ;
             ELSE
                RETURN L_COMPANY_NAME ;        
              END IF;
        ELSIF  P_FLAG = 'SYSTEM_ID' THEN
          RETURN L_SYSTEM_ID;
        ELSIF  P_FLAG = 'ENTITLEMENT_ID' THEN
          RETURN L_ENTITLEMENT_ID;
        ELSIF  P_FLAG = 'LOCATION_ID' THEN
          RETURN L_LOCATION_ID;   
       END IF;  
    CLOSE C1; 
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN NULL;
    WHEN OTHERS THEN
    RETURN NULL;
    END FNC_ORACLE_CONTRACTS;Edited by: Sudhir_Meru on Apr 9, 2013 4:11 PM

  • Making a customized Interactive Report visible to all users?

    Hi,
    Does anyone know if it is possible to make a customized Interactive Report visible to all Apex users, and if so - how?
    The Apex application I'm trying to do this in has a customized authentication scheme with each user having a distinct :APP_USER variable.

    Hi,
    you need to save the IRR as an APEX developer during the runtime of your application. Just make your IRR changes and save it as default.
    You could also take a look into this post: http://dpeake.blogspot.com/2009/01/preserving-user-saved-interactive.html,
    Best regards,
    Tobias

Maybe you are looking for

  • Tds not showing when posting in f-48

    Hi, When i am posting vendor downpayment by the T code f-48,but the time of simulating the automatic TDS lines are not flowing. Regards, Reah

  • Reg : Daily i got 120 ABAP Runtime Error with in 40 Mins(Early Morning)

    Dear Friends, I got following errors regularly. when i run t.code RSBTCDEL and RSSNAPDL. what can i do? then Regularly morning i got same morethan 120 Error. User is SAPSYS 000 Client. How can avoid this type of ABAP Runtime Error. Runtime Errors    

  • TS1559 i reset and restored is my only option to take it in?

    I don't know what to do anymore it's been months since I was able to use my internet someone help i restored and reset nothing works anymore HELP please?

  • Can I use iPad for internet games?

    Can I play Scrabble at Pogo.com using a WiFi iPad? They no longer allow me to use a 10.4 OS PowerbookG4 or my Mac G5 due to Java and Flash updates which no longer work on the older OS.  I am 70 years old, have had Macs since invented and I am not int

  • Having problems updating my 16gb touch 1g to firmware 2.2

    Hello I purchased an ipod touch 16gb, it had an old firmware so once connected and available to itunes I updated the firmware to 2.1 which required a purchase. I have filled my ipod with my pod casts and music from my libary but I am now unable to up