GETTING AN ERROR -GROUP FUNCTIO NOT ALLOWED  HERE

SELECT user_id, packageid,
DECODE (bstplantype,
0, ( CEIL ( SUM (duration_seconds) ------GROUP FUNCTION OT ALLOWED HERE
/ ( DECODE (ispeak,
0, offpeakpulse,
peakpulse
* convert_duration (ratingunit, pulseunit)
* DECODE (ispeak, 0, offpeakpulse, peakpulse)
* convert_duration (ratingunit, pulseunit)
- (freevalue * convert_duration (ratingunit, pulseunit)),
CEIL ( (SUM (upload_bytes) + SUM (download_bytes))
/ ( DECODE (ispeak, 0, offpeakpulse, peakpulse)
* convert_bytes (ratingunit, pulseunit)
* DECODE (ispeak, 0, offpeakpulse, peakpulse)
* convert_bytes (ratingunit, pulseunit)
- (freevalue * convert_bytes(ratingunit, pulseunit)))
FROM aaa_interim a, subscriber_rate_tab srt
WHERE a.user_id = srt.externalid
AND a.isday=srt.FREEVALUETYPE
AND DECODE (bstplantype,
0, ( CEIL ( SUM (duration_seconds)
/ ( DECODE (ispeak,
0, offpeakpulse,
peakpulse
* convert_duration (ratingunit, pulseunit)
* DECODE (ispeak, 0, offpeakpulse, peakpulse)
* convert_duration (ratingunit, pulseunit)
- (freevalue * convert_duration (ratingunit, pulseunit)),
CEIL ( (SUM (upload_bytes) + SUM (download_bytes))
/ ( DECODE (ispeak, 0, offpeakpulse, peakpulse)
* convert_duration (ratingunit, pulseunit)
* DECODE (ispeak, 0, offpeakpulse, peakpulse)
* convert_duration (ratingunit, pulseunit)
- (freevalue * convert_duration (ratingunit, pulseunit))) >
0.8 * MIN (NVL (srt.creditthreshold, 0))
GROUP BY user_id,
packageid,
bstplantype,
ispeak,
peakpulse,
offpeakpulse,
ratingunit,
pulseunit,
freevalue,
vendor_Session_id ------to sum up all the stop records belonging to the same user_id and session(stitching and all)

Hi
Can't really be bothered checking this properly given what you have posted as a question but, at first glance, I think you actually mean something like this...
SELECT   user_id,
         packageid,
         DECODE(bstplantype,
                0,
                (CEIL(SUM(duration_seconds) ------GROUP FUNCTION OT ALLOWED HERE
                      / (DECODE(ispeak, 0, offpeakpulse, peakpulse)
                         * convert_duration(ratingunit, pulseunit)))
                 * DECODE(ispeak, 0, offpeakpulse, peakpulse)
                 * convert_duration(ratingunit, pulseunit))
                - (freevalue * convert_duration(ratingunit, pulseunit)),
                CEIL((SUM(upload_bytes) + SUM(download_bytes))
                     / (DECODE(ispeak, 0, offpeakpulse, peakpulse)
                        * convert_bytes(ratingunit, pulseunit)))
                * DECODE(ispeak, 0, offpeakpulse, peakpulse)
                * convert_bytes(ratingunit, pulseunit)
                - (freevalue * convert_bytes(ratingunit, pulseunit)))
FROM     aaa_interim a, subscriber_rate_tab srt
WHERE    a.user_id = srt.externalid AND a.isday = srt.freevaluetype
GROUP BY user_id,
         packageid,
         bstplantype,
         ispeak,
         peakpulse,
         offpeakpulse,
         ratingunit,
         pulseunit,
         freevalue,
         vendor_session_id
HAVING   DECODE(bstplantype,
                0,
                (CEIL(SUM(duration_seconds)
                      / (DECODE(ispeak, 0, offpeakpulse, peakpulse)
                         * convert_duration(ratingunit, pulseunit)))
                 * DECODE(ispeak, 0, offpeakpulse, peakpulse)
                 * convert_duration(ratingunit, pulseunit))
                - (freevalue * convert_duration(ratingunit, pulseunit)),
                CEIL((SUM(upload_bytes) + SUM(download_bytes))
                     / (DECODE(ispeak, 0, offpeakpulse, peakpulse)
                        * convert_bytes(ratingunit, pulseunit)))
                * DECODE(ispeak, 0, offpeakpulse, peakpulse)
                * convert_bytes(ratingunit, pulseunit)
                - (freevalue * convert_bytes(ratingunit, pulseunit))) >
            (0.8 * MIN(NVL(srt.creditthreshold, 0)))Not a great query though. I would look into the CASE statement and subquery factoring (the WITH clause) to make this readable and remove repetition.
Cheers
Ben

Similar Messages

  • Getting an error - group function not allowed here

    Below is the merge statement...
    getting an error - group function not allowed here
    WHY????
    merge into summary
    using
    (select
    a.user_id,
    min(a.start_time_utc),
    max(a.end_time_utc),
    sum(a.duration_seconds),
    /*total_upload
    total_download
    total_traffic,*/
    max(r.package_id),
    last_usage_charge, -------hard coded
    max(r.peak_rate),
    max(r.bst_plantype),
    max(r.free_value), ---for free value
    a.IsPeak,
    sum(a.TotalDiscount)
    from aaa_sessions a,rate_plan r,subscriber_info si
    where
    si.EXTERNAL_ID=a.USER_ID
    and
    si.PACKAGE_ID=r.PACKAGE_ID
    group by
    user_id,bst_plantype,ispeak)t ------do we need to use alias here
    on
    (summary.user_id=t.user_id
    and
    summary.type_of_summary=t.bst_plantype
    and
    summary.ispeak=t.ispeak)
    When matched then
    update
    set
    start_date =decode((t.start_time_utc-summary.start_date)-abs(t.start_time_utc-summary.start_date),0,summary.start_date,t.start_time_utc),
    end_date=decode((t.end_time_utc-summary.end_date)-abs(t.end_time_utc-summary.end_date),0,t.end_time_utc,s.end_date),
    total_duration=summary.total_duration+sum(duration_seconds),
    total_upload=summary.total_upload+sum(upload_bytes),
    total_download=summary.total_download+sum(download_bytes),
    total_traffic=summary.total_upload+sum(upload_bytes)+summary.total_download+sum(download_bytes)
    When not matched then
    INSERT
    (user_id ,
    start_date,
    end_date,
    total_duration,
    /*total_upload
    total_download
    total_traffic,*/
    rate_plan_id,
    last_usage_charge,
    peak_rate,
    type_of_summary,
    IsPeak,
    TotalDiscount)
    VALUES
    (t.user_id,
    t.start_time_utc,
    t.end_time_utc,
    t.duration_seconds,
    /*t.output_bytes,
    t.input_bytes,
    t.output_bytes+aa.input_bytes,*/
    t.PACKAGE_ID,
    1, ---hard coded the value
    t.PEAK_RATE,
    t.BST_PLANTYPE,
    t.ispeak,
    t.free_value);

    This is the query,...
    Its giving no complilation errors..
    I have not used aggregate functions in the insert/update..
    have used only decode...
    and nowhere i found that aggegate functions not allowed in the insert/update stmts of merge..
    Can u please post a link where it is mentioned...
    MERGE INTO summary
    USING (SELECT a.user_id, MIN (a.start_time_utc) stc,
    MAX (a.end_time_utc) etc, SUM (a.duration_seconds) ds,
    SUM (a.download_bytes) download,
    SUM (a.upload_bytes) upload, MAX (r.package_id) pkg_id,
    MAX (r.peak_rate) p_rate, MAX (r.offpeak_rate)
    ofp_rate,
    MAX (r.bst_plantype) plan_type,
    SUM (r.free_value) free_val, a.ispeak,
    MAX (r.peak_pulse) p_pulse,
    MAX (r.offpeak_pulse) ofp_pulse
    FROM aaa_sessions a, rate_plan r, subscriber_info si
    WHERE si.external_id = a.user_id
    AND si.package_id = r.package_id
    GROUP BY user_id, bst_plantype, ispeak) t
    ON ( summary.user_id = t.user_id
    AND summary.type_of_summary = t.plan_type
    AND summary.rate_plan_id = t.pkg_id
    AND summary.ispeak = t.ispeak)
    WHEN MATCHED THEN
    UPDATE
    SET start_date =
    DECODE ( (t.stc - summary.start_date)
    - ABS (t.stc - summary.start_date),
    0, summary.start_date,
    t.stc
    end_date =
    DECODE ( (t.etc - summary.end_date)
    - ABS (t.etc - summary.end_date),
    0, t.etc,
    summary.end_date
    total_duration = summary.total_duration + t.ds,
    total_download = summary.total_download + t.download,
    total_upload = summary.total_upload + t.upload,
    total_traffic =
    summary.total_upload
    + t.upload
    + summary.total_download
    + t.download,
    last_usage_charge =
    DECODE (t.plan_type,
    0, (t.ds - t.free_val)
    / DECODE (t.ispeak, 0, t.ofp_pulse, p_pulse)
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate),
    ((t.download + t.upload) - t.free_val
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate)
    WHEN NOT MATCHED THEN
    INSERT (user_id, start_date, end_date, total_duration,
    total_download, total_upload, total_traffic, rate_plan_id,
    last_usage_charge, peak_rate, type_of_summary, ispeak,
    totaldiscount)
    VALUES (t.user_id, t.stc, t.etc, t.ds, t.download, t.upload,
    t.download + t.upload, t.pkg_id,
    DECODE (t.plan_type,
    0, (t.ds - t.free_val)
    / DECODE (t.ispeak, 0, t.ofp_pulse, p_pulse)
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate),
    ((t.download + t.upload) - t.free_val
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate)
    t.p_rate, t.plan_type, t.ispeak, t.free_val);
    COMMIT;

  • Epub validation error: element "ol" not allowed here; expected element "li"

    How do i fix this?
    and why is the InDesign exporting incorrect html for it's fixed layout epubs? Is this a new issue with the recent update?

    Which version of InDesign are you using?
    Validation errors have been reduced with the latest update of ID CC 2014.2 last week.

  • When trying to transfer an e-book I get an error message "Copy not allowed.  You are not allowed to copy this book.

    I am trying to copy a book from digital editions to my nook and am told "You do not have permission to copy this book".  Yet all I want to do is move a copy to read it.

    The publisher of the book seems to have restricted copying of the book on to other devices. Contact the book distributor.

  • Getting the error column not allowed here in jdbc

    i have got an error
    when using jdbc.
    i have inserted the data from taking java textfields.
    The error is:column not allowed here.
    how to rectify this?
    iam eagerly waiting for ur reply.

    Hi,
    This is the forum for the SQL Developer Data Modeler product.
    I suggest you try asking your question on the SQL and PL/SQL Forum: PL/SQL
    David

  • Seq # not allowed here

    while executing the below query. I m getting this error ora error 02287 " sequence # not allowed here"
            SELECT SVC_ORD_DETAIL_ID.NEXTVAL,
                   K.SVC_ORDER_ID,
                   'RELEASED_DATE',
                   K.RELEASEDT
            FROM (SELECT S.SVC_ORDER_ID,
                         TO_DATE(T.RELSD_DT||T.RELSD_TM,'yyyymmddhh24miss') AS RELEASEDT
                         FROM IONS09MAR12.SVC_ORDER S,
                         M09_NT_UV_IMPLEMENT_PLAN T
                   WHERE S.ORDER_NUMBER(+) = T.PLAN_ID) K;

    As I predicted then.
    Below is extract from Oracle Documentation:-
    Restrictions on Sequence Values You cannot use CURRVAL and NEXTVAL in the
    following constructs:
    A subquery in a DELETE, SELECT, or UPDATE statement
    A query of a view or of a materialized view
    A SELECT statement with the DISTINCT operator
    A SELECT statement with a GROUP BY clause or ORDER BY clause
    A SELECT statement that is combined with another SELECT statement with the
    UNION, INTERSECT, or MINUS set operator
    The WHERE clause of a SELECT statement
    The DEFAULT value of a column in a CREATE TABLE or ALTER TABLE statement
    The condition of a CHECK constraint
    _Within a single SQL statement that uses CURRVAL or NEXTVAL, all referenced LONG_
    _columns, updated tables, and locked tables must be located on the same database._

  • ORA-01733- virtual column not allowed here  - Insert using inline view

    Does anyone know why I am getting ORA-01733- virtual column not allowed here
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    ---no error without WITH CHECK option
    SQL> INSERT INTO
    2 (SELECT
    3 location_id,
    4 city,
    5 l.country_id
    6 FROM countries c, locations l,regions r
    7 where l.country_id = c.country_id
    8 and r.region_id=c.region_id
    9 and r.region_name = 'Asia')
    10 VALUES (5500, 'Wansdworth Common', 'UK');
    1 row created.
    SQL> rollback;
    Rollback complete.
    -----error with WITH CHECK OPTION
    SQL> INSERT INTO
    2 (SELECT
    3 location_id,
    4 city,
    5 l.country_id
    6 FROM countries c, locations l,regions r
    7 where l.country_id = c.country_id
    8 and r.region_id=c.region_id
    9 and r.region_name = 'Asia' WITH CHECK OPTION)
    10 VALUES (5500, 'Wansdworth Common', 'UK');
    INSERT INTO
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    I was expecting
    ORA-01402: view WITH CHECK OPTION where-clause violation
    for the second one. Is there anything I am missing here ?

    Randolf
    Thank you very much for the update to this old question
    After reading the link I think I should ignore this error and accept it as ORA-01402
    The information you asked me to check did not lead me an understanding of different error types.
    SQL> ----view for ORA-01733
    SQL> create view test_v_1
      2  as
      3  SELECT
      4  location_id,
      5  city,
      6  l.country_id
      7  FROM countries c, locations l,regions r
      8  where l.country_id = c.country_id
      9  and r.region_id=c.region_id
    10  and r.region_name = 'Asia' WITH CHECK OPTION;
    View created.
    SQL>
    SQL>
    SQL>
    SQL> select * from user_updatable_columns where table_name='TEST_V_1';
    OWNER                          TABLE_NAME                     COLUMN_NAME                    UPD INS DEL
    HR                             TEST_V_1                       CITY                           YES YES YES
    HR                             TEST_V_1                       COUNTRY_ID                     NO  NO  NO
    HR                             TEST_V_1                       LOCATION_ID                    YES YES YES
    SQL>
    SQL> ----view for ORA-01402
    SQL>
    SQL> create view test_v_2
      2  as
      3  SELECT
      4  d.department_id,
      5  d.department_name,
      6  d.location_id
      7  FROM hr.departments d,hr.locations l
      8  WHERE l.location_id=d.location_id
      9  and d.location_id < 2000
    10  WITH CHECK OPTION;
    View created.
    SQL>
    SQL> select * from user_updatable_columns where table_name='TEST_V_2';
    OWNER                          TABLE_NAME                     COLUMN_NAME                    UPD INS DEL
    HR                             TEST_V_2                       DEPARTMENT_ID                  YES YES YES
    HR                             TEST_V_2                       DEPARTMENT_NAME                YES YES YES
    HR                             TEST_V_2                       LOCATION_ID                    NO  NO  NO
    SQL>
    SQL>
    SQL> ----INSERT STILL FAILING WITH DIFFERENT ERROR DESPITE THE SAME UPDATABLE COLUMN STRUCTURE
    SQL> insert into test_v_1 values  (5500, 'Wansdworth Common', 'UK');
    insert into test_v_1 values  (5500, 'Wansdworth Common', 'UK')
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    SQL> insert into test_v_2 values  (9999, 'Entertainment', 2500);
    insert into test_v_2 values  (9999, 'Entertainment', 2500)
    ERROR at line 1:
    ORA-01402: view WITH CHECK OPTION where-clause violation
    SQL>A. Coskan GUNDOGAR
    Oracle DBA
    http://coskan.wordpress.com
    “A man's errors are his portals of discovery.”
    James Joyce

  • Database Connection: Http Error 405 Method Not Allowed

    Hi,
    I am new to this forum, but I am having an issue I hope you can help with.  I have a database on my MS SQL Server 2008.  I am trying to access it with my DW8 page, and while I can code a connection successfully, I can't use the Database or Bindings Tab in DW.  I can successfully get the database to show if I "Build..." the connection (Test Connection works.)  However, if I click ok, the database shows up in my tab, but under Tables... (none)!  Also, if I hit Test button on the OLE Db Connection window, I get Http Error 405 Method Not Allowed.  If I use the SQL Server Connection Option, I get the same result.
    I have scoured Google for an answer.  There are a lot of links to questions, but no answers.  There was apparently an answer on adobe.com, but the link is broken: http://www.macromedia.com/support/dreamweaver/ts/documents/err405.htm.   Any suggestions would be greatly appreciated.
    Have a great Day!
    RobF

    Thank you SnakEyez02.
    I had the Testing Server set to Local/Network but didn't have MySQL installed locally.  Changed that setting to FTP and it picked up on the database correctly.
    When using MSSQL it doesn't matter whether you choose Local/Network or FTP it just picks up the online database regardless.  I guess this must just be a difference between it and MySQL.
    Thanks for the advice.  Much appreciated.
    NJ

  • Error 405 Method Not Allowed

    I am using Dreamweaver 8 (Studio 8) and made some PHP pages
    finally got connected to the database and everything was working
    fine for two weeks. Then out of the blue a few days ago all of a
    sudden I can not connect to the database through Dreamweaver. I can
    connect using SQLyog but not Dreamweaver just keep getting an
    "Error 405 Method not Allowed"
    Any Ideas???

    found my own fix finally
    http://www.dreamweavermxsupport.com/index.php?type=article&id=85&block=1&pid=60&sid=61

  • How to solve error - default position not allowed

    Dear friends,
    While hiring a new person i am getting the error "default positon not allowed" in infotype 0001.
    PLOGI-PRELI switch for default positon is maintained. Kindly help.

    Dear Neeta,
    As per your scenerio,it maybe that the position once used can not be used again or default position has been restricted to
    assign kindly check the same with ABAP and also be informed that these kind of restriction are being made to get the proper cost
    centre attachment for the position/employee that helps in correct posting of documents while posting payroll.
    hopes it will help for you.
    rgds,
    Priyanka

  • ORA-00934: group function is not allowed here

    Hi,
    My requirement is to check oi.quantity is equal to sum of packing_detail. quantity
    by order_number
    select oi.quantity_ordered oi_qu, pd.quantity pq
    from ordered_items oi, packing_details pd
    where oi.ordered_item_id = pd.ordered_item_id
    and oi.quantity_ordered = sum(pd.quantity)
    and oi.order_number = '29';
    after executing above query I get error
    SQL Error: ORA-00934: group function is not allowed here
    00934. 00000 - "group function is not allowed here"
    Please tell me how to resolve it.
    Thanks in advance
    Sandy

    You have to make use of a subquery;
    select oi.quantity_ordered oi_qu, pd.quantity pq
    from ordered_items oi, packing_details pd 
    where oi.ordered_item_id = pd.ordered_item_id 
    and oi.quantity_ordered = *(select sum(pd.quantity) from packing_details pd1 group by pd1.ordered_item_id)* 
    and oi.order_number = '29';  This is based on the assumption that ordered_items is the summarize data and packing_details are the line item level data.
    regards,
    Dipankar.

  • ERROR ITMS-9000: "index_split_000.html(257): attribute "name" not allowed here; expected attribute "accesskey", "charset", "class", "coords", "dir", "href", "hreflang", "id", "rel", "rev", "shape", "style", "tabindex", "target", "title", "type" or "xml:la

    I have all these errors, can anyone help with this all means? trying to get my book published in iBooks. Nedd your help. Thanks, Jo
    ERROR ITMS-9000: "index_split_000.html(257): attribute "name" not allowed here; expected attribute "accesskey", "charset", "class", "coords", "dir", "href", "hreflang", "id", "rel", "rev", "shape", "style", "tabindex", "target", "title", "type" or "xml:lang"" at Book (MZItmspBookPackage)
    Use of the block quote element can cause ePubecheck to give the error "text not allowed here".  Text must not be alone inside of a body tag and if it is not enclosed in some other block level tag, this may lead to the error you are receiving.  

    I have all these errors, can anyone help with this all means? trying to get my book published in iBooks. Nedd your help. Thanks, Jo
    ERROR ITMS-9000: "index_split_000.html(257): attribute "name" not allowed here; expected attribute "accesskey", "charset", "class", "coords", "dir", "href", "hreflang", "id", "rel", "rev", "shape", "style", "tabindex", "target", "title", "type" or "xml:lang"" at Book (MZItmspBookPackage)
    Use of the block quote element can cause ePubecheck to give the error "text not allowed here".  Text must not be alone inside of a body tag and if it is not enclosed in some other block level tag, this may lead to the error you are receiving.  

  • PL/SQL equivalent of T-SQL - "group function is not allowed here"

    Hi all, hope someone can give me a hand as I'm pretty stuck! I have been trying to convert some MS SQL Server T-SQL statements into Oracle PL/SQL and am stuck on the below one:
    SELECT
    CA.AssessmentID,
    (SELECT ProductName + ISNULL(' - ' + PrincipalBenefit,'')
    FROM rptPolicySnapshot WHERE PolicyID = MAX(CA.PolicyID)
    AND SnapshotID = 1),
    MAX(CA.PolicyID)
    FROM rptClaimInvoiceLineSnapshot CIL
    INNER JOIN rptClaimAssessmentSnapshot CA
    ON CIL.AssessmentID = CA.AssessmentID
    AND CIL.SnapshotID = CA.SnapshotID
    WHERE CIL.SnapshotID = 1
    GROUP BY CA.AssessmentID
    This works fine in MSSQL but returns the below error in Oracle:
    'ORA-00934: group function is not allowed here'
    If I take out the subquery the query works fine.
    Any ideas as to the syntax? I am new to Oracle so not sure as to how I should go about writing this.
    Thanks in advance!
    Leo

    WITH x AS (SELECT   ca.assessmentid,
                        MAX (ca.policyid) policy_id
               FROM rptclaiminvoicelinesnapshot cil
                    INNER JOIN rptclaimassessmentsnapshot ca
                        ON cil.assessmentid = ca.assessmentid
                       AND cil.snapshotid = ca.snapshotid
               WHERE cil.snapshotid = 1
               GROUP BY ca.assessmentid
    SELECT x.assessment_id,
           x.policy_id,
           productname + decode(principalbenefit,null,null,' - ' || principalbenefit ) prodname
    FROM   rptpolicysnapshot, x
    WHERE  policyid = x.policy_id
    AND    snapshotid = 1I think that's in the neighbourhood.

  • PL/SQL: ORA-00934: group function is not allowed here

    Hi,
    I am writing a PL/SQL procedure. The structure is like :
    SET SERVEROUTPUT ON;
    CREATE OR REPLACE Procedure abc
    IS
    v_total_ip_rec number(14);
    v_total_op_rec number(14);
    v_total_rec number(14);
    BEGIN
    SELECT SUM (CASE
    WHEN <condition 1>
    THEN 1
    ELSE 0
    END
    ) into v_total_ip_rec,
    SUM (CASE
    WHEN <condition 2>
    THEN 1
    ELSE 0
    END
    ) into v_total_op_rec,
    SUM (1) into v_total_rec
    FROM A,B
    WHERE A.Col1=B.Col1;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END;
    When I run this procedure it gives me following error:
    "PL/SQL: ORA-00934: group function is not allowed here"
    Anybody have any idea?
    Any help would be appreciated.
    Thanks.

    Hi Arunkumar ,
    I think you don't need subquery.
    Regards Salim.
    Or.
    SELECT COUNT (CASE
                     WHEN <condition 1>
                        THEN 1
                  END) v_total_ip_rec,
           COUNT (CASE
                     WHEN <condition 2>
                        THEN 1
                  END) v_total_op_rec,
           COUNT (1) v_total_rec
      FROM a, b
    WHERE a.col1 = b.col1

  • Help - error : ORA-00984: Column not allowed here

    Hi,
    I'm writing a simple Java program to update values into Oracle tables. But getting error - 'ORA-00984: Column not allowed here' in the line - sql2.executeUpdate(acctTabSql);
    There is no column name used in 'insert statement - and referred suggestion here to resolve the error, but couldn't. Please write me how to resolve it. ?
    Here is the code snippet below.
    Thanks, Vasu
    T_ACCT
    ACCT_ID (PK) GEN INTEGER
    ALS_NBR:STRING
    STATUS_CD:STRING
    NOTE_DT:DATE
    int intVal1 = 0;
              int intVal2 = 0;
              Statement sql1 = oraConnection.createStatement();
              ResultSet rs = sql1.executeQuery("SELECT ACCT_ID_SEQ.NEXTVAL, APPL_ID_SEQ.NEXTVAL FROM DUAL");
              while(rs.next()){
              intVal1 = rs.getInt(1);
              intVal2 = rs.getInt(2);
              System.out.println("ACCT_ID :" + intVal1);
              System.out.println("APPL_ID :" + intVal2);
              sql1.close();
              Statement sql2 = oraConnection.createStatement();
              String acctTabSql = "INSERT INTO VPDBO.T_ACCT (ACCT_ID, ALS_NBR, NOTE_DT, HELMS_NBR, SL_REF_NBR, BK_MSG_RECEIVED_DT) " +
                        "VALUES (intVal1,'' ,'' ,'' ,'' ,'' )";
              System.out.println(acctTabSql);
    -/Error/-     sql2.executeUpdate(acctTabSql);
              sql2.close();
              Statement sql3 = oraConnection.createStatement();
              String applTabSql = "INSERT INTO T_APPL (APPL_ID, ACAPS_ID, STATUS_CD, ACAPS_PROD_CD, ACCT_ID, DCAPP_MSG_RECEIVED_DT) " +
                        "VALUES (intVal1, valappIdValue, 'EN', '', intVal2, '08/26/09')";
              System.out.println(applTabSql);
              sql3.executeUpdate(applTabSql);
              sql3.close();
              oraConnection.commit();

    Hi,
    make sure final statement is like :
    INSERT INTO VPDBO.T_ACCT (ACCT_ID, ALS_NBR, NOTE_DT, HELMS_NBR, SL_REF_NBR, BK_MSG_RECEIVED_DT)
    VALUES(intVal1,NULL,NULL,NULL,NULL,NULL)instead of
    String acctTabSql = "INSERT INTO VPDBO.T_ACCT (ACCT_ID, ALS_NBR, NOTE_DT, HELMS_NBR, SL_REF_NBR, BK_MSG_RECEIVED_DT) " +
    "VALUES (intVal1,'' ,'' ,'' ,'' ,'' )";Cheers,
    Avin ash

Maybe you are looking for

  • Writing to file using PrintStream and PrintWriter...

    I tried to write a string to a file, it actually ADD the string to the bottom of the text file without deleting what was already in there. at first I use PrintStream, it worked fine when run it from my MS-J++6.0, but it says "PrintStream has been dep

  • Is there any way to do print tray control in XMLP?

    The requirement is for check printing. Here is the requirement If printing a check, use the check stock tray. Else if printing the remittance advice, use the plain paper tray. Is there any way I can implement this logic? Thnx

  • Acrobat Pro 10.0.2 Crashing on Mac OS 10.6.7

    Having a series of crashing issues between Acrobat Pro 10.0.2 and InDesign CS4 (6.0.2). InDesign crashes every time I export to PDF. Acrobat crashes shortly after I start working in it. I've tried deleting preferences, caches, and disabling some font

  • Want to create Searchbar on SQL report

    Hi evryone... I had created SQL report in my appication.......But i coould nt find serch bar option which generally create with interactive report...so if i would like to create serchbar in my SQL report then how could i able to do that thing?? thank

  • Need help troubleshooting poor performance loading cubes

    I need ideas on how to troubleshoot performance issues we are having when loading our infocube.  There are eight infopackages running in parallel to update the cube.  Each infopackage can execute three datapackages at a time.  The load performance is