PDF Download doesn't keep an aggregate function result

Hello,
I have an interactive report that has a sum that I created using the aggregate function. When I download to a PDF, there is no sum.
Does anyone have a solution?
Thanks,
Matt

Hi Matt
At this time the Interactive Report Regions (IRR) don't support this functionality. I'm assuming that's what you're kicking-off the PDF generation from.
The only solution I am aware of is to set up an APEX Report & Template that contains the SUM function you require displayed in your PDF. Whilst this will deliver the result you're after, you will lose the flexibility of the IRR.
You may also want to add your comments/thoughts to this thread I started earlier.
[http://tinyurl.com/peu6b2]
If you need help with the APEX Report & Template option, please let me know.
Kind regards
Simon Gadd

Similar Messages

  • Download doesn't work; i keep getting "unable to find firefox.exe" even when I open from program files folder; working onwindows xp with service pack 3

    download doesn't work; i keep getting "unable to find firefox.exe" even when I open from program files folder; working onwindows xp with service pack 3

    As you can see below, when I right click, I have no such option.  In the User Account Settings, I'm operating as the "System Administrator".
    Any other suggestions?

  • Why doesn't PIVOT clause work with COLLECT aggregate function in 11g ?

    Hello all !
    I am really puzzled as to what is considered an aggregate function in the context of the PIVOT clause in 11g.
    I have been toying with quite a few things related to collections lately and this arose as an aside :
    CREATE TABLE TEST_COLL
       NODE_ID    VARCHAR2(15 CHAR) NOT NULL,
       NODE_VALUE VARCHAR2(45 CHAR) NOT NULL,
       NODE_LEVEL NUMBER(1)         NOT NULL
    CREATE OR REPLACE TYPE TREE_NODE AS OBJECT
       NODE_KEY  VARCHAR2( 15 CHAR),
       NODE_NAME VARCHAR2(127 CHAR)
    CREATE OR REPLACE TYPE TREE_NODES AS TABLE OF TREE_NODE NOT NULL;At this stage I am sure we all agree that the query
    SELECT NODE_LEVEL,
           CAST(COLLECT(TREE_NODE(NODE_ID, NODE_VALUE)) AS TREE_NODES) AS NODES
      FROM TEST_COLL
    GROUP BY NODE_LEVEL;is perfectly valid as the COLLECT function is an aggregate function according to the [Official Documentation|http://docs.oracle.com/cd/E11882_01/server.112/e10592/functions031.htm#i1271564]
    But then, one of the following two queries should work
    SELECT CAST(REGION_NODES     AS TREE_NODES) AS REGIONS,
           CAST(DEPARTMENT_NODES AS TREE_NODES) AS DEPARTMENTS,
           CAST(AREA_NODES       AS TREE_NODES) AS AREAS,
           CAST(CENTRE_NODES     AS TREE_NODES) AS CENTRES
      FROM (SELECT NODE_LEVEL, TREE_NODE(NODE_ID, NODE_VALUE) AS NODE
              FROM TREE_COLL
    PIVOT (COLLECT(NODE) FOR NODE_LEVEL IN (1 AS REGION_NODES,
                                             2 AS DEPARTMENT_NODES,
                                             3 AS AREA_NODES,
                                             4 AS CENTRE_NODES
    or (better)
    SELECT REGION_NODES     AS REGIONS,
           DEPARTMENT_NODES AS DEPARTMENTS,
           AREA_NODES       AS AREAS,
           CENTRE_NODES     AS CENTRES
      FROM (SELECT NODE_LEVEL, TREE_NODE(NODE_ID, NODE_VALUE) AS NODE
              FROM TREE_COLL
    PIVOT (CAST(COLLECT(NODE) AS TREE_NODES) FOR NODE_LEVEL IN (1 AS REGION_NODES,
                                                                 2 AS DEPARTMENT_NODES,
                                                                 3 AS AREA_NODES,
                                                                 4 AS CENTRE_NODES
           );yet, both fail with
    ORA-56902: expect aggregate function inside pivot operationInvestigating further, I found the same behaviour when using XMLAGG as the aggregate function in the PIVOT clause.
    Is this normal ? And if it is, is there any other way to achieve the result I was anticipating ?
    My version is
    SQL> SELECT BANNER FROM V$VERSION;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - ProductionThanks in advance
    Best Regards
    Philip

    Most likely a bug. But you can bypass it by using any other aggregate making sure group consists of a single row and apply collect to a pivoted value. Yes, the cost is double aggregation. And also there is another cost - you would need to create MAP member function otherwise aggreations like MAX/MIN, etc. will not work:
    CREATE OR REPLACE TYPE TREE_NODE AS OBJECT
       NODE_KEY  VARCHAR2( 15 CHAR),
       NODE_NAME VARCHAR2(127 CHAR),
       map member function f return varchar2
    Type created.
    CREATE OR REPLACE TYPE BODY TREE_NODE AS
      map member function f return varchar2 is
      begin
         return NODE_NAME;
      end f;
    end;
    Type body created.
    CREATE OR REPLACE TYPE TREE_NODES AS TABLE OF TREE_NODE NOT NULL
    Type created.
    SQL> select  *
      2    from  test_coll
      3  /
    NODE_ID NODE_VALUE NODE_LEVEL
    1       A                   1
    2       B                   2
    3       C                   3
    4       D                   4
    5       E                   1
    6       F                   2
    7       G                   3
    8       H                   4
    8 rows selected.
    SQL> Now:
    SELECT CAST(COLLECT(REGION_NODES)     AS TREE_NODES) AS REGIONS,
           CAST(COLLECT(DEPARTMENT_NODES) AS TREE_NODES) AS DEPARTMENTS,
           CAST(COLLECT(AREA_NODES)       AS TREE_NODES) AS AREAS,
           CAST(COLLECT(CENTRE_NODES)     AS TREE_NODES) AS CENTRES
      FROM (
            SELECT  ROWID RID,
                    NODE_LEVEL,
                    TREE_NODE(NODE_ID, NODE_VALUE) AS NODE
              FROM  TEST_COLL
    PIVOT (MAX(NODE) FOR NODE_LEVEL IN (
                                         1 AS REGION_NODES,
                                         2 AS DEPARTMENT_NODES,
                                         3 AS AREA_NODES,
                                         4 AS CENTRE_NODES
    REGIONS(NODE_KEY, NODE_NAME)                         DEPARTMENTS(NODE_KEY, NODE_NAME)                     AREAS(NODE_KEY, NODE_NAME)                           CENTRES(NODE_KEY, NODE_NAME)
    TREE_NODES(TREE_NODE('1', 'A'), TREE_NODE('5', 'E')) TREE_NODES(TREE_NODE('6', 'F'), TREE_NODE('2', 'B')) TREE_NODES(TREE_NODE('7', 'G'), TREE_NODE('3', 'C')) TREE_NODES(TREE_NODE('8', 'H'), TREE_NODE('4', 'D'))
    SQL> SY.

  • Trying to create a Histogram type/object for aggregate functions

    Hi,
    I am trying to create an aggregate function that will return a histogram
    type.
    It doesn't have to be an object that is returned, I don't mind returning
    a string but I would like to keep the associative array (or something
    else indexed by varchar2) as a static variable between iterations.
    I started out with the SecondMax example in
    http://www.csis.gvsu.edu/GeneralInfo/Oracle/appdev.920/a96595/dci11agg.htm#1004821
    But even seems that even a simpler aggregate function like one strCat
    below (which works) has problems because I get multiple permutations for
    every combination. The natural way to solve this would be to create an
    associative array as a static variable as part of the Histogram (see
    code below). However, apparently Oracle refuses to accept associate
    arrays in this context (PLS-00355 use of pl/sql table not allowed in
    this context).
    If there is no easy way to do the histogram quickly can we at least get
    something like strCat to work in a specific order with a "partition by
    ... order by clause"? It seems that even with "PARALLEL_ENABLE"
    commented out strCat still calls merge for function calls like:
    select hr,qtr, count(tzrwy) rwys,
    noam.strCat(cnt) rwycnt,
    noam.strCat(tzrwy) config,
    sum(cnt) cnt, min(minscore) minscore, max(maxscore) maxscore from
    ordrwys group by hr,qtr
    Not only does this create duplicate entries in the query result like
    "A,B,C" and "A,C,B" it seems that the order in rwycnt and config are not
    always the same so a user can not match the results based on their
    order.
    The difference between my functions and functions like sum and the
    secondMax demonstrated in the documentation is that secondMax does not
    care about the order in which it gets its arguments and does not need to
    maintain an ordered set in order to return the correct results. A good
    example of a built in oracle function that does care about all its
    arguments and probably has to maintain a similar data structure to the
    one I want is the PERCTILE_DISC function. If you can find the code for
    that function (or something like it) and forward a reference to me that
    in itself would be very helpful.
    Thanks,
    K.Dingle
    CREATE OR REPLACE type Histogram as object
    -- TYPE Hist10 IS TABLE OF pls_integer INDEX BY varchar2(10),
    -- retval hist10;
    -- retval number,
    retval noam.const.hist10,
    static function ODCIAggregateInitialize (sctx IN OUT Histogram)
    return number,
    member function ODCIAggregateIterate (self IN OUT Histogram,
    value IN varchar2) return number,
    member function ODCIAggregateTerminate (self IN Histogram,
    returnValue OUT varchar2,
    flags IN number) return number,
    member function ODCIAggregateMerge (self IN OUT Histogram,
    ctx2 IN Histogram) return number
    CREATE OR REPLACE type body Histogram is
    static function ODCIAggregateInitialize(sctx IN OUT Histogram) return
    number is
    begin
    sctx := const.Hist10();
    return ODCIConst.Success;
    end;
    member function ODCIAggregateIterate(self IN OUT Histogram, value IN
    varchar2)
    return number is
    begin
    if self.retval.exist(value)
    then self.retval(value):=self.retval(value)+1;
    else self.retval(value):=1;
    end if;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateTerminate(self IN Histogram,
    returnValue OUT varchar2,
    flags IN number)
    return number is
    begin
    returnValue := self.retval;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateMerge(self IN OUT Histogram,
    ctx2 IN Histogram) return number is
    begin
    i := ctx2.FIRST; -- get subscript of first element
    WHILE i IS NOT NULL LOOP
    if self.retval.exist(ctx2(i))
    then self.retval(i):=self.retval(i)+ctx2.retval(i);
    else self.retval(value):=ctx2.retval(i);
    end if;
    i := ctx2.NEXT(i); -- get subscript of next element
    END LOOP;
    return ODCIConst.Success;
    end;
    end;
    CREATE OR REPLACE type stringCat as object
    retval varchar2(16383), -- concat of all value to now varchar2, --
    highest value seen so far
    static function ODCIAggregateInitialize (sctx IN OUT stringCat)
    return number,
    member function ODCIAggregateIterate (self IN OUT stringCat,
    value IN varchar2) return number,
    member function ODCIAggregateTerminate (self IN stringCat,
    returnValue OUT varchar2,
    flags IN number) return number,
    member function ODCIAggregateMerge (self IN OUT stringCat,
    ctx2 IN stringCat) return number
    CREATE OR REPLACE type body stringCat is
    static function ODCIAggregateInitialize(sctx IN OUT stringCat) return
    number is
    begin
    sctx := stringCat('');
    return ODCIConst.Success;
    end;
    member function ODCIAggregateIterate(self IN OUT stringCat, value IN
    varchar2)
    return number is
    begin
    if self.retval is null
    then self.retval:=value;
    else self.retval:=self.retval || ',' || value;
    end if;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateTerminate(self IN stringCat,
    returnValue OUT varchar2,
    flags IN number)
    return number is
    begin
    returnValue := self.retval;
    return ODCIConst.Success;
    end;
    member function ODCIAggregateMerge(self IN OUT stringCat,
    ctx2 IN stringCat) return number is
    begin
    self.retval := self.retval || ctx2.retval;
    return ODCIConst.Success;
    end;
    end;
    CREATE OR REPLACE FUNCTION StrCat (input varchar2) RETURN varchar2
    -- PARALLEL_ENABLE
    AGGREGATE USING StringCat;

    GraphicsConfiguration is an abstract class. You would need to subclass it. From the line of code you posted, it seems like you are going about things the wrong way. What are you trying to accomplish? Shouldn't this question be posted in the Swing or AWT forum?

  • In my "Extra" there is a line: "PDF -download, by Nitro PDF software". When I click on it, appears: "XML-parsefout .." How do I delete a command in "Extra"?

    How do I delete something in "Extra", something I didn't put in! (on my desktop).
    On my laptop the "PDF -download, by Nitro PDF software" doesn't figure and pdf files open normally and not seperatly in the mainframe of for example www.centrum-veurne.be

    Gee, Pat, this is a  real big help.
    Nobody could possibly think anyone would ask for help without first trying to fix the issue oneself. Or maybe you do. I have opened the file and looked under security. I have changed it to owner-notebook (which is what the techs called me) and clicked accept but geepers it didn't work.
    Maybe someone else has an idea.
    Take Ownership of a File or Folder
    The above should be a link. At least I copied and pasted the link. I did what was stated in there. It isn't like brain surgery. But it is not working. I ended up being able to open some pdf files after transferring them from one partition category to another. I wish it was that easy as you seem to think.
    Thanks for the help. Have a great year.

  • Error on opening a PDF download

    Please do not have your subject in all CAPITALS
    HI,
    i am geeting the below error message on trying to open the pdf download
    **"Adobe reader could not open file because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email and wasn't correctly decoded"**
    however on analysis i found the following
    no data on PDF because the  otf internal table is empty.
    actually i am converting a spool containg script into pdf download.
    i am working with  version 3.1i , so i dont use function module and use C function to convert spool to otf and then use convert_pdf to convert to pdf.
    when i debug my call function on the do loop executes once corrcetly  and on the second time of  execution immediately loaded with error message  'end of data' .... and so my otf conversion is not happening . ie otf_page intertal table gets empty without appending .
    sometimes i get error number 2048 ( illegal line length )
    i could not locate the error , as this application was working earlier good and recently got into trouble.
    pl guide if i need to check any settings.
    to my knowledge i found the program , layout and spool informations are okay.
    thanks in advance for your clue towards a progressive solution.
    Edited by: Matt on Mar 12, 2009 3:44 PM

    Please do not have your subject in all CAPITALS

  • I have a new computer with Windows 7 professional, Office 2007, Adobe XI. I have just created a word document and tried save it as a PDF but the PDF option doesn't appear in the drop down menu. Any ideas please? Thank you.

    I have a new computer with Windows 7 professional, Office 2007, Adobe XI. I have just created a word document and tried save it as a PDF but the PDF option doesn't appear in the drop down menu. Any ideas please? Thank you.

    What is "Adobe XI" - Reader, or Acrobat?
    But either way, 'Save as Adobe PDF' is a Word function, independent of what Adobe software you have installed.

  • How can I use User-Defined Aggregate Functions in Timesten 11? such as ODCI

    Hi
    we are using Timesten 11 version and as per the documentation, it doesn't support User-Defined Aggregate Functions.
    So we are looking for alternatives to do it. Could you please provide your expert voice on this.
    Thanks a lot.
    As the following:
    create or replace type strcat_type as object (
    cat_string varchar2(32767),
    static function ODCIAggregateInitialize(cs_ctx In Out strcat_type) return number,
    member function ODCIAggregateIterate(self In Out strcat_type,value in varchar2) return number,
    member function ODCIAggregateMerge(self In Out strcat_type,ctx2 In Out strcat_type) return number,
    member function ODCIAggregateTerminate(self In Out strcat_type,returnValue Out varchar2,flags in number) return
    number
    How can I use User-Defined Aggregate Functions in Timesten 11? such as ODCIAggregateInitialize ?

    Dear user6258915,
    You absolutely right, TimesTen doesnt support object types (http://docs.oracle.com/cd/E13085_01/doc/timesten.1121/e13076/plsqldiffs.htm) and User-Defined Aggregate Functions.
    Is it crucial for your application? Could you rewrite this functionality by using standart SQL or PL/SQL?
    Best regards,
    Gennady

  • Aggregate function for a report that has sets

    My report combines similar analysis into sets. I need to apply aggregate function such as Max() to the resulting columns. I tried but Analytics doesn't like that. Can someone tell me if this is supported or not? If not, what would be a workaround?

    Have you tried placing the results into a pivot table then assigning this to display MAX results

  • TS2034 video doesn't keep up with sound

    I have downloaded videos from my i phone onto my i mac.  The sound is coming through good, but the video itself is choppy and doesn't keep up with the sound.. Any ideas?

    Your issue is similar to mine. I posted it differently however. I noticed that timeline scrubbing behaves the same as yours when audio scrubbing is enabled.
    As a test turn off the audio scrubbing feature under the audio tab in preferences. If you experiencing the same problem as mine then the timeline will respond very quickly displaying everyframe. As long as you dont need to hear the audio when scrubbing that would solve your present dilemma.
    I also found that there seems to be a bottleneck using an external media drive. I copied a file that was performing slow to my internal SATA system drive, put it on the timeline and it scrubs perfectly even with audio scrubbing enabled.
    This same external drive performed fine on a slower PC with Premiere Pro 2.0. I am about to add an internal 1 terabyte SATA drive as my media drive. If I am correct this will resolve my problem.
    By the way, I am using a 7200 RPM external drive with a firewire connection. If you are using a USB 2 cable your bottleneck would probably be greater. I'll leave an update if the new internal drive does the trick.

  • Custom aggregate function inside a package.

    Hi there,
    I'm trying to write a custom aggregate function and group that function inside a package together with some other functions that I have. As an example (to simulate the problem I have) suppose my custom aggregation to do a summation of numbers looks like:
    CREATE OR REPLACE TYPE SUM_AGGREGATOR_TYPE AS OBJECT (
    summation NUMBER,
    STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
    SUM_AGGREGATOR_TYPE) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
    next_number IN NUMBER) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
    para_context IN SUM_AGGREGATOR_TYPE) RETURN NUMBER,
    MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
    return_value OUT NUMBER, flags IN NUMBER) RETURN NUMBER
    CREATE OR REPLACE TYPE BODY SUM_AGGREGATOR_TYPE IS
    STATIC FUNCTION ODCIAggregateInitialize(agg_context IN OUT
    SUM_AGGREGATOR_TYPE)
    RETURN NUMBER IS
    BEGIN
    agg_context := SUM_AGGREGATOR_TYPE(NULL);
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateIterate(self IN OUT SUM_AGGREGATOR_TYPE,
    next_number IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    IF self.summation IS NULL THEN
    self.summation := next_number;
    ELSIF summation IS NOT NULL THEN
    self.summation := self.summation + next_number;
    END IF;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateMerge(self IN OUT SUM_AGGREGATOR_TYPE,
    para_context IN SUM_AGGREGATOR_TYPE)
    RETURN NUMBER IS
    BEGIN
    self.summation := self.summation + para_context.summation;
    RETURN ODCIConst.Success;
    END;
    MEMBER FUNCTION ODCIAggregateTerminate(self IN SUM_AGGREGATOR_TYPE,
    return_value OUT NUMBER, flags IN NUMBER)
    RETURN NUMBER IS
    BEGIN
    return_value := self.summation;
    return ODCIConst.Success;
    END;
    END;
    If I write the following function definition:
    CREATE OR REPLACE FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
    and corresponding type declaration to test:
    CREATE OR REPLACE TYPE VECTOR
    IS
    TABLE OF NUMBER;
    this statement:
    select my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
    gives the correct result of 70. However, creating a package with the function definition:
    CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
    FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER PARALLEL_ENABLE AGGREGATE USING SUM_AGGREGATOR_TYPE;
    END;
    and calling it via:
    select MY_FUNCTIONS.my_sum(column_value) from table(vector(1, 2, 1, 45, 22, -1));
    explodes with:
    ORA-00600: internal error code, arguments: [17090], [], [], [], [], [], [], [], [], [], [], []
    Is it possible to have custom aggregate functions nested inside package declarations?
    I'm using Oracle 11g, Release 2 (11.2.0.1.0).

    HiddenName wrote:
    Is it possible to have custom aggregate functions nested inside package declarations?Yes, it is possible, you have succesfuly created your function. Your problem is that the database throws ORA-600 on execute. And with ORA-600 you can do 2 things: 1) google ORA-600 17090 or 2) contact your Oracle Support.
    You could also try to declare the function without PARALLEL_ENABLE - just to try to see if it changes anything. You can also try to call your function against a regular table with rows and columns - not against an collection type with table() operator.
    Anyway - these 2 tests should be usefull for Oracle Support.
    I never tried to put a custom aggregate function into a package. First - the cases when you need a custom aggregate function to be written for your system are very rare. Second - even if I needed 1 then I never needed 2 or more custom aggregate functions on my system. And as I do not like to make my life more complex than necessary, I have created it as a stand-alone function. And it is works (slowly).I tried using a standard table as you suggested:
    CREATE TABLE TEST_DATA
    test_value NUMBER
    INSERT INTO TEST_DATA
    (SELECT column_value test_value from TABLE(vector(1, 2, 1, 45, 22, -1)));
    COMMIT;
    select my_sum(test_value) from test_data;
    select my_functions.my_sum(test_value) from test_data;
    I also tried removing the PARALLEL_ENABLE clause to create the package as follows:
    CREATE OR REPLACE PACKAGE MY_FUNCTIONS AS
    FUNCTION MY_SUM(input NUMBER)
    RETURN NUMBER AGGREGATE USING SUM_AGGREGATOR_TYPE;
    END;
    And unfortunately it still breaks with the following error: SQL Error: ORA-00600: internal error code, arguments: [17090]. This looks like an Oracle bug to me as the PL/SQL parsing engine should have disallowed me to even create this if it is not supported in Oracle. Instead, it allows me to create the package, and breaks when I call the function with this weird error (additionally cutting my connection from the database) instead of disallowing me to do this altogether and printing a nice error message telling me that Oracle doesn't support this. How would I go about logging a ticket for this?
    Edited by: wcmatthysen on Dec 1, 2010 12:51 PM

  • Problem with aggregate function

    Hello,
    the prerequisite is to have a table with the following columns (#id, a_date).
    Now the task is to select the maximum date from a range of rows of this table
    select max(t.a_date)
    from the_table t
    where <condition to get only some rows of the_table>
    and to get the id of the record which holds the maximum date. That's where the problem is located. It should look like the following code (yes, I know this cannot work because grouping by the id makes the aggregate senseless) just to make clear what I want to do.
    select max(t.a_date), t.id
    from the_table t
    where <condition to get only some rows of the_table>
    group by t.id
    Does anybody have any idea how to solve the problem?
    With regards,
    Cosima
    Message was edited by:
    Cosima Laube

    Hi all,
    as the condition in the where-clause is very complex, I decided to use the solution with the FIRST function. After googling and reading a bit, I have just two more questions for my deeper understanding:
    1) am I right that both snippets below do exactly the same?
    SELECT MAX (t.a_date)
         , MAX (t.ID)KEEP (DENSE_RANK FIRST ORDER BY t.a_date DESC)
      FROM the_table t
    WHERE <condition to get only some rows of the_table>
    SELECT MAX (t.a_date)
         , MAX (t.ID)KEEP (DENSE_RANK LAST ORDER BY t.a_date ASC)
      FROM the_table t
    WHERE <condition to get only some rows of the_table>2) can I use als the min function for t.ID as there the aggregate function does not have any effect (but is necessary in order to use KEEP and FIRST or KEEP and LAST)?
    With regards,
    Cosima
    Message was edited by:
    Cosima Laube

  • Select into aggregate function

    Hi,
    I have the following PL/SQL block that I am testing. The block reads a list of values from a local file and inserts the values into a select statement that uses an aggregate function. Here is my code:
    DECLARE
    f utl_file.file_type;
    n COLa%TYPE; --holds values from the file
    v COLb%TYPE; --holds value returned by select statement
    BEGIN
    f := utl_file.fopen(dir,file.txt,'R');
    loop -- loop through file
         utl_file.get_line(f,n);
         if length(n) <> 0 then
              SELECT max(A0.COLa) into v
              FROM (SELECT AOB.COLa, A0.COLb
              FROM TAB1 A0,TAB2 A0B
              WHERE (A0.PK=A0B.PK) and A0B.COLa = n) A0;          
              IF SQL%rowcount = 0 THEN
                   dbms_output.put_line('no rows);
              else
                   dbms_output.put_line(v);
              end if;                    
         end if;     
    end loop;
         utl_file.fclose(f);     
    end;
    Here is the error I get:
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SYS.UTL_FILE", line 98
    ORA-06512: at "SYS.UTL_FILE", line 656
    ORA-06512: at line 12
    I checked the database for the first couple of values in the list and got rows. I also ran a simple PL/sql code to print values in the file successfully. So I dont know why it is returning no data found. From what I understand select into statement using aggregate functions will never raise this exception, so why I am getting this error?
    Thanks.

    Hi,
    Actually, the SELECT ... INTO isn't the problem here.
    Look at the error message:
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SYS.UTL_FILE", line 98
    ORA-06512: at "SYS.UTL_FILE", line 656
    ORA-06512: at line 12The error is ocurring inside utl_file, which is being called at line 12 of your code. (That must be
    utl_file.get_line(f,n);)
    Utl_file.get_line raises NO_DATA_FOUND when it reaches the end of the file. (If it didn't you'd have an infinite loop, since your code doesn't have any exit strategy.)
    You can put the call to get_line in its won BEGIN-EXCEPTION-END block, and trap the NO_DATA_FOUND error.
    For example:
    end_of_file := 0;
    WHILE  end_of_file = 0;
    loop -- loop through file
        BEGIN
            utl_file.get_line(f,n);
            if length(n) != 0 then          -- Use !=, because you can't post &lt;&gt; on this site
                SELECT  max(A0B.COLa)     -- No sub-query needed
                into    v
                FROM    TAB1 A0
                ,         TAB2 A0B
                WHERE   (A0.PK   = A0B.PK)
                and         A0B.COLa = n;
                IF SQL%rowcount = 0 THEN     -- Not needed: SELECT MAX ... without GROUP BY always returns 1 row
                    dbms_output.put_line('no rows);
                else
                    dbms_output.put_line(v);
                end if;
            end if;
        EXCEPTION
            WHEN  NO_DATA_FOUND
            THEN
                end_of_file = 1;
        END;
    end loop;Edited by: Frank Kulash on Jul 17, 2009 2:51 PM

  • Keep resetting firefox, it doesn't keep settings (I.E. to open on my home page), and when opening a tab the 3*3 links aren't there.

    When I set my Firefox to open to my home page, the next day doesn't keep the settings, and when I open a new tab, the 9 click links aren't there. I have reset twice and have no toolbars, but it repeats.

    Hi,
    Thanks for contacting Mozilla Support.
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    More information about reinstalling Firefox can be found [https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems?esab=a&s=troubleshooting&r=3&as=s#w_5-reinstall-firefox here].
    <b>WARNING:</b> Do not run Firefox's uninstaller or use a third party remover as part of this process, because that could permanently delete your Firefox data, including but not limited to, extensions, cache, cookies, bookmarks, personal settings and saved passwords. <u>These cannot be recovered unless they have been backed up to an external device!</u>
    Hope this helps!
    Curtis
    Mozilla Support volunteer

  • PDF download on website limited to app users

    Dear All,
    We are creating an iPhone tour app in Dreamweaver CS6 and want to post additional material on our website in PDF format that can be downloaded by people who purchase our iPhone app.  Is there any way to limit a PDF download on a Dreamweaver CS6 website to only people who enter a code or in some way separate themselves from others who might want to download the PDF files?   In other words, I don't want everyone to be able to download the PDF files, just those who have paid for the iPhone app and are entitled to the additional material without charge. How can I go about restricting the PDF download to those who have already paid for the app? Thanks.
    Small Town Gal

    Dear Ken,
    Thanks for your reply.  You have made me think of something.  Perhaps I should not use our regular website but create another website that was restricted only to iPhone app users with the link to the website visible only within the iPhone app.  Would creating a Facebook page offer the same download capabilities with a "like" function by the app user?
    I could also create something in Muse or Business Catalyst?
    Small Town Gal

Maybe you are looking for

  • Use of Contains

    Hello .... I am using forms and using one field for user to input data ... depending on this data , i need to fetch the records ... Enter Info :- Computer science in Aurangabad Now, i need to search the info which contains any of this words.... my se

  • How do I get "Media" to appear in my Sidebar?

    When I insert pictures, files etc into emails, the finder window very kindly shows "Media" as a drop down in the sidebar. But when I open finder by itself this drop down is not in the sidebar and I can find no way in preferences to choose to show it?

  • Month filter between two ranges based on user response inIDT

    Hi, I am working on SAP BO4.0.I have a requirement of creating a month filter on a date which will be between two ranges.The first range is the user response and the second range will be 6 months added to that user response.For eg:-If a user enters 1

  • Can we Run the report in background in BI

    Dear all, we have a report which is taking more time to run nearly 15 min...... And when we execute then the time out error is coming. can we create a backround job for this report. Regards venu

  • Confused with hotspots/slices

    Hi, totally new to this. Perhaps someone could help me: I have Fireworks and Dreamweaver CS3. I have an image I created in Fireworks and within that image I am trying to create a navigation bar using just text. I thought that I could just make rectan