Illegal semicolon ;   not in group

HI guys
As per my requirement i heve to use multiple recipients in TO field which must be semicolon separeted .
I used " Internet Address.parse(wdContext.currentEmailElement.getToAddress)" to handle multiple recipients.
Also i used " StringTokenizer mailids = new StringTokenizer(email,";"); "
But when try to send mail Address Exception Handler gives error "Illegal semicolon ; not in group".
Please help.
Thanks in anticipation,
Mandeep Virk

Semicolon is not a legal delimiter in a list of internet email addresses.
If that's the form you have the addresses, you're going to have to break
them apart yourself. The StringTokenizer should work. If it isn't working,
you're doing something wrong.

Similar Messages

  • Error : Illegal semicolon, not in group in string

    I use Javamail 1.4.1 in order to read messages from a server.
    When I get the message I execute message.getRecipients(xpRec) in order to get recipients but sometime I get an error
    javax.mail.internet.AddressException: Illegal semicolon, not in group in string.
    I can't controll the message format because are received mails.
    How can I solve that issue ?
    Is there a way to force to accept such adresses.
    I tried with
    props.setProperty("mail.mime.address.strict", "false");
    before getting the session but nothing changed.
    Tks
    Tullio

    Significant improvements were made in JavaMail 1.4.2 to accept more illegal addresses when strict is false.
    Try upgrading to the current version, JavaMail 1.4.5.
    If that doesn't help, post the raw address headers that cause this problem.

  • Illegal semicolon send email weblogic forms reports 11g

    I have a form that send parameters to a report and buld it on pdf format, then the same is sent by email to the address from the database,
    I got this error and I need your help.
    I really appreciate.
    My configuration:
    Weblogic server 10.3.4
    Forms & Reports 11.1.1.4
    OS. Oracle Enterprise Linux (OEL 5.5)
    thanks.
    this is the error shown in the log file located in:
    FMW_HOME/INSTANCE_HOME/diagnostics/logs/ReportsServerComponent/ReportsServer_Name/rwserver_diagnostic.log
    [2012-02-13T22:33:12.384-06:00] [reports] [INCIDENT_ERROR] [REP-50152] [oracle.reports.server] [tid: 18] [ecid: 004i8xiSn1mF8DWFLzjO8A0000nT00001u,0:1:0x5f5e101:100000002] [URI: /reports/rwservlet/getjobid838]
    REP-50152 : Se ha producido un error al enviar el correo: Illegal semicolon, not in group. [[
    oracle.reports.RWException: IDL:oracle/reports/RWException:1.0
         at oracle.reports.utility.Utility.newRWException(Utility.java:1053)
         at oracle.reports.server.MailService.send(MailService.java:588)
         at oracle.reports.server.DesMail.sendFile(DesMail.java:186)
         at oracle.reports.server.Destination.send(Destination.java:578)
         at oracle.reports.server.JobObject.distribute(JobObject.java:2041)
         at oracle.reports.server.JobManager.updateJobStatus(JobManager.java:2761)
         at oracle.reports.server.EngineCommImpl.updateEngineJobStatus(EngineCommImpl.java:154)
         at oracle.reports.server.EngineCommPOA._invoke(EngineCommPOA.java:94)
         at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:637)
         at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:189)
         at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1682)
         at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1540)
         at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:922)
         at com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
         at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:694)
         at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:451)
         at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1213)
         at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:471)
         at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:500)
    ]]

    I got the answer,
    The problem was that I have email addresses saved on a table as '[email protected]; [email protected]' and it needs to be a colon. ','

  • Ora-00979 not a group by expression

    hi , how r u ?
    my problem in group by , how include subquery in group by ,
    this query give me error ora-00979 not a group by expression ,
    please help me in this query :
    select EVV_CompScale.Code CompCode,ScaleCode ,NameEn,NameAr,RatingChar ,count(EV_CompetencyEmployee.Code) as VoteCount ,
    coalesce((select count(EV_CompetencyEmployee.code) from EV_CompetencyEmployee   join EV_EmployeeEvaluation tblEV on EV_Code=tblEV.Code  and EmployeeApprovalCMP=1 and DirectManagerApprovalCMP=1  and SeniorManagerApprovalCMP=1 and tblEV.configCode='K' where CompetencyCode=EVV_CompScale.Code  and not RatingID is null  ),1) as Total
    from EVV_CompScale left join (EV_CompetencyEmployee join EV_EmployeeEvaluation on EV_Code=EV_EmployeeEvaluation.Code and EmployeeApprovalCMP=1 and DirectManagerApprovalCMP=1 and SeniorManagerApprovalCMP=1 and EV_EmployeeEvaluation.configCode='K') on EV_CompetencyEmployee.CompetencyCode=EVV_CompScale.Code and RatingID=ScaleCode where CompConfig='K'
    and ScaleConfig='K' group by EVV_CompScale.Code,ScaleCode,RatingChar,NameEn,NameAr
    order by CompCode .
    thanks .

    Hi,
    In a GROUP BY querry, every item in the SELECT list must be one of the following
    (1) One of the GROUP BY expressions
    (2) An aggregate function
    (3) A constant
    (4) Deterministic expressions based on the above (for example, COALESCE, where all the arguments are taken from the list above)
    So if your scalar sub-query is going to be part of the GROUP BY query, it has to fit into one of those categories
    I don't see any good way of convincing the compiler that your scalar sub-query is a constant, even if it happens to rturn a constant value, but you can make it either
    (1) one of the GROUP BY expressions (compute it in a sub-query, to avoid repeating the whole scalar sub-query in the GROUP BY clause), or
    (2) an aggregate function ( e.g. MAX ((SELECT ...))).
    But the scalar sub-query doesn't have to be part of the GROUP BY query. Depending on your tables and the desired results, it might be easy to do the GROUP BY and what is now the scalar sub-query separately, and then join the two result sets.
    If you need help, it always helps to post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data
    (4) Your best attempt so far (formatted) (You posted this, but since it's unformated, it's very hard to read.)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    Formatted tabular output is okay for (3). Type these 6 characters:
    {code}
    (small letters only, inside curly brackets) before and after formatted text, to preserve spacing.
    Simplify the problem if you can. For example, if your real query involves many columns and many join conditions, try to post a similar problem that has few columns and very siomple join conditions, but has the same problem as your real query.

  • Have a gap in detail of first page and not display group footer on each pag

    Please help me about Memo field in SubReport in CrystalReportXI. I have a SubReport that need to display pageheader, detail, page footer, and  in detail of subreport contains memo field and set the property of this text box to "Can Grow" = Yes .However, CrystalReportX does not support to display  pageheader, pagefooter in SubReport. So. I have created a formular FakePageHeader that has code  as
    "WhileReadingRecords;
    true"
    and group in this field and checked option repeat group header on each page and right click Section Expert->check print at Bottom of page for Group Footer.
    This problem is when I preview Subreport. It display text in group header and a gap in detail of first page and view next page, the subreport display right data of memo field. But the report still not display group footer on each page.
    How do I can remove a gap in first page and display group footer on each page?
    Thanks

    in subreport in format for the memo field uncheck keep object together.
    You can not force group footers to repeat on each page.
    I have not tried this but you might be able to capture the data you want to show in SR page footer and display in main report page footer, using shared variables.
    Ian

  • ORA-00979: not a GROUP BY expression ORA-01722: invalid number error

    This is my follwing code:
    select isin,nomenclature,sum(total_balance),c_itd_rddt,c_itd_intrrt from
    select distinct instru.c_int_isin isin,
    instru.c_int_longdesc nomenclature,
    to_char(abs(acpos.acp_totbal),
    '999999999999,99,99,990.00')total_balance,
    c_itd_rddt,
    c_itd_intrrt
    from cs_instru_t instru,
    cs_instrudetls_t insdtls,
    cs_acpos_t acpos
    where instru.c_int_instruid = insdtls.c_itd_instruid
    and acpos.acp_instruid = instru.c_int_instruid
    and acpos.acp_acntnum = 'SG030001'
    and instru.c_int_instypid in (1)
    and insdtls.c_itd_rddt > ('31-Dec-2010')
    and instru.c_int_isin not in
    (select spsec.c_ssg_isinno from cs_splsecgrp_t spsec) and acpos.acp_totbal!=0
    group by instru.c_int_instruid,
    instru.c_int_longdesc,
    insdtls.c_itd_rddt,
    instru.c_int_insstts,
    instru.c_int_isin,
    insdtls.c_itd_rddt,
    acpos.acp_totbal,c_itd_intrrt
    --order by extract(year from  c_itd_rddt),c_itd_intrrt
    union
    select c_srm_prntisin isin,c_int_longdesc nomenclature,to_char(abs(acpos.acp_totbal),
    '999999999999,99,99,990.00') total_balance,c_itd_rddt,
    c_itd_intrrt from cs_instrudetls_t insdtls,cs_strmap_t map,cs_instru_strips instru,cs_acpos_t acpos
    where c_int_instruid=c_srm_prncplinsid
    and c_itd_instruid=c_int_instruid
    and c_srm_prncplinsid=acp_instruid
    and acp_acntnum='SG030001'
    )view1
    group by isin
    I want to group by isin only as only isin is same and the rest of the fields are different.But I want to display all the fields.Please Help
    I am getting the following errors:
    ORA-00979: not a GROUP BY expression
    ORA-01722: invalid number

    wat abt the other error ora-01722 not a valid number. How to take sum of total_balance which is to_char

  • Java.sql.SQLException: ORA-00979: not a GROUP BY expression in a query

    I am getting java.sql.SQLException: ORA-00979: not a GROUP BY expression
    when I run
    select count(*) from ( select count(rec_no) AS REC_NO_NUM,created_by AS
    CREATED_BY,to_char(created_dt,'Mon YYYY') AS CREATED_DT,to_date(to_char(created_dt,'Mon
    YYYY'),'Mon YYYY') AS CREATED_DATE from tbl_ndr_renal_reg where reg_no is not null and delete_ind
    = 'N' group by to_char(created_dt,'Mon YYYY'),created_by )
    But when I run the subquery below it doesn't give any error and returns rows.
    select count(rec_no) AS REC_NO_NUM,created_by AS CREATED_BY,to_char(created_dt,'Mon YYYY') AS
    CREATED_DT, to_date(to_char(created_dt,'Mon YYYY'),'Mon YYYY') AS CREATED_DATE from
    tbl_ndr_renal_reg where reg_no is not null and delete_ind = 'N' group by to_char(created_dt,'Mon
    YYYY'),created_by
    Thanks

    I tried that too still getting the same error
    SQL> select count(*) from (
    2 select count(rec_no) AS REC_NO_NUM,
    3 created_by AS CREATED_BY,
    4 to_char(created_dt,'Mon YYYY') AS CREATED_DT,
    5 to_date(to_char(created_dt,'Mon YYYY'),'Mon YYYY') AS CREATED_DATE
    6 from tbl_ndr_renal_reg
    7 where reg_no is not null
    8 and delete_ind = 'N'
    9 group by to_char(created_dt,'Mon YYYY'),created_by)
    10 ;
    to_date(to_char(created_dt,'Mon YYYY'),'Mon YYYY') AS CREATED_DATE
    ERROR at line 5:
    ORA-00979: not a GROUP BY expression

  • Getting "ORA-00979: not a GROUP BY expression" error in Inline query

    Hello all,
    The following query when run in SCOTT user gives "ORA-00979: not a GROUP BY expression" error.
    If I remove the TRUNC function from the outer query's group by clause, then it fetches
    (My actual query is something similar to the following query. I have given emp, dept tables for convenience's sake)
    select e.empno,e.ename, AVG(e.SAL), trunc(e.hiredate),
    (select sum(sal) from emp
    where hiredate = e.hiredate) salary
    from emp e
    group by e.DEPTNO,e.EMPNO,e.ENAME, trunc(e.hiredate)
    Pls suggest how this error can be avoided.
    Regards,
    Sam

    Why not this?
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.02
    satyaki>
    satyaki>
    satyaki>select e.empno,
      2         e.ename,
      3         AVG(e.SAL),
      4         trunc(e.hiredate),
      5        (
      6           select sum(sal)
      7           from emp
      8           where hiredate = e.hiredate
      9        ) salary
    10  from emp e
    11  group by e.DEPTNO,
    12           e.EMPNO,
    13           e.ENAME,
    14           e.hiredate;
         EMPNO ENAME      AVG(E.SAL) TRUNC(E.H     SALARY
          7934 MILLER         1887.6 23-JAN-82     5583.6
          7698 Glen             1848 23-JAN-82     5583.6
          7788 SCOTT          598.95 19-APR-87     598.95
          7900 JAMES          1379.4 03-DEC-81    6650.16
          7521 WARD           226.88 22-FEB-81     226.88
          7599 BILLY            4500 10-JUN-09       4500
          2222 sp               1200 14-SEP-09       1200
          7902 FORD          5270.76 03-DEC-81    6650.16
          7566 Smith            1848 23-JAN-82     5583.6
          7654 MARTIN           1815 28-SEP-81       1815
          7839 KING             7260 17-NOV-81       7260
         EMPNO ENAME      AVG(E.SAL) TRUNC(E.H     SALARY
          7844 TURNER           2178 08-SEP-81       2178
          7876 ADAMS          159.72 23-MAY-87     159.72
    13 rows selected.
    Elapsed: 00:00:00.03
    satyaki>Regards.
    Satyaki De.

  • "ORA-00979: not a GROUP BY expression" in Oracle11g R2 (11.2.0.3).

    Hi,
    We have a query which is working in 10g and giving error "ORA-00979: not a GROUP BY expression" in Oracle11g R2 (11.2.0.3). we have found following two solution to resolve it from the internet.
    1)You can Set the hidden parameter “_FIX_CONTROL”=’5520732:OFF’ in the pfile. This parameter disables a given bug number.
    2)We can set the parameter optimizer_features_enable to a previous version of Oracle, ’11.1.0.7′
    but I am unable to find the side effects of above change, so I need to know:
    1)whcih is batter solution
    2)what are the possible side effects of both solution.

    Hi Fran,
    Please find the below query.
    SELECT DECODE(TEMP.TENOR_IND, 'L', TEMP.SHORT_NAME, NULL) PRODUCT_NAME,
    TEMP.BA_PRODTYPE_ID,
    TEMP.TENOR,
    TEMP.PERIOD_TYPE,
    TEMP.PERIOD_VALUE,
    SUM(TEMP.LIMIT_BASE_AMOUNT),
    SUM(TEMP.PNDG_LIMIT_BASE_AMOUNT),
    SUM(TEMP.GROSS_EXP_BASE_AMOUNT),
    SUM(TEMP.NETT_EXP_BASE_AMOUNT),
    SUM(TEMP.COLLATERAL_BASE_AMOUNT),
    TEMP.TENOR_IND,
    MAX(TEMP.COB_DATE),
    TEMP.CRP_PRODUCT_GROUP
    FROM (SELECT /*+INDEX(LIM BUS_CB_LIMIT_INDX01) INDEX(btpd BUS_TP_PORTFOLIO_DTLS_INDX02)*/
    MCBPT.BA_PRODTYPE_ID,
    DECODE(LIM.TENOR_IND, 'L', MCBPT.SHORT_NAME, NULL),
    LIM.LIMIT_ID,
    LIM.LIMIT_TYPE_ID,
    LIM.LIMIT_STATUS,
    LIM.OWNER_ID,
    LIM.PERIOD_TYPE,
    LIM.PERIOD_VALUE,
    LIM.LIMIT_CURR,
    LIM.LIMIT_BASE_AMOUNT,
    LIM.GROSS_EXP_BASE_AMOUNT,
    DECODE(LIM.PERIOD_TYPE,
    5,
    'Inf',
    (TO_CHAR(LIM.PERIOD_VALUE) || '-' ||
    DECODE(LIM.PERIOD_TYPE, 4, 'Y', 3, 'M', 2, 'W', 1, 'D'))) TENOR,
    LIM.TENOR_SET_ID,
    LIM.PNDG_LIMIT_CURR,
    LIM.PNDG_LIMIT_BASE_AMOUNT,
    LIM.NETT_EXP_BASE_AMOUNT,
    LIM.COLLATERAL_BASE_AMOUNT,
    LIM.COB_DATE,
    LIM.TENOR_IND,
    MCBPT.CRP_PRODUCT_GROUP,
    MCBPT.SHORT_NAME
    FROM BUS_CB_LIMIT LIM,
    BUS_TP_PORTFOLIO_DETAILS BTPD,
    MST_CB_BA_PRODUCT_TYPE MCBPT
    WHERE BTPD.ORG_ID = 108503
    AND EXISTS
    (SELECT ORG_ID
    FROM BUS_CA_CORPORATE
    WHERE ORG_STAT IN (1, 2, 4, 7, 8, 9, 22, 24, 25)
    AND BTPD.BOOKING_ENTITY = ORG_ID
    START WITH ORG_ID = 894
    CONNECT BY PRIOR ORG_ID = PARENT_ORG_ID)
    AND NOT EXISTS
    (SELECT /*+INDEX(btpd1 BUS_TP_PORTFOLIO_DTLS_INDX02)*/
    btpd1.ba_prodtype_id
    FROM bus_tp_portfolio_details btpd1
    WHERE btpd1.org_id = 108503
    AND btpd1.booking_entity = 894
    AND BTPD.BA_PRODTYPE_ID = btpd1.ba_prodtype_id
    AND EXISTS
    (SELECT ba_prodtype_id
    FROM mst_cb_ba_product_type
    WHERE product_grp_id = 1
    AND btpd1.ba_prodtype_id = ba_prodtype_id))
    AND MCBPT.BA_PRODTYPE_ID = BTPD.BA_PRODTYPE_ID
    AND BTPD.CP_STATUS = 4
    AND LIM.OWNER_ID = BTPD.PORTFOLIO_ID
    AND LIM.OWNER_TYPE = 4
    AND LIM.LIMIT_TYPE_ID = 2) TEMP
    WHERE 1 = 1
    GROUP BY TEMP.BA_PRODTYPE_ID,
    TEMP.PERIOD_TYPE,
    TEMP.PERIOD_VALUE,
    TEMP.TENOR_IND,
    TEMP.SHORT_NAME,
    TEMP.CRP_PRODUCT_GROUP
    ORDER BY TEMP.BA_PRODTYPE_ID, TEMP.PERIOD_TYPE, TEMP.PERIOD_VALUE

  • Not a GROUP BY expression - Oracle 10g bug?

    Hi,
    I am geting 00979. 00000 - "not a GROUP BY expression" error on Oracle 10g 10.2.0.4.0 - 64bit Production.
    To illustrate my problem I created following example.
    Let think I have some shop with clothes. Everytime I sell something, I store this information in the database - storing actual time, clothes type (trousers, socks, ...) and the size of the piece (M, L, XL, ...).
    Now, system counts statistics every hour. So it goes thrue the table with sold pieces and counts the number of pieces per clothes type and per size from the beginning of the day. It is important to realize that it is from the beginning of the day. Because of that, the number of sold pieces in the statistical table grows every hour (or is at least on the same value as in previous hour).
    Now, from this statistical table I need to make new statistic. I want a statistic how many pieces per size I sold every hour.
    I created this query for that:
    SELECT TIME, xSIZE, (SOLD  - NVL((SELECT SUM(S1.SOLD)
                                      FROM STATISTICS S1
                                      WHERE S1.xSIZE = S.xSIZE
                                        AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
                                        AND TO_CHAR(S1.TIME, 'HH24') != '23'
                                        AND S1.xSIZE IS NOT NULL
                                      GROUP BY TRUNC(S1.TIME, 'HH24'), S1.xSIZE),0)) SOLD
    FROM(
    SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD
    FROM STATISTICS S
    WHERE S.xSIZE IS NOT NULL
    GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE
    --ORDER BY 1 DESC
    ) S
    ORDER BY TIME DESC, xSIZE ASCFirst I select number of sold pieces per hour per size. To get number of sold pieces for particular hour, I need to substract from this value number of sold pieces from previous hour. I decided to do this with parameter query...
    Running the query like this I get "not a GROUP BY expression" error. However if I uncomment the "ORDER BY 1 DESC" statement, the query works. I am pretty sure it has to do something with this line:
    AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
    If you modify this query like this:
    SELECT TIME, xSIZE, (SOLD  - NVL((SELECT SUM(S1.SOLD)
                                      FROM STATISTICS S1
                                      WHERE S1.xSIZE = S.xSIZE
                                        --AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
                                        AND TO_CHAR(S1.TIME, 'HH24') != '23'
                                        AND S1.xSIZE IS NOT NULL
                                      GROUP BY  S1.xSIZE),0)) SOLD
    FROM(
    SELECT TRUNC(S.TIME, 'HH24') TIME, S.xSIZE, SUM(S.SOLD) SOLD
    FROM STATISTICS S
    WHERE S.xSIZE IS NOT NULL
    GROUP BY TRUNC(S.TIME, 'HH24'), S.xSIZE
    --ORDER BY 1 DESC
    ) S
    ORDER BY TIME DESC, xSIZE ASCRemoved joining the tables on truncated time and grouping by the truncated time -> The query does not fail...
    And now the best...if you run the first query on Oracle 11g (Release 11.1.0.6.0 - 64bit Production), it works.
    Does anybody know why is the first query not working on 10g? Is there some bug or limitation for this server version?
    Please don't say me to rewrite the query in another way, I already did it, so it works on 10g as well. I am just curious why it doesn't work on 10g.
    Finally here are some data for testing.
    CREATE TABLE STATISTICS(
      TIME DATE DEFAULT SYSDATE,
      TYPE VARCHAR2(20),
      xSIZE VARCHAR2(2),
      SOLD NUMBER(5,0) DEFAULT 0
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'M', 10);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'M', 3);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'T-Shirt', 'L', 1);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'L', 50);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Trousers', 'XL', 7);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 2/24, 'Socks', 'XL', 3);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'T-Shirt', 'M', 13);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'L', 60);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Trousers', 'XL', 15);
    INSERT INTO STATISTICS(TIME, TYPE, xSIZE, SOLD) VALUES(SYSDATE - 1/24, 'Socks', 'XL', 6);Edited by: user12047225 on 20.9.2011 23:12
    Edited by: user12047225 on 20.9.2011 23:45

    It is a known issue when optimizer decides to expand in-line view. You can add something (besides ORDER BY you already used) to in-line view to prevent optimizer from expanding it. For example:
    SQL> SELECT  TIME,
      2          xSIZE,
      3          (SOLD - NVL(
      4                      (
      5                       SELECT  SUM(S1.SOLD)
      6                         FROM  STATISTICS S1
      7                         WHERE S1.xSIZE = S.xSIZE
      8                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
      9                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
    10                           AND S1.xSIZE IS NOT NULL
    11                           GROUP BY TRUNC(S1.TIME, 'HH24'),
    12                                    S1.xSIZE
    13                      ),
    14                      0
    15                     )
    16          ) SOLD
    17    FROM  (
    18           SELECT  TRUNC(S.TIME, 'HH24') TIME,
    19                   S.xSIZE,
    20                   SUM(S.SOLD) SOLD
    21             FROM  STATISTICS S
    22             WHERE S.xSIZE IS NOT NULL
    23             GROUP BY TRUNC(S.TIME, 'HH24'),
    24                      S.xSIZE
    25           --ORDER BY 1 DESC
    26          ) S
    27    ORDER BY TIME DESC,
    28             xSIZE ASC
    29  /
             SELECT  TRUNC(S.TIME, 'HH24') TIME,
    ERROR at line 18:
    ORA-00979: not a GROUP BY expression
    SQL> SELECT  TIME,
      2          xSIZE,
      3          (SOLD - NVL(
      4                      (
      5                       SELECT  SUM(S1.SOLD)
      6                         FROM  STATISTICS S1
      7                         WHERE S1.xSIZE = S.xSIZE
      8                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
      9                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
    10                           AND S1.xSIZE IS NOT NULL
    11                           GROUP BY TRUNC(S1.TIME, 'HH24'),
    12                                    S1.xSIZE
    13                      ),
    14                      0
    15                     )
    16          ) SOLD
    17    FROM  (
    18           SELECT  TRUNC(S.TIME, 'HH24') TIME,
    19                   S.xSIZE,
    20                   SUM(S.SOLD) SOLD,
    21                   ROW_NUMBER() OVER(ORDER BY SUM(S.SOLD)) RN
    22             FROM  STATISTICS S
    23             WHERE S.xSIZE IS NOT NULL
    24             GROUP BY TRUNC(S.TIME, 'HH24'),
    25                      S.xSIZE
    26           --ORDER BY 1 DESC
    27          ) S
    28    ORDER BY TIME DESC,
    29             xSIZE ASC
    30  /
    TIME      XS       SOLD
    20-SEP-11 L           9
    20-SEP-11 M           0
    20-SEP-11 XL         11
    20-SEP-11 L          51
    20-SEP-11 M          13
    20-SEP-11 XL         10
    6 rows selected.
    SQL> Or use subquery factoring (WITH clause) + undocumented hint MATERIALIZE:
    SQL> WITH S AS (
      2             SELECT  /*+ MATERIALIZE */ TRUNC(S.TIME, 'HH24') TIME,
      3                     S.xSIZE,
      4                     SUM(S.SOLD) SOLD
      5               FROM  STATISTICS S
      6               WHERE S.xSIZE IS NOT NULL
      7               GROUP BY TRUNC(S.TIME, 'HH24'),
      8                        S.xSIZE
      9             --ORDER BY 1 DESC
    10            )
    11  SELECT  TIME,
    12          xSIZE,
    13          (SOLD - NVL(
    14                      (
    15                       SELECT  SUM(S1.SOLD)
    16                         FROM  STATISTICS S1
    17                         WHERE S1.xSIZE = S.xSIZE
    18                           AND TRUNC(S1.TIME, 'HH24') + 1/24 = S.TIME
    19                           AND TO_CHAR(S1.TIME, 'HH24') != '23'
    20                           AND S1.xSIZE IS NOT NULL
    21                           GROUP BY TRUNC(S1.TIME, 'HH24'),
    22                                    S1.xSIZE
    23                      ),
    24                      0
    25                     )
    26          ) SOLD
    27    FROM  S
    28    ORDER BY TIME DESC,
    29             xSIZE ASC
    30  /
    TIME      XS       SOLD
    20-SEP-11 L           9
    20-SEP-11 M           0
    20-SEP-11 XL         11
    20-SEP-11 L          51
    20-SEP-11 M          13
    20-SEP-11 XL         10
    6 rows selected.
    SQL> SY.

  • Error : not a GROUP BY expression

    Hi everyone,
    Looks like i need some help here.. :) dont know what it means but im getting this message
    00979. 00000 - "not a GROUP BY expression"
    *Cause:   
    *Action:
    Error at Line: 137 Column: 36
    this is the function:
    function get_path(materialID in number, materialTypeID in number, inTopFolderID in number default null, inMaterialFolderID in number default null, webMode in number default 1)
    return varchar2;
    and im using it on my query
    ,(select material_util.get_path(m.material_id, 8, 1021695, min(mf.IP_MATERIALFOLDERID), 1)
    from material m, materialfolder mf
    where mf.nfx_link = m.MATERIAL_ID
    and m.template_id = t.template_id) as Path
    looks like min(mf.IP_MATERIALFOLDERID) is having some issues here.. dont know why..
    let me know guys..
    thanks..
    J

    A example
    with testdata as
    select 1 idu, 1 value1, 7 value2, 40 value3 from dual union all
    select 2 idu, 2 value1, 8 value2, 45 value3 from dual union all
    select 3 idu, 3 value1, 9 value2, 50 value3 from dual union all
    select 1 idu, 4 value1, 4 value2, 55 value3 from dual union all
    select 2 idu, 5 value1, 5 value2, 60 value3 from dual union all
    select 3 idu, 6 value1, 2 value2, 65 value3 from dual
    select min(value1), avg(value2), max(value1), sum(value3) from testdata;
    MIN(VALUE1) AVG(VALUE2) MAX(VALUE1) SUM(VALUE3)
    1 5,83333333333333333333333333333333333333 6 315
    Calculate the aggregated functions with all the data of the table.
    select idu, min(value1), avg(value2), max(value1), sum(value3) from testdata;
    Error SQL: ORA-00937:
    00937. 00000 - "not a single-group group function"
    Oracle don't know about what values have to calculate the aggrgates functions because there are not aggregated values in the select.
    select idu, min(value1), avg(value2), max(value1), sum(value3) from data group by idu;
    IDU MIN(VALUE1) AVG(VALUE2) MAX(VALUE1) SUM(VALUE3)
    1 1 5,5 4 95
    2 2 6,5 5 105
    3 3 5,5 6 115
    Calculate the aggregated functions in order at idu value.

  • ODI not writing group by function for xmlagg

    Hi all
    i have a requirement to create xml file the query is in the target columns are follows
    first column deptno
    second column xmlserialize(content
    xmlagg(xmlelement("emp", xmlattributes(empno as "id", ename AS "name" )
    )) as nclob indent
    i expect the out put query as
    select deptno
            , xmlserialize(content
                 xmlagg(
                   xmlelement("emp",
                     xmlattributes(empno as "id", ename as "name")
                 as clob indent
       from scott.emp
       group by deptno ;but ODI is not writing group by for xmlagg instead the code generated is
    select deptno
            , xmlserialize(content
                 xmlagg(
                   xmlelement("emp",
                     xmlattributes(empno as "id", ename as "name")
                 as clob indent
       from scott.emp;can any one help me how to put group by for the column. it should automatically write group by for aggregate columns like max min. not in case of xmlagg.

    Hi
    changed my Ikm settings
    <%=odiRef.getGrpBy()%>
    replaced with
    <% out.print("GROUP BY " + odiRef.getColList("", "[EXPRESSION]", ",", "", "UD1")); %>
    marked deptno as UD1 and insert/update and it worked....

  • NOT A GROUP BY EXPRESSION

    Good Evening,
    Maybe someone out there can help me out. I have been working on this rather long statement. Line 5 which has the to_char function is throwing an error and I don't know how to get around it. Without this line the query returns the desired results.
    Any suggestions would be appreciated.
    thanks for your help in advance.
    al
    The error message reads:
    to_char(logon_time, 'DD-MON-YY HH:MI:SS PM') LOGON_TIME,
    ERROR at line 5:
    ORA-00979: not a GROUP BY expression
    The statement is one I found in one of my manuals. I did not create this myself!
    select * from
    (select b.sid, decode(b.username, null, e.name, b.username) USER_NAME,
         d.spid OS_ID,
         b.machine MACHINE_NAME,
         --to_char(logon_time, ‘DD-MON-YY  HH:MI:SS PM’)  LOGON_TIME,
         (sum(decode(c.name, ‘physical reads’, c.statistic#, 0)) +
              sum(decode(c.name, ‘physical writes’, c.statistic#, 0)) +
              sum(decode(c.name, ‘physical writes direct’, c.statistic#, 0)) +
              sum(decode(c.name, ‘physical writes direct (lob)’, c.statistic#, 0)) +
              sum(decode(c.name, ‘physical reads direct (lob)’, c.statistic#, 0)) +
         sum(decode(c.name, ‘physical reads direct’, c.statistic#, 0))) total_physical_io,
         (sum(decode(c.NAME, ‘db block gets’, c.statistic#, 0)) +
    sum(decode(c.NAME, ‘db block changes’, c.statistic#, 0)) +
    sum(decode(c.NAME, ‘consistent changes’, c.statistic#, 0)) +
    sum(decode(c.NAME ,‘consistent gets’, c.statistic# ,0)) ) total_logical_io,
         (sum(decode(c.NAME, ‘session pga memory’, c.statistic#, 0)) +
    sum(decode(c.NAME, ‘session uga memory’, c.statistic# , 0)) ) total_memory_usage,
    sum(decode(c.NAME, ‘parse count (total)‘, c.statistic#, 0)) parses,
    sum(decode(c.NAME, ‘CPU used by this session‘,c.statistic#, 0)) total_cpu,
    sum(decode(c.NAME, ‘parse time cpu‘,c.statistic# , 0)) parse_cpu,
    sum(decode(c.NAME, ‘recursive cpu usage‘,c.statistic#, 0)) recursive_cpu ,
              sum(decode(c.NAME, ‘CPU used by this session‘, c.statistic# , 0)) –
    sum(decode(c.NAME, ‘parse time cpu‘, c.statistic#, 0)) –
    sum(decode(c.NAME, ‘recursive cpu usage‘, c.statistic# , 0)) other_cpu,
    sum(decode(c.NAME, ‘sorts (disk)‘, c.statistic#, 0)) disk_sorts,
    sum(decode(c.NAME, ‘sorts (memory)‘, c.statistic#, 0)) memory_sorts,
    sum(decode(c.NAME, ‘sorts (rows)‘, c.statistic#, 0)) rows_sorted,
    sum(decode(c.NAME, ‘user commits‘, c.statistic# , 0)) commits,
    sum(decode(c.NAME, ‘user rollbacks‘,c.statistic# , 0)) rollbacks,
    sum(decode(c.NAME, ‘execute count‘, c.statistic#, 0)) executions
    from v_$session b, v_$process d, v_$bgprocess e, v_$statname c, v_$sesstat a
    where a.STATISTIC# = c.STATISTIC# and
    b.SID = a.SID AND
    d.addr = b.paddr and
    e.paddr (+) = b.paddr and
    c.NAME in (‘physical reads’,
              ‘physical writes’,
              ‘physical writes direct’,
              ‘physical reads direct’,
              ‘physical writes direct (lob)’,
              ‘physical reads direct (log)’,
              ‘db block gets’,
              ‘db block changes’,
              ‘consistent changes’,
              ‘consistent gets’,
              ‘session pga memory’,
              ‘sessionuga memory’,
              ‘parse count (total)’,
              ‘CPU used by this session’,
              ‘parse time cpu’,
              ‘recursive cpu usage’,
              ‘sorts (disk)’,
              ‘sorts (memory)’,
              ‘sorts (rows)’,
              ‘user commits’,
              ‘user rollbacks’,
              ‘execute count’
    GROUP BY b.SID,
              D.SPID,
              DECODE (b.USERNAME, NULL, e.name, b.username), b.machine,
              to_char(logon_time, ‘DD-MON-YY HH:MI:SS PM’)
    ORDER BY 6 DESC)
    WHERE rownum <21;

    Try changing your GROUP BY from:
    GROUP BY b.SID,D.SPID,DECODE (b.USERNAME, NULL, e.name, b.username), b.machine,to_char(logon_time, ‘DD-MON-YY HH:MI:SS PM’)to:
    GROUP BY b.SID,D.SPID,DECODE (b.USERNAME, NULL, e.name, b.username), b.machine,logon_time

  • Not a group by column error message - cursor sharing

    Hi,
    Our database is Oracle 11g.
    We faced problems about some sql's. These sql's were running in Oracle 10g.
    Our sql statements are like the below query:
    SELECT COLUMN_A,COLUMN_B,COLUMN_C,
    TO_CHAR(OPERATION_DATE,'DD/MM/YYYYY'), CUSTOMER_NAME || '-' || CUSTOMER_SURNAME,
    DECODE (IS_MANAGER, 0, ' Manager', 'Employee')
    SUM(TOTAL), SUM(AMOUNT), AVG(SALARY),
    FROM TABLES
    GROUP BY COLUMN_A,COLUMN_B,COLUMN_C,
    TO_CHAR(OPERATION_DATE,'DD/MM/YYYYY'), CUSTOMER_NAME || '-' || CUSTOMER_SURNAME,
    DECODE (IS_MANAGER, 0, ' Manager', 'Employee')
    ORDER BY COLUMN_A,COLUMN_B,COLUMN_C,
    TO_CHAR(OPERATION_DATE,'DD/MM/YYYYY'), CUSTOMER_NAME || '-' || CUSTOMER_SURNAME,
    DECODE (IS_MANAGER, 0, ' Manager', 'Employee')
    When we remove order by or when we disabled cursor sharing, problem is fixed.
    I think that sql looks correct. Why we are taking not a group by column error message?
    How can we fix this problem without changing querys( we have other reports which gives same error message) or disabling cursor sharing?
    Thank you, Bye

    Dear,
    SELECT   column_a
            ,column_b
            ,column_c
            ,TO_CHAR (operation_date, 'DD/MM/YYYYY')
            ,customer_name || '-' || customer_surname
            ,DECODE (is_manager, 0, ' Manager', 'Employee')
            ,SUM (total)
            ,SUM (amount)
            ,AVG (salary)
        FROM TABLES
    GROUP BY column_a,
             column_b,
             column_c,
             TO_CHAR (operation_date, 'DD/MM/YYYYY'),
             customer_name || '-' || customer_surname,
             DECODE (is_manager, 0, ' Manager', 'Employee')
    ORDER BY column_a,
             column_b,
             column_c,
             TO_CHAR (operation_date, 'DD/MM/YYYYY'),
             customer_name || '-' || customer_surname,
             DECODE (is_manager, 0, ' Manager', 'Employee')Here you are grouping by
    DECODE (is_manager, 0, ' Manager', 'Employee')What does represent the is_manager? it is a function ? it might be that you hit one of the group by restriction such as select are not allowed into the group by clause
    Best regards
    Mohamed Houri

  • Problems with GROUP BY - not a GROUP BY expression

    Hello,
    I am fighting little bit with GROUP BY expression.
    After some tests I am able to reduce the problem to following...
    When can I use column numbers in GROUP BY expression?
    Consider this situation:
    CREATE TABLE EMP4 (
       NAME VARCHAR2(10)
    COMMIT;
    INSERT INTO EMP4 VALUES('Tamara');
    INSERT INTO EMP4 VALUES('John');
    INSERT INTO EMP4 VALUES('Joseph');
    COMMIT;
    SELECT NAME, COUNT(*)
    FROM EMP4
    GROUP BY 1;
    00979. 00000 -  "not a GROUP BY expression"
    -- This is working
    SELECT NAME, COUNT(*)
    FROM EMP4
    GROUP BY NAME;Why is the GROUP BY 1 not workig?
    I am using the GROUP BY 1 because in real query there is some PL/SQL function which somehow modifies the column NAME, so I can't use the column name
    SELECT TEST_PACKAGE.AppendSomeCharacter(NAME), COUNT(*)
    FROM EMP4
    GROUP BY 1;Of course I can nest the query and move the COUNT and GROUP BY to outer query or maybe something else, but I was just curious why is the GROUP BY not working...
    Also in real query, there are 3 columns in the GROUP BY expression, so I have there GROUP BY 1, 2, 3
    Thanks for help

    hai
    try the following
    CREATE TABLE TBL(ID NUMBER,VAL VARCHAR(20));
    INSERT INTO TBL VALUES(1,'Z');
    INSERT INTO TBL VALUES(2,'X');
    INSERT INTO TBL VALUES(1,'Z');
    INSERT INTO TBL VALUES(2,'X');
    INSERT INTO TBL VALUES(3,'A');
    INSERT INTO TBL VALUES(4,'H');
    INSERT INTO TBL VALUES(5,'B');
    INSERT INTO TBL VALUES(6,'C');
    INSERT INTO TBL VALUES(7,'T');
    INSERT INTO TBL VALUES(3,'A');
    INSERT INTO TBL VALUES(4,'H');
    INSERT INTO TBL VALUES(5,'B');
    INSERT INTO TBL VALUES(6,'C');
    INSERT INTO TBL VALUES(7,'T');
    CREATE TYPE SAMPLETYPE AS OBJECT ( ID NUMBER, NAME
    VARCHAR2(25) ) ;
    CREATE TYPE SAMPETBLTYPE AS TABLE OF SAMPLETYPE;
    CREATE OR REPLACE FUNCTION SAMPLEFUNC
    p_colname varchar2
    )return SAMPETBLTYPE pipelined as
    ret_val SAMPLETYPE;
    TYPE cursor_ref IS REF CURSOR;
    fcur cursor_ref;
    di TBL%ROWTYPE;
    sqlstr varchar2(1000);
    colname varchar(30):=p_colname;
    begin
    sqlstr:='SELECT * FROM TBL ORDER BY '|| colname ;
    DBMS_OUTPUT.PUT_LINE(sqlstr);
    open fcur FOR sqlstr;
    loop
    FETCH fcur INTO di;
    EXIT WHEN fcur%NOTFOUND;
    ret_val:=SAMPLETYPE(di.ID,di.VAL);
    PIPE ROW(ret_val);
    end loop;
    close fcur;
    return;
    end;     
    select * from table(SAMPLEFUNC('ID'));
    select * from table(SAMPLEFUNC('VAL'));

Maybe you are looking for