Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Oracle Analytical Function ratio_to_report

Oracle Analytical Function ratio_to_report

From: Abhijit Bhattacharya <abhattacharya_at_ea.com>
Date: Sat, 21 Jul 2001 21:34:43 GMT
Message-ID: <3B4E1CCD.1A7E2FF0@ea.com>

Is it possible to use ratio_to_report function within PL/SQL block ? I used it from SQL*PLUS, it worked. I could have it work from Perl DBI also. When I try to use it with PL/SQL blockor PRO*C program then it generates syntax error . Any help will be greatly appreciated .

DECLARE
v_sales sales%ROWTYPE ;
BEGIN
   SELECT name,

          country,
          SUM(SUM(amt)) OVER (PARTITION BY COUNTRY) AS sum_amt
   INTO v_sales
   FROM sales
   WHERE name = 'ABHI'
   GROUP BY name,country ;
   DBMS_OUTPUT.PUT_LINE(v_sales.name||' '||v_sales.country) ; END ; SUM(SUM(amt)) OVER (PARTITION BY COUNTRY) AS sum_amt
                             *

ERROR at line 6:
ORA-06550: line 6, column 30:
PLS-00103: Encountered the symbol "(" when expecting one of the
following:

, from into bulk Received on Sat Jul 21 2001 - 16:34:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US