Query is throwing an error like missing right paranthesis.,

Hi,
The below query is throwing an error like missing right paranthesis.,
and Is there any way to write the same query in a simpler way ?
SELECT AVALABLEBALANCE
FROM (
( SELECT SUM(TH1.TRANSACTIONAMOUNT)
FROM TRANSACTIONHISTORY TH1,
TRANSACTIONTYPE TT,
CARDDETAIL CD,
P2P_CARDDETAIL P2P
WHERE TH1.TRANSACTIONTYPEID = TT.TRANSACTIONTYPEID
AND TH1.CARDID = CD.CARDID
AND CD.CARDID = P2P.CARDID
AND TH1.CARDID = 6013
AND TT.TRANSACTIONTYPECODE IN ('WITHDRAWAL_CHECK_FEE')
AND TRUNC(TH1.TRANSACTIONDATETIME) = TRUNC(TH3.TRANSACTIONDATETIME)
GROUP BY TH1.TRANSACTIONTYPEID,TH1.CARDID,TRUNC(TH1.TRANSACTIONAMOUNT)) -
( SELECT SUM(TH2.TRANSACTIONAMOUNT)
FROM TRANSACTIONHISTORY TH2,
TRANSACTIONTYPE TT,
CARDDETAIL CD,
P2P_CARDDETAIL P2P
WHERE TH2.TRANSACTIONTYPEID = TT.TRANSACTIONTYPEID
AND TH2.CARDID = CD.CARDID
AND CD.CARDID = P2P.CARDID
AND TH2.CARDID = 6013
AND TT.TRANSACTIONTYPECODE IN ('FUND_TRANSFER_RECEIVED')
AND TRUNC(TH2.TRANSACTIONDATETIME) = TRUNC(TH3.TRANSACTIONDATETIME)
GROUP BY TH2.TRANSACTIONTYPEID,TH2.CARDID,TRUNC(TH2.TRANSACTIONAMOUNT))
) T , TRANSACTIONHISTORY TH3
WHERE TH3.CARDID = 6013

Hi Sekar,
Here is your formatted code:
/* Formatted on 2007/11/16 16:42 (Formatter Plus v4.8.0) */
SELECT avalablebalance
FROM ((SELECT SUM (th1.transactionamount)
FROM transactionhistory th1,
transactiontype tt,
carddetail cd,
p2p_carddetail p2p
WHERE th1.transactiontypeid = tt.transactiontypeid
AND th1.cardid = cd.cardid
AND cd.cardid = p2p.cardid
AND th1.cardid = 6013
AND tt.transactiontypecode IN ('WITHDRAWAL_CHECK_FEE')
AND TRUNC (th1.transactiondatetime) =
TRUNC (th3.transactiondatetime)
GROUP BY th1.transactiontypeid,
th1.cardid,
TRUNC (th1.transactionamount))
MINUS
(SELECT SUM (th2.transactionamount)
FROM transactionhistory th2,
transactiontype tt,
carddetail cd,
p2p_carddetail p2p
WHERE th2.transactiontypeid = tt.transactiontypeid
AND th2.cardid = cd.cardid
AND cd.cardid = p2p.cardid
AND th2.cardid = 6013
AND tt.transactiontypecode IN ('FUND_TRANSFER_RECEIVED')
AND TRUNC (th2.transactiondatetime) =
TRUNC (th3.transactiondatetime)
GROUP BY th2.transactiontypeid,
th2.cardid,
TRUNC (th2.transactionamount))) t,
transactionhistory th3
WHERE th3.cardid = 6013
-Edit: Lol this forum's text box does not have a proper formatter to show our codes perfectly :(.. Very sorry about the expected format here.. Lol !!
***Lol Poor Format***
Message was edited by:
user599090
I replaced the '-' with MINUS Keyword. That was the mistake you made i guess.

Similar Messages

  • ORA-00907 MISSING RIGHT PARANTHESIS

    Dear all,
    The query
    FLASHBACK TABLE schema.table_name TO TIMESTAMP('18-JAN-2008 18:55:58','DD-MON-YYYY HH24:MI:SS');
    gives me the error
    ORA-00907 MISSING RIGHT PARANTHESIS
    WHAT AM MISSING HERE ?
    kAI

    Pretty much the usual
    You grossly violate forums etiquette by
    - not posting a version and a platform
    - not looking up the error message
    - not verifying syntax
    - by SHOUTING most of your question
    in short you demonstrate you are utterly lazy and utterly rude.
    Doing so, you have now entered as a runner up in the competition to qualify for the biggest abuser of this forum by not doing anything yourself.
    Yes, I know you will be angry. And why will you be angry? Because I state the truth!
    People like you should be banned from this forum completely.
    Sybrand Bakker
    Senior Oracle DBA

  • Missing right paranthesis

    CREATE TABLE tbl_room
    ( room_id NUMBER,
    accommodation_id NUMBER,
    floor_area NUMBER,
    rentable NUMBER(1),
    type VARCHAR2(20),
    CONSTRAINT pk_room PRIMARY KEY (room_id),
    CONSTRAINT fk_room_accommodation FOREIGN KEY (accommodation_id) REFERENCES tbl_accommodation(accommodation_id),
    CONSTRAINT ck_rentable CHECK (rentable IN 0,1));
    I am getting a "missing right paranthesis" error when i try to executre this create statement. Could someone explain why. The error is caused by the check constraint.
    Thanks

    try this..
    CREATE TABLE tbl_room
    ( room_id NUMBER,
    accommodation_id NUMBER,
    floor_area NUMBER,
    rentable NUMBER(1),
    type VARCHAR2(20),
    CONSTRAINT pk_room PRIMARY KEY (room_id),
    CONSTRAINT fk_room_accommodation FOREIGN KEY (accommodation_id) REFERENCES tbl_accommodation(accommodation_id),
    CONSTRAINT ck_rentable CHECK (rentable IN (0,1)));

  • Perticular select query is throwing the error..

    Hi all,
    i am trying to get the ffew feilds with the count of one specific feild called as bpartner but the cursor doesnot move inside the select and directly going to the message and thowing the message as output..
    can u please check it out and let me know where i have to change the query....and if the code whatever is written is right or not....
    thanks in advance,,,
    REPORT  ZDISTRICT_CUST_AUCSALES00.
    TABLES: /BIC/AUCSALES00,
            /BIC/TCOKEY.
    DATA:  BEGIN OF ITAB OCCURS 0,
              BILL_DATE   LIKE /BIC/AUCSALES00-BILL_DATE,
              /BIC/COKEY  LIKE /BIC/AUCSALES00-/BIC/COKEY,
              BPARTNER    LIKE /BIC/AUCSALES00-BPARTNER,
              TXTSH       LIKE /BIC/TCOKEY-TXTSH,
              CUSTOMER    TYPE I,
           END OF ITAB.
    DATA: BILDT LIKE /BIC/AUCSALES00-BILL_DATE.
    SELECT-OPTIONS: S_BILDT FOR /BIC/AUCSALES00-BILL_DATE.
    **AT SELECTION-SCREEN.
    IF NOT s_bildt IS INITIAL.
       write:/ 'please enter a value'.
       SELECT * FROM /BIC/AUCSALES00
       INTO  BILDT
       WHERE BILL_DATE EQ S_BILDT.
    ENDIF.
    IF SY-SUBRC <> 0.
       WRITE:/ 'please enter a '.
       MESSAGE E010 WITH 'NOT A VALID DATE'(003) S_BILL_DATE 'Found'(004).
    ENDIF.
      <b>SELECT A~BILL_DATE
             A~/BIC/COKEY
             A~BPARTNER
             COUNT( DISTINCT A~BPARTNER )
             B~TXTSH
            INTO (BILL_DATE, COKEY, BPARTNER, COUNT, TXTSH)
             INTO CORRESPONDING FIELDS OF TABLE ITAB
             FROM /BIC/AUCSALES00 AS A INNER JOIN /BIC/TCOKEY AS B
             ON A/BIC/COKEY = B/BIC/COKEY
             WHERE BILL_DATE = S_BILDT
            A/BIC/COKEY = B/BIC/COKEY
             GROUP BY ABILL_DATE A/BIC/COKEY ABPARTNER BTXTSH
             ORDER BY A~/BIC/COKEY.
            ENDSELECT.</b>
      <i>IF SY-SUBRC NE 0.
        WRITE:/ 'doesnot contain any data'.
      ENDIF.</i>
      LOOP AT ITAB.
        WRITE:/ SY-VLINE, ITAB-BILL_DATE,
             15 SY-VLINE, ITAB-/BIC/COKEY,
             30 SY-VLINE, ITAB-TXTSH,
             45 SY-VLINE, ITAB-CUSTOMER,
             60 SY-VLINE.
        ULINE /(60).
        AT END OF BPARTNER.
          SUM.
          WRITE:/45 'TOTAL NUMBER OF CUSTOMER:',45 ITAB-CUSTOMER.
        ENDAT.

    Hi,
    Try like this,
    SELECT A~BILL_DATE
    A~/BIC/COKEY
    A~BPARTNER
    COUNT( DISTINCT A~BPARTNER )
    B~TXTSH
    INTO (BILL_DATE, COKEY, BPARTNER, COUNT, TXTSH)
    INTO CORRESPONDING FIELDS OF TABLE ITAB
    FROM /BIC/AUCSALES00 AS A INNER JOIN /BIC/TCOKEY AS B
    ON A/BIC/COKEY = B/BIC/COKEY
    WHERE BILL_DATE<b> IN</b> S_BILDT
    A/BIC/COKEY = B/BIC/COKEY
    GROUP BY ABILL_DATE A/BIC/COKEY ABPARTNER BTXTSH
    ORDER BY A~/BIC/COKEY.
    ENDSELECT.
    <b>
    Regards,
    Azhar</b>

  • Getting an error missing right paranthesis

    merge into TEMP_RECORDS_MED_DATE_0001  Tmpr
    using
    (select callstart,seqno,totduration,callend,callnumber,mplimsi,mplmsisdn,FILEID                   ,
      FILENAME                ,
      SLNO                    ,
      IMEI                          ,
      UTCTIMEOFFSET                 ,
      CALLEVENTDURATION             ,
      CAUSEFORTERMINATION           ,
      CALLTYPE                      ,
      SERVICETYPE                   ,
      SERVICECODE                   ,
      SUPPLSERVICECODE              ,
      DIALLEDDIGITS                 ,
      CONNECTEDCALLINGNUMBER        ,
      THIRDPARTYNUMBER              ,
      RECORDINGENTITYIDENTIFICATION ,
      CALLREFERENCE     ,
      ACCESSPOINTNAMENI ,
      ACCESSPOINTNAMEOI ,
      DATAVOLUMEINCOMING      ,
      DATAVOLUMEOUTGOING      ,
      SGSNADDRESS             ,
      GGSNADDRESS             ,
      CHARGINGID       ,
      CHARGEAMOUNT     ,
      MSISDN           ,
      PDPADDRESS       ,
      PLMNID           ,
      CELLID           ,
      LOCATIONAREACODE ,
      RES_1   ,
      RES_2   ,
      RES_3   ,
      RES_4   ,
      RES_5  
    from
    (select min(CALLEVENTSTARTTIMESTAMP) callstart,max(sequence_number) seqno,sum(CALLEVENTDURATION) totduration,max(callreleasetime) callend,connectedcallingnumber callnumber, imsi mplimsi ,msisdn mplmsisdn
    from MED_PARTIAL_RECORDS_0001_LOAD
    group by connectedcallingnumber, imsi,msisdn) subset,
    (select FILEID                   ,
      FILENAME                ,
      SLNO                    ,
      IMEI                          ,
      UTCTIMEOFFSET                 ,
      CALLEVENTDURATION             ,
      CAUSEFORTERMINATION           ,
      CALLTYPE                      ,
      SERVICETYPE                   ,
      SERVICECODE                   ,
      SUPPLSERVICECODE              ,
      DIALLEDDIGITS                 ,
      CONNECTEDCALLINGNUMBER        ,
      THIRDPARTYNUMBER              ,
      RECORDINGENTITYIDENTIFICATION ,
      CALLREFERENCE     ,
      ACCESSPOINTNAMENI ,
      ACCESSPOINTNAMEOI ,
      DATAVOLUMEINCOMING      ,
      DATAVOLUMEOUTGOING      ,
      SGSNADDRESS             ,
      GGSNADDRESS             ,
      CHARGINGID       ,
      CHARGEAMOUNT     ,
      MSISDN           ,
      PDPADDRESS       ,
      PLMNID           ,
      CELLID           ,
      LOCATIONAREACODE ,
      RES_1   ,
      RES_2   ,
      RES_3   ,
      RES_4   ,
      RES_5  
    from MED_PARTIAL_RECORDS_0001_LOAD
    ) subsetinfo
    where
    SUBSETINFO.IMSI=subset.imsi
    and
    subsetinfo.connectedcallingnumber=subset.connectedcallingnumber
    and
    SUBSETINFO.CALLRELEASETIME=subset.CALLRELEASETIME
    and
    subsetinfo.msisdn=subset.msisdn)
    mpl
    on
    (tmpr.connectedcallingnumber=callnumber
    and
    tmpr.imsi=mplimsi
    and
    tmpr.msisdn=mplmsisdn
    and
    TMPR.CALLEVENTSTARTTIMESTAMP=mpl.callend
    WHEN MATCHED THEN
    update set sequencenumber=seqno,
    CALLEVENTSTARTTIMESTAMP=callstart,
    CALLEVENTDURATION= totduration;

    Hi,
    Try This.......
    MERGE INTO temp_records_med_date_0001 tmpr
    USING (SELECT callstart, seqno, totduration, callend, callnumber, mplimsi,
    mplmsisdn, fileid, filename, slno, imei, utctimeoffset,
    calleventduration, causefortermination, calltype,
    servicetype, servicecode, supplservicecode, dialleddigits,
    connectedcallingnumber, thirdpartynumber,
    recordingentityidentification, callreference,
    accesspointnameni, accesspointnameoi, datavolumeincoming,
    datavolumeoutgoing, sgsnaddress, ggsnaddress, chargingid,
    chargeamount, msisdn, pdpaddress, plmnid, cellid,
    locationareacode, res_1, res_2, res_3, res_4, res_5
    FROM (SELECT MIN (calleventstarttimestamp) callstart,
    MAX (sequence_number) seqno,
    SUM (calleventduration) totduration,
    MAX (callreleasetime) callend,
    connectedcallingnumber callnumber, imsi mplimsi,
    msisdn mplmsisdn
    FROM med_partial_records_0001_load
    GROUP BY connectedcallingnumber, imsi, msisdn) subset,
    (SELECT fileid, filename, slno, imei, utctimeoffset,
    calleventduration, causefortermination, calltype,
    servicetype, servicecode, supplservicecode,
    dialleddigits, connectedcallingnumber,
    thirdpartynumber, recordingentityidentification,
    callreference, accesspointnameni, accesspointnameoi,
    datavolumeincoming, datavolumeoutgoing, sgsnaddress,
    ggsnaddress, chargingid, chargeamount, msisdn,
    pdpaddress, plmnid, cellid, locationareacode, res_1,
    res_2, res_3, res_4, res_5
    FROM med_partial_records_0001_load) subsetinfo
    WHERE subsetinfo.imsi = subset.imsi
    AND subsetinfo.connectedcallingnumber =
    subset.connectedcallingnumber
    AND subsetinfo.callreleasetime = subset.callreleasetime
    AND subsetinfo.msisdn = subset.msisdn) mpl
    ON ( tmpr.connectedcallingnumber = callnumber
    AND tmpr.imsi = mplimsi
    AND tmpr.msisdn = mplmsisdn
    AND tmpr.calleventstarttimestamp = mpl.callend)
    WHEN MATCHED THEN
    UPDATE
    SET sequencenumber = seqno, calleventstarttimestamp = callstart,
    calleventduration = totduration
    Regards,
    Simma.....

  • Ora-00917 missing right paranthesis

    hi,
    pls help me to find the error in this query
    INSERT INTO champ.case_worker
    (case_worker_id,
    primary_role_id,
    worker_name,
    initials,
    short_name,
    mainframe_id,
    worker_status_code)
    VALUES
    (champ.case_worker_id_seq,
    14,
    IRTS (Issue Resolution Tracking System),
    IRTS,
    IRTS,
    IRTS)
    Message was edited by:
    user596307

    Sometimes the SQL compiler will shamelessly, well, lie to you about what the problem is. The missing "(" error is something that may have nothing whatsoever to do with the cited problem but some other structural problem

  • Its throwing an error with order related billing

    hi,
    sap gurus,
    in order related billing configuration settings its throwing an error like this
    "the items is not relevant for billing".
    plz show some way on this its urgent
    tommorrow is my delivery time
    regards,
    balaji.t
    09990019711

    Normal Sales Order Cycle for Order Related Billing:-
    Step 1: Sales Document Type
    IMG > Sales and Distribution > Sales > Sales Documents >
    Sales Document Header:
    1. Sales Document Type:The sales document types represent the different business transactions, such as Inquiry, Quotation, Sales Order, etc. To create new sales order type, always copy as with reference to similar sales order. If possible use standard sales order.
    2. Define Number Ranges For Sales Documents: Maintain number range with discussion with core team.
    3. Assign Sales Area To Sales Document Types:
    A. Combine sales organizations / Combine distribution channels / Combine divisions: Ensure to maintain these, else Sales Order creation will give error.
    B. Assign sales order types permitted for sales areas: Assign only required Sales Order Types to required Sales Area. This will minimize selection of Sales Order Type as per sales area.
    Sales Document Item:
    1. Define Item Categories: If possible use Standard Item Category. Incase if required to create new, copy as from standard & maintain New.
    Check Billing relevance for Item Category being used
    2. Assign Item Categories: If possible, use standard. Formula for deriving item category: Sales Document Type + Item Category Group + Usage + Higher Level Item Category = Item Category
    For Order-Related-Billing, use Item Category TAD & Item Category Group in Material Master as LEIS.
    Schedule Line:
    1. Define Schedule Line Categories: If possible use Standard Schedule Lines. Incase if required to create new, copy as from standard & maintain New.
    2. Assign Schedule Line Categories: If possible, use standard. Formula for deriving Schedule Line: Item Category + MRP Type / No MRP Type.
    Step 2:
    IMG > Sales and Distribution > Billing >
    1. Define Billing Types: If possible use Standard Billing Type. Incase if required to create new, copy as from standard & maintain New.
    2. Define Number Range For Billing Documents: Ensure to maintain number range.
    3. Maintain Copying Control For Billing Documents: Maintain relevant copy controls such as Sales Order to Billing, Deliver to Billing, etc.
    Note: Ensure that Copy Control settings are done
    Sales Order to Billing (OR --> F1): VTFA
    Regards,
    Rajesh Banka
    Reward points if helpful

  • Missing right parenthesis error when querying using a list of values

    Would anyone know why this statement gives the ORA-00907: missing right parenthesis error..?
    SELECT FIELD_X
    FROM TABLE_Y
    WHERE FIELD_X IN (
    'AJD'
    'RED'
    'ADF'
    'MOI'
    The reason why I wanted the AJD, RED, ADF, etc values on top of each other is because I need to add the single quotes around those terms in Excel before pasting them into the SQL statement (there are actually over 400 terms so above just shows a subset)

    Fortunately the SQL syntax is documented in the SQL manual
    { expr [, expr ]...
    | ( [expr [, expr ]] ...)
    }http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/expressions015.htm#i1033664
    Note the comma following each value in the syntax diagram and examples.

  • FOR UPDATE on updatable cursor and error: ORA-00907: missing right parenthesis

    Anyone run into this? I've searched the message board and bug db to no avail.
    - Using latest Oracle JDBC 2.0 compliant "thin" driver and Oracle 8.1.6 database.
    1) Using prepareStatement specifying an updatable cursor for something like "SELECT FNAME,LNAME FROM USERS FOR UPDATE OF FNAME,LNAME"
    2) Updating FNAME using updateString("FNAME","whatever"), and then calling updateRow() of the ResultSet yields:
    ORA-00907: missing right parenthesis
    If I remove the FOR UPDATE clause then everything works just fine.
    Workarounds/suggestions appreciated!
    Thanks,
    Ryan
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Andrew Edgar ([email protected]):
    I have this same problem!
    The error occurs when performing updateRow.
    The turning off of auto commit only gets the query to work but not the actual update.
    Will this be fixed in the next version of the Driver?<HR></BLOCKQUOTE>
    Here is the stack Trace I recieved:
    java.sql.SQLException: ORA-00907: missing right parenthesis
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
    at oracle.jdbc.driver.UpdatableResultSet.execute_updateRow(UpdatableResultSet.java:2135)
    at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:1322)

  • Using Rollup to get subtotals and grand total - missing right pren error

    Hello,
    I am trying to create sub totals by person_id and a grand total row in my APEX report but I get a "missing right pren error." I finally figure out that I need to eliminate column alias names to fix this problem, however, I now get an ambigous column reference. I am making this change in my main SQL report statement, however, I was wondering if I should be using the "group by Rollup" somewhere else while using "Break Formatting."
    I would appreciate any help.
    Thanks
    leh

    Can you post the Query please?

  • Using DBMS_METADATA.GET_DDL get error: ORA-00907: missing right parenthesis

    Hi,
    I'm trying to extract schema DDL from a database (10.2.0.4.0 - 64bit Enterprise Edition on Solaris 10). I run the query below and get an ORA-00907: missing right parenthesis error.
    SELECT DBMS_METADATA.GET_DDL( REPLACE(object_type,' ','_') AS object_type, object_name) FROM user_objects WHERE object_type NOT IN ('TABLE_PARTITION','INDEX_PARTITION','LOB');
    This is the output when running the above in sqlplus worksheet
    select DBMS_METADATA.GET_DDL( REPLACE(object_type,' ','_') as object_type, object_name) FROM user_objects where object_type not in ('TABLE_PARTITION','INDEX_PARTITION','LOB')
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    removing the where clause gives the following:
    select DBMS_METADATA.GET_DDL( REPLACE(object_type,' ','_') as object_type, object_name) FROM user_objects
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    Any pointers would be gratefully received. I know I could get the DDL out using exp/imp but I want to understand why I'm getting the missing parenthesis error.
    cheers,
    Ewan

    SELECT DBMS_METADATA.GET_DDL( REPLACE(object_type,' ','_') AS object_type, object_name) FROM user_objects WHERE object_type NOT IN You don't need an alias here. Get rid of " AS object_type" and it should work.

  • FOR UPDATE on scrollable cursor and error: ORA-00907: missing right parenthesis

    If change my query to have a FOR UPDATE and make it an updatable scrollable cursor I get an error on the updateRow() command saying "ORA-00907: missing right parenthesis"
    If I remove the FOR UPDATE it works OK.
    The problem I have is trying to update a CLOB from a ResultSet. If I do not upate any other column I get the error saying that the error"
    "ORA-22920: row containing the LOB value is not locked"
    I can get around this by adding FOR UPDATE. But if I add FOR UPDATE and try to update any non-CLOB column I get the 00907 error above.
    Hmmmm. So here is what I can and cannot do:
    - I CAN update the CLOB IF I update another column 1st and NO FOR UPDATE clause.
    - I CAN update the CLOB only if I have FOR UPDATE clause.
    - I CANNOT update just the CLOB without FOR UPDATE.
    - I CANNOT update any non-CLOB column with FOR UPDATE.
    What a pain in the ***! How am I to provide generic access to the applications being built on my DB layer. This is crazy!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Andrew Edgar ([email protected]):
    I have this same problem!
    The error occurs when performing updateRow.
    The turning off of auto commit only gets the query to work but not the actual update.
    Will this be fixed in the next version of the Driver?<HR></BLOCKQUOTE>
    Here is the stack Trace I recieved:
    java.sql.SQLException: ORA-00907: missing right parenthesis
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
    at oracle.jdbc.driver.UpdatableResultSet.execute_updateRow(UpdatableResultSet.java:2135)
    at oracle.jdbc.driver.UpdatableResultSet.updateRow(UpdatableResultSet.java:1322)

  • Using Toplink with Oracle Spatial (missing right parenthesis error)

    Hi,
    I always get the following error when I try to create spatial query with toplink.
    Internal Exception: java.sql.SQLException: ORA-00907: missing right parenthesis
    Any idea ? Also, there is no trace of my point in the generated sql....
    Here is the generated query:
    SELECT ID, [...]
    FROM QUEBEC_CITY
    WHERE (MDSYS.SDO_NN(GEOMETRY, JGeometry (gtype=1, dim=2, rid=8307, NULL) = 'TRUE')
    ORDER BY ID ASC
    Here is my code... :
    double[] coord = new double[]{-71.25163d, 46.8527d};
    JGeometry point = JGeometry.createPoint(coord, 2, 8307);
    SpatialOperator nearestNeighbor = SpatialOperator.nearestNeighbor(session);
    ReadAllQuery query = new ReadAllQuery(UrbanEdgeDescriptor.class);
    ExpressionBuilder eb = query.getExpressionBuilder();
    Expression geom = eb.get("geometry");
    query.setSelectionCriteria(nearestNeighbor.buildExpression(geom, point));
    query.addAscendingOrdering("id");
    List<UrbanEdgeDescriptor> results = (List)db.getSession().executeQuery(query);
    System.out.println(results!=null);

    The problem is the toString() on JGeometry. It does not print out a complete description the database can use inline. It produces:
    JGeometry (gtype=1, dim=2, rid=8307
    To get JGeometry types to work in your queries the easiest solution is to use parameter binding so the literal representation is not used.
    Doug

  • SDO_Relate Missing right Parenthesis error

    Hi,
    I am trying to run this query
    SELECT a.ID
    FROM a
    WHERE
    (sdo_relate(a.shape,
    SdoGeometry(2003,8307,null,(1,1003,1),(-118.36170848374563,34.14009578993409,-118.36170848374563,34.14013981369518,-118.36165712269101,34.14013981369518,-118.36165712269101,34.14009578993409,-118.36170848374563,34.14009578993409)),
    'mask=anyinteract')='TRUE')
    and got an error "ORA-00907: missing right parenthesis".
    Does anyone know why?
    Thanks for any help.

    please try
    SQL> SELECT a.ID
    2 FROM a
    3 WHERE
    4 (sdo_relate(a.shape,
    5 SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3),
    6 SDO_ORDINATE_ARRAY(-118.36127, 34.1414971, -118.36127, 34.1420039))
    7 , 'mask=anyinteract')='TRUE') ;

  • Missing right parenthesis command error

    I'm getting a missing right parenthesis error on the following command on line 35 column 23
    SELECT DISTINCT OR_LOG.LOG_ID,OR_LOG.LOC_ID,PATIENT.PAT_NAME,V_MRN.MRN,PATIENT.PAT_ID
    ,TO_CHAR(OR_LOG.SURGERY_DATE,'MM/DD/YYYY') AS SURGERY_DATE,ROOM.PROV_NAME AS ROOM_NAME
    ,DIABETES.REF_BILL_CODE,DIABETES.PARENT_NAME,DIABETES.DX_NAME
      FROM EPICADM.OR_LOG OR_LOG INNER JOIN EPICADM.PATIENT PATIENT ON OR_LOG.PAT_ID=PATIENT.PAT_ID
      INNER JOIN EPICADM.PAT_OR_ADM_LINK ADM_LINK ON OR_LOG.LOG_ID=ADM_LINK.OR_CASELOG_ID
      INNER JOIN EPICADM.PAT_ENC_HSP ENC_HSP ON ADM_LINK.OR_LINK_CSN=ENC_HSP.PAT_ENC_CSN_ID
      INNER JOIN EPICADM.V_FV_MRN V_MRN ON OR_LOG.PAT_ID=V_MRN.PAT_ID
      INNER JOIN EPICADM.CLARITY_LOC CLARITY_LOC ON OR_LOG.LOC_ID=CLARITY_LOC.LOC_ID
      LEFT OUTER JOIN EPICADM.CLARITY_SER room ON OR_LOG.ROOM_ID = ROOM.PROV_ID
      INNER JOIN
    SELECT DISTINCT PAT_ID,REF_BILL_CODE,PARENT_NAME,DX_NAME
    FROM
    SELECT PROBLEM_LIST.PAT_ID,DIAB.REF_BILL_CODE,DIAB.DX_NAME,DIAB.PARENT_NAME
    FROM PROBLEM_LIST INNER JOIN
    SELECT EDG.DX_ID,EDG.DX_NAME,EDG.REF_BILL_CODE,EDG_PAR.DX_NAME AS PARENT_NAME,EDG_PAR.PAT_FRIENDLY_TEXT
    FROM CLARITY_EDG EDG INNER JOIN CLARITY_EDG EDG_PAR ON EDG.PARENT_DX_ID=EDG_PAR.DX_ID
    INNER JOIN
    SELECT EDG_CURRENT_ICD9.CODE, CLARITY_EDG.DX_NAME,EDG_CURRENT_ICD9.DX_ID
    FROM EDG_CURRENT_ICD9
    WHERE (EDG_CURRENT_ICD9.CODE BETWEEN '250' and '250.99' OR EDG.REF_BILL_CODE BETWEEN '305' AND '305.99')
    )DIAB ON PROBLEM_LIST.DX_ID=DIAB.DX_ID
    UNION ALL
    SELECT MEDICAL_HX.PAT_ID,DIAB2.REF_BILL_CODE,DIAB2.DX_NAME,DIAB2.PARENT_NAME
    FROM MEDICAL_HX INNER JOIN
    SELECT EDG.DX_ID,EDG.DX_NAME,EDG.REF_BILL_CODE,EDG_PAR.DX_NAME AS PARENT_NAME,EDG_PAR.PAT_FRIENDLY_TEXT
    FROM CLARITY_EDG EDG INNER JOIN CLARITY_EDG EDG_PAR ON EDG.PARENT_DX_ID=EDG_PAR.DX_ID
    INNER JOIN
    SELECT EDG_CURRENT_ICD9.CODE, CLARITY_EDG.DX_NAME,EDG_CURRENT_ICD9.DX_ID
    FROM EDG_CURRENT_ICD9 ON CLARITY_EDG .DX_ID=EDG_CURRENT_ICD9.DX_ID
    WHERE (EDG_CURRENT_ICD9.CODE BETWEEN '250' and '250.99' OR EDG.REF_BILL_CODE BETWEEN '305' AND '305.99')
    ) DIAB2 ON MEDICAL_HX.DX_ID=DIAB2.DX_ID
    ) CMB
    ) DIABETES ON OR_LOG.PAT_ID=DIABETES.PAT_ID
        WHERE (PATIENT.TEST_PATIENT_YN <> 'Y'
      OR PATIENT.TEST_PATIENT_YN     IS NULL)
      AND OR_LOG.PROC_NOT_PERF_C     IS NULL
      AND OR_LOG.LOG_ID=275957

    Apart from what Zac pointed out, I also believe you're missing out on referencing a table in this part of the query:
    INNER JOIN
    SELECT EDG_CURRENT_ICD9.CODE, CLARITY_EDG.DX_NAME,EDG_CURRENT_ICD9.DX_ID
    FROM EDG_CURRENT_ICD9 ON CLARITY_EDG.DX_ID=EDG_CURRENT_ICD9.DX_ID
    WHERE (EDG_CURRENT_ICD9.CODE BETWEEN '250' and '250.99' OR EDG.REF_BILL_CODE BETWEEN '305' AND '305.99')
    )DIAB ON PROBLEM_LIST.DX_ID=DIAB.DX_ID
    You were missing the table name and the join in the italicized and bold portion although I'm not very sure if this is the right table and join. I copied that from the Inner Join under the UNION ALL.
    I also think there's something wrong with the alias CMB. I don't see it being referenced in any of the joins.
    -Abhilash

Maybe you are looking for

  • URGENT : Problems with exporting a translated application

    Hi ! I have a problem with exporting a translated application. Effectively, I exported both applications (The normal and the translated version). I want now to apply the translation XLIFF. I want to know if it is possible to apply my old XLIFF file.

  • Drop Shadow on Widgets

    I have inserted a picture to a menu widget and applied a drop shadow. The shadow follows the shape of the picture fine in design mode, but when I go into view in browser, preview or publish the shadow follows the shape of the box the picture is conta

  • IPhoto Aperture Photoshop

    From your practical experience, what are the main advantages of Aperture as a product placed between iPhoto and Photoshop?

  • DTP running longer than usual

    Hi Experts, We have 2 DTPs (Master Data) that run everyday through a process chains in delta mode. The data that is picked from PSA comes through a infopackage which is a full load. Usually, the DTPs processes just the new full load that comes everyd

  • App Files Saved as XML and Working with New Versions

    We work with app data in the form of array of large clusters and use LV Anything to XML conversion VIs to save to disk. The problem is when new app versions are developed and changes are made to the cluster format; we want the customer to be able to