TopLink EJBQL- SQL bug?

Hi
I have this EJB QL query:
delete from Przejazd p where p.id in (
    select p2.id from Przejazd p2 join p2.lista l
    where l.id = :listaId
)And it's producing this SQL:
DELETE FROM PRZEJAZD
WHERE EXISTS(
SELECT t0.ID FROM PRZEJAZD t0
  WHERE t0.ID IN (
    (SELECT t1.ID FROM PRZEJAZD t3, LISTA t2, PRZEJAZD t1
        WHERE (t2.ID = CAST (? AS INTEGER )
        AND   (t2.ID = t3.LISTA_ID)))
  AND t0.ID = PRZEJAZD.ID
)I think the SQL should look like this:
DELETE FROM PRZEJAZD
WHERE EXISTS(
SELECT t0.ID FROM PRZEJAZD t0
  WHERE t0.ID IN (
    (SELECT t3.ID FROM PRZEJAZD t3, LISTA t2
        WHERE (t2.ID = CAST (? AS INTEGER )
        AND   (t2.ID = t3.LISTA_ID)))
  AND t0.ID = PRZEJAZD.ID
)It's a TopLink bug, or am I missing something?

Hi
I have this EJB QL query:
delete from Przejazd p where p.id in (
    select p2.id from Przejazd p2 join p2.lista l
    where l.id = :listaId
)And it's producing this SQL:
DELETE FROM PRZEJAZD
WHERE EXISTS(
SELECT t0.ID FROM PRZEJAZD t0
  WHERE t0.ID IN (
    (SELECT t1.ID FROM PRZEJAZD t3, LISTA t2, PRZEJAZD t1
        WHERE (t2.ID = CAST (? AS INTEGER )
        AND   (t2.ID = t3.LISTA_ID)))
  AND t0.ID = PRZEJAZD.ID
)I think the SQL should look like this:
DELETE FROM PRZEJAZD
WHERE EXISTS(
SELECT t0.ID FROM PRZEJAZD t0
  WHERE t0.ID IN (
    (SELECT t3.ID FROM PRZEJAZD t3, LISTA t2
        WHERE (t2.ID = CAST (? AS INTEGER )
        AND   (t2.ID = t3.LISTA_ID)))
  AND t0.ID = PRZEJAZD.ID
)It's a TopLink bug, or am I missing something?

Similar Messages

  • Toplink with sql server

    I have sucessfully used Toplink with Oracle. ow I have to use it with MS SQL server and I am having problems. First of all, in the Mapping Worbench, the only SQL server driver listed is weblogic.jdbc.mssqlserver4.Driver. Why can't I use the regular ms sql driver, com.microsoft.jdbc.sqlserver.SQLServerDriver? Why should the mapping workbench be tied to Weblogic? If one did not have Weblogic, would it be impossible to use Toplink with SQL server? Well, I have Weblogic, so I tried using the weblogic driver with the url jdbc:microsoft:sqlserver://<host ip>:1433;DatabaseName=<db name>. When I try to connect, a dialog box appears that says: "java.sql.SQLException $$$$$$$$$$ License Exception $$$$$$$$$$ Missing license for: WebLogic Server 6.1. $$$$$$$$$$ License Exception $$$$$$$$$$ Username or password could be invalid." I have weblogic.jar in the classpath. I tried adding the line SET WLS61_HOME=M:\bea610\wlserver6.1 to workbench.cmd. It didn't help. Any suggestions?

    I already tried this. It does not work. I put the following jars in the classpath in workbench.cmd: msbase.jar;mssqlserver.jar;msutil.jar. Then I start workbench. When I try to enter com.microsoft.jdbc.sqlserver.SQLServerDriver as the driver, I get an exception. Here is the stacktrace:
    Exception occurred during event dispatching:
    java.lang.ClassCastException: com.webgain.openapi.foundation.uitools.WGDefaultListModel
         at com.webgain.workbench.ui.db.BldrLoginInfoPanel.actionPerformed(Unknown Source)
         at com.webgain.openapi.foundation.uitools.WGListChooser.fireActionEvent(WGListChooser.java:664)
         at com.webgain.openapi.foundation.uitools.WGListChooser$ListDataHandler.contentsChanged(WGListChooser.java:473)
         at javax.swing.AbstractListModel.fireContentsChanged(Unknown Source)
         at com.webgain.openapi.foundation.uitools.WGDefaultListModel.setSelectedItem(WGDefaultListModel.java:740)
         at com.webgain.openapi.foundation.uitools.WGListChooser.setSelectedItem(WGListChooser.java:1446)
         at com.webgain.openapi.foundation.plaf.basic.WGBasicListChooserUI$ListChooserModel.setSelectedItem(WGBasicListChooserUI.java:527)
         at javax.swing.JComboBox.actionPerformed(Unknown Source)
         at javax.swing.plaf.basic.BasicComboBoxUI$EditorFocusListener.focusLost(Unknown Source)
         at java.awt.AWTEventMulticaster.focusLost(Unknown Source)
         at java.awt.AWTEventMulticaster.focusLost(Unknown Source)
         at java.awt.Component.processFocusEvent(Unknown Source)
         at javax.swing.JComponent.processFocusEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.setFocusRequest(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Container.proxyRequestFocus(Unknown Source)
         at java.awt.Component.requestFocus(Unknown Source)
         at javax.swing.JComponent.grabFocus(Unknown Source)
         at javax.swing.JComponent.requestFocus(Unknown Source)
         at javax.swing.text.DefaultCaret.mousePressed(Unknown Source)
         at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
         at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
         at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at com.webgain.openapi.foundation.uitools.WGPasswordField.processMouseEvent(WGPasswordField.java:99)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    If I ignore the exception and try to connect to the database anyway, it tries to use the weblogic driver.
    Next I manually edited the database xml file and put in the driver name automatically. When I bought up the mapping workbench again, it again threw an exception. However, the correct driver name was in the file, so it did finally let me connect to the database. So it seems there IS a bug, although it has to do with the GUI and not SQL server per se.

  • SQL Bug in "Minus" in correlated subquery presence of index (11.2.0.1.0)

    SQL Bug in "Minus" in correlated subquery presence of index
    (Oracle Database 11g Release 11.2.0.1.0)
    Below, there is a small example that shows the bug. Further below,
    there are some more comments.
    drop table Country;
    create table Country
    (code VARCHAR2(4) constraint countrykey PRIMARY KEY,
    name VARCHAR2(35));
    -- if the key constraint is not given, the bug does not occur
    drop table City;
    create table City
    (name VARCHAR2(35),
    country VARCHAR2(4),
    population number);
    drop table Locatedon;
    create table Locatedon
    (city VARCHAR2(35),
    country VARCHAR2(4),
    island VARCHAR2(35));
    insert into country values('E','Spain');
    insert into country values('F','France');
    insert into country values('S','Sweden');
    insert into country values('GB','Sweden');
    insert into city values('Ajaccio','F',53500);
    insert into city values('Paris','F',2152423);
    insert into city values('Palma','E',322008);
    insert into city values('Madrid','E',3041101);
    insert into city values('Stockholm','S',711119);
    insert into city values('London','GB',6967500);
    insert into locatedon values('Ajaccio','F','Corse');
    insert into locatedon values('Palma','E','Mallorca');
    insert into locatedon values('London','GB','Great Britain');
    -- all countries that have a city that is not located on
    -- some island: should be E, F, S.
    Select c.name
    From country c
    Where exists
    ((Select name
    From city
    Where city.country=c.code)
    minus
    (Select city
    From locatedon
    Where locatedon.country=c.code)
    -- wrong answer: only Sweden; Spain and France not in the answer!
    select distinct country from
    ((Select name, country
    From city)
    minus
    (Select city, country
    From locatedon)
    -- correct answer: E, F, S
    Comments:
    The bug has been found by students in our SQL course.
    Using a larger database from that course, the bug can be reproduced
    (same queries as above) at
    http://www.semwebtech.org/sqlfrontend/
    (wrong: 142 answers, correct: 154 answers)
    During reducing it to a simple sample, there were some interesting
    observations: trying with smaller and simpler tables (without the keys)
    and synthetic data, the bug did not occur immediately. When
    restating the query after about one day, the bug occurred. Obviously,
    Oracle creates some index on its own in course of its internal
    optimization that (or more exactly, its usage) exhibits the bug. The
    query plan (showed in SQL Developer) was the same before and after.
    Wolfgang

    There's a typo in the test data - GB should presumably not be in Sweden. However....
    the bug did not occur immediatelyIt's possible. But what would have almost certainly happened is that the execution plan DID change at some point. There are various reasons why it might not be immediate.
    Obviously, Oracle creates some index on its own in course of its internal optimizationFar from obvious, what are you on about?
    The query plan was the same before and afterBet you it wasn't.
    A clear illustration of the issue and indication that it must be a bug is below.
    Simply by hinting a different access method, we can change the result. Therefore, bug.
    See [url http://support.oracle.com]Oracle Support and search for "wrong results".
    Please raise with Oracle Support to get confirmation of bug.
    There have been so many wrong results bugs recently, it's getting ridiculous.
    It's a real issue, IMHO.
    If you can't trust the DB to get your data right....
    Note that the query plan is very much NOT the same and it is the difference in query plan which s that is the root cause of the bug.
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    SQL> SELECT c.name
      2  FROM   country1 c
      3  WHERE  exists ((SELECT name
      4                  FROM   city1
      5                  WHERE  city1.country=c.code)
      6                  MINUS
      7                 (SELECT city
      8                  FROM   locatedon1
      9                  WHERE  locatedon1.country=c.code));
    NAME
    Sweden
    SQL> SELECT /*+ full(c) */
      2         c.name
      3  FROM   country1 c
      4  WHERE  exists ((SELECT name
      5                  FROM   city1
      6                  WHERE  city1.country=c.code)
      7                  MINUS
      8                 (SELECT city
      9                  FROM   locatedon1
    10                  WHERE  locatedon1.country=c.code));
    NAME
    Spain
    France
    Sweden
    SQL> explain plan for
      2  SELECT c.name
      3  FROM   country1 c
      4  WHERE  exists ((SELECT name
      5                  FROM   city1
      6                  WHERE  city1.country=c.code)
      7                  MINUS
      8                 (SELECT city
      9                  FROM   locatedon1
    10                  WHERE  locatedon1.country=c.code));
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 156929629
    | Id  | Operation                    | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |            |     1 |    27 |    12  (25)| 00:00:01 |
    |   1 |  NESTED LOOPS                |            |       |       |            |          |
    |   2 |   NESTED LOOPS               |            |     1 |    27 |    12  (25)| 00:00:01 |
    |   3 |    VIEW                      | VW_SQ_1    |     6 |    24 |    10  (20)| 00:00:01 |
    |   4 |     MINUS                    |            |       |       |            |          |
    |   5 |      SORT UNIQUE             |            |     6 |   138 |            |          |
    |   6 |       TABLE ACCESS FULL      | CITY1      |     6 |   138 |     4   (0)| 00:00:01 |
    |   7 |      SORT UNIQUE             |            |     3 |    69 |            |          |
    |   8 |       TABLE ACCESS FULL      | LOCATEDON1 |     3 |    69 |     4   (0)| 00:00:01 |
    |*  9 |    INDEX UNIQUE SCAN         | COUNTRYKEY |     1 |       |     0   (0)| 00:00:01 |
    |  10 |   TABLE ACCESS BY INDEX ROWID| COUNTRY1   |     1 |    23 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       9 - access("VW_COL_1"="C"."CODE")
    Note
       - dynamic sampling used for this statement (level=4)
    26 rows selected.
    SQL> explain plan for
      2  SELECT /*+ full(c) */
      3         c.name
      4  FROM   country1 c
      5  WHERE  exists ((SELECT name
      6                  FROM   city1
      7                  WHERE  city1.country=c.code)
      8                  MINUS
      9                 (SELECT city
    10                  FROM   locatedon1
    11                  WHERE  locatedon1.country=c.code));
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 1378726376
    | Id  | Operation            | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |            |     1 |    23 |    14  (15)| 00:00:01 |
    |*  1 |  FILTER              |            |       |       |            |          |
    |   2 |   TABLE ACCESS FULL  | COUNTRY1   |     4 |    92 |     4   (0)| 00:00:01 |
    |   3 |   MINUS              |            |       |       |            |          |
    |   4 |    SORT UNIQUE       |            |     1 |    23 |     5  (20)| 00:00:01 |
    |*  5 |     TABLE ACCESS FULL| CITY1      |     1 |    23 |     4   (0)| 00:00:01 |
    |   6 |    SORT UNIQUE       |            |     1 |    23 |     5  (20)| 00:00:01 |
    |*  7 |     TABLE ACCESS FULL| LOCATEDON1 |     1 |    23 |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter( EXISTS ( (SELECT "NAME" FROM "CITY1" "CITY1" WHERE
                  "CITY1"."COUNTRY"=:B1)MINUS (SELECT "CITY" FROM "LOCATEDON1" "LOCATEDON1"
                  WHERE "LOCATEDON1"."COUNTRY"=:B2)))
       5 - filter("CITY1"."COUNTRY"=:B1)
       7 - filter("LOCATEDON1"."COUNTRY"=:B1)
    Note
       - dynamic sampling used for this statement (level=4)
    27 rows selected.Just to show that it's related to query transformation:
    SQL> SELECT /*+ 
      2             no_query_transformation
      3         */
      4         c.name
      5  FROM   country1 c
      6  WHERE  exists ((SELECT name
      7                  FROM   city1
      8                  WHERE  city1.country=c.code)
      9                  MINUS
    10                 (SELECT city
    11                  FROM   locatedon1
    12                  WHERE  locatedon1.country=c.code));
    NAME
    Spain
    France
    Sweden
    SQL> Edited by: Dom Brooks on Jun 30, 2011 2:50 PM

  • PL/SQL Bug in SQL Developer?

    SQL Developer v 1.1.1.25 running on Windows XP.
    I have a PL/SQL procedure that does not compile with debug in SQL Developer. Compiling it with debug produces the following error:
    an Error(1): PLS-00801: internal error [79110].The only way I was able to get the procedure to compile in SQL Developer was to add the 4th line. If I uncomment the 4th line it compiles with debug. Why??
    Here is the procedure:
    CREATE OR REPLACE
    PROCEDURE BOGUS AS
      CURSOR c1 IS
        SELECT dummy FROM DUAL;
    --  x c1%ROWTYPE;
      PROCEDURE test ( rec IN OUT c1%ROWTYPE) IS
      begin
        null;
      end;
    BEGIN
      NULL;
    END BOGUS;Message was edited by:
    marife
    I played around some more with the procedure and discovered the problem. The key is the compiling with debug. I believe that compile with debug cannot build the debug information for a %ROWTYPE as a parameter. But if I define a local variable of that %ROWTYPE, then the compile with debug knows what debug information to track for the %ROWTYPE.
    I discovered that in SQL*Plus it compiles, but when you issue the ALTER PROCEDURE bogus COMPILE DEBUG, it does not compile. This is a problem with the debug option for compiling and not a problem with SQL Developer.
    Sorry for the posting. Hopefully this information will save other times and fustration.
    Mike

    Just for anyone else searching on this bug - I get the same error with certain procedures in TOAD when compiling with DEBUG.
    Fortunately nobody here has the first clue how to use TOAD debug so it's only ever switched on by accident or after a reinstall (it's the default) - so turning debug off fixes the problem.

  • HTMLDB 1.6 load_de.sql bug ?

    I installed HTMLDB 1.6 as an upgrade to the one on the companion CD.
    Since my native language is german, I like to have HTMLDB speaking german language with me. So I opened sqlplus as sys with sysdba privs, altered the session schema to FLOWS_010600 and started the Language update via @load_de.
    after some working statements I got the following error message and the installation stops:
    Error page=4316.4003 item="F4000_P4316_VALIDATION_TYPE" id="22211144053.4003"
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.OWA_UTIL", line 325
    ORA-06512: at "SYS.HTP", line 1322
    ORA-06512: at "SYS.HTP", line 1397
    ORA-06512: at "SYS.HTP", line 1689
    ORA-06512: at "FLOWS_010600.WWV_FLOW_API", line 3191
    ORA-01461: can bind a LONG value only for insert into a LONG column
    ORA-06512: at line 69
    Any hints ?
    cu Pete

    Peter,
    I believe there's a bug lurking in HTML DB somewhere. Your situation is identical to the one described in:
    Re: Installation Error 1.6
    The odd thing is, we have been unable to reproduce it (loading with NLS_LANG german_germany.al32utf8 works just fine). I also asked a couple colleagues in Germany if they've had any difficulty, and they have never encountered this.
    If you would be so kind, could you please let me know the following information:
    1) The database version you are using
    2) The operating system (name and version)
    3) Your database character set
    4) The version and operating system of SQL*Plus you're using (in the event you're doing this installation remotely)
    If you feel uncomfortable posting this on OTN, could you please just e-mail this info to [email protected]?
    Thanks in advance for any assistance you can provide.
    viele Grüße,
    Joel

  • Toplink essentials overwhelming bug(s)

    Hello.
    I'm working on EJB3 project running on Glassfish application server that uses Toplink Essentials as persistance engine.
    In the project there is User entity and some entities inherited from User such as Operator, Vendor, Client, etc... And there is StoredMessage entity. StoredMessage has two attributes (sender, recepient) of User class.
    And the problem is: when trying to persist StoredMessage object via entity manager i'm getting an error like "Cannot persist detached object Operator"... but that is gibberish thing. The User objects are not detached (for test purposes I even merged them vie entity manage just befor StoredMessage persisting) and i'm not working with Operator object there, I'm working with User object, that's most interesting thing.
    I decided to make a temporary workaround and store sender and recepient's IDs int StoredMessage class insted of User object references... But i didn't want to change interfaces in my program, so I leaved old getters and setters for sender and recepient, annotated them transient and changed to get these User objects transparrently through entity menager (I know, that's not a good architectural solution).
    Afrer that Toplink become insane :) I got an error that java.util.Date property in my StoredMessage class is not annotated with a @Temporal, but in code everything was ok. I removed all the code related to that date field and after that I got another error: it said i have to annotate ID field with @Id, but it also was annotated correctly.
    When I'm setting sender and recepient fields to null everything works all right and entity manager persists my StoredMessage object with no problem.
    That bugs are very weird, I haven't seen anything like this... And i'm working on this project for two months, there are about 30 other entities with different relation types in the project and everything works all right and doesn't have any problem with entity manager. Today i've got the first bug.
    Does anybody seen something like this? Do you know how to fix it?
    There is another workaround in my mind, i can just use pure JDBC for StoredMessage objects persistance, but such solution has a number of disadvantages and I have no guarantee that such bugs won't happen with new entities in the project.

    Thank you for reply!
    Do sender and recipient use the same Foreign key? Do you have cascade persist set?Humm, yes, they both the same foreign key. Yes, i have "(cascade = {CascadeType.ALL})" if you mean that.
    Can you please post the relevant Portions of the java and annotations and I can take a closer look.Sure, http://lab37.com/xchng/javacode.zip -- here is archive with User entity, StoredMessage entity and just in case i put Operator (extends User) entity there.

  • HTML DB authorisation via PL/SQL bug?

    I tried to implement a simple authorisation package and failed. This seems to be a bug in HTML DB.
    See below for package body. I have a function check_user and a procedure check_user2.
    When I enter a call to the procedure in my Authorization Scheme (PL/SQL Function Returning Boolean) I get what I deserve:
    auth2.check_user2(:APP_USER)
    results in: ORA-06503: PL/SQL: Function returned without value
    When I use the function instead however the error I get seems less justified:
    auth2.check_user(:APP_USER)
    ORA-06550: line 1, column 44: PLS-00221: 'CHECK_USER' is not a procedure or is undefined ORA-06550: line 1, column 44: PL/SQL: Statement ignored
    It seems HTML DB is checking to make sure it finds a 'procedure' - but it really needs a 'function'...
    Just for completeness the package body:
    create or replace package body auth2
    is
    function check_user( P_USER IN VARCHAR2) return boolean
    as
    begin
    insert into hr_log (log_txt) values (p_user);
    return True;
    end check_user;
    procedure check_user2( P_USER IN VARCHAR2)
    as
    begin
    insert into hr_log (log_txt) values (p_user);
    commit;
    end check_user2;
    end auth2;
    /

    Peter - When HTML DB calls for a Function Returning Boolean it's looking for you to have specified a call to a function whether you put the code within a begin-end or you let HTML DB do it. What you entered was (when framed in begin-end) syntactically a procedure call within an anonymous block. Try entering "return auth2.check_user(:APP_USER);" (without quotes).
    Scott

  • Toplink Version with Bug# 3617882 (SESSION NULL IN EXCEPTIONHANDLER)'s fix?

    We're using Toplink v9.0.4.2 and are experiencing the same issue detailed in Bug# 3617882 on Metalink. According to this bug's status, it has been fixed in v9.0.4.4 (around July 2004 timeframe). I downloaded Toplink v9.0.4.5 installer from Oracle web site (http://www.oracle.com/technology/software/products/ias/htdocs/904topsoft.html). But jars installed with that one are exactly the same as the ones we currently have in 9.0.4.2.
    Where can I find the right Toplink Version that has this bug's fix? Please reply.
    Thanks in advance,
    -Manjula

    Hello Manjula,
    I would try getting the latest 9.0.4 TopLink patchset, which is 9.0.4.8 available from Metalink under patch# 4499114 .
    When you ran the TopLink 10g installer, did you run with the jars it installed? If so, what was the version number it printed off in the logs? I have checked that the toplink.jar file installed is TopLink version 9.0.4.5, so I'm not sure what you mean when you say the jars are the same.
    Best Regards,
    Chris

  • TOPLINK-4002 SQL string is not Query Error Code: 17128

    I got following exception when trying to execute native SQL query via session EJB. The query is defined in orm.xml file using JDev 11g Preview:
    javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 070502)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: SQL string is not QueryError Code: 17128
    Call:findProfilesByLastName
    I have following native query defined:
    select o.last_name,
    o.first_name,
    o.middle_name,
    o.birth_date,
    o.sex_code,
    a.height_cm,
    a.weight_kg,
    o.PERSON_ID
    from persons o,
    person_bookings b,
    person_physical_attributes a
    where o.PERSON_ID = b.PERSON_ID
    and b.PERSON_BOOK_ID = a.PERSON_BOOK_ID
    and o.last_name like '%?1%'
    I also tried these versions of the same query but got the same exception:
    select o.last_name,
    o.first_name,
    o.middle_name,
    o.birth_date,
    o.sex_code,
    a.height_cm,
    a.weight_kg,
    o.PERSON_ID
    from persons o,
    person_bookings b,
    person_physical_attributes a
    where o.PERSON_ID = b.PERSON_ID
    and b.PERSON_BOOK_ID = a.PERSON_BOOK_ID
    and o.last_name like '%:1%'
    select o.last_name,
    o.first_name,
    o.middle_name,
    o.birth_date,
    o.sex_code,
    a.height_cm,
    a.weight_kg,
    o.PERSON_ID
    from persons o,
    person_bookings b,
    person_physical_attributes a
    where o.PERSON_ID = b.PERSON_ID
    and b.PERSON_BOOK_ID = a.PERSON_BOOK_ID
    and o.last_name like '%#partialName%'
    select o.last_name,
    o.first_name,
    o.middle_name,
    o.birth_date,
    o.sex_code,
    a.height_cm,
    a.weight_kg,
    o.PERSON_ID
    from persons o,
    person_bookings b,
    person_physical_attributes a
    where o.PERSON_ID = b.PERSON_ID
    and b.PERSON_BOOK_ID = a.PERSON_BOOK_ID
    and o.last_name like '%#partialName#%'
    Log trace:
    Query:DataReadQuery(); nested exception is:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 070502)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: SQL string is not QueryError Code: 17128
    Call:findProfilesByLastName
    Query:DataReadQuery(); nested exception is: oracle.oc4j.rmi.OracleRemoteException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 070502)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: SQL string is not QueryError Code: 17128
    Call:findProfilesByLastName
    Query:DataReadQuery(); nested exception is:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 070502)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: SQL string is not QueryError Code: 17128
    oracle.oc4j.rmi.OracleRemoteException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 070502)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: SQL string is not QueryError Code: 17128
    Call:findProfilesByLastName
    Query:DataReadQuery()
    at com.evermind.server.ejb.EJBUtils.getUserException(EJBUtils.java:127)
    at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:91)
    at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:150)
    at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:420)
    at oracle.oc4j.security.JaasModeImpl$DoAsPrivilegedExecutor.execute(JaasModeImpl.java:280)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:57)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:58)
    at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:104)
    at SearchFacade_RemoteProxy_43jlpm9.queryProfilesByLastName(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.rmi.RmiMethodCall.invokeMethod(RmiMethodCall.java:104)
    at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:59)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    at java.lang.Thread.run(Thread.java:595)
    Nested exception is:
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 070502)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: SQL string is not QueryError Code: 17128
    at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:283)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:583)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:443)
    at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:749)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelect(DatasourceCallQueryMechanism.java:232)
    at oracle.toplink.queryframework.DataReadQuery.executeNonCursor(DataReadQuery.java:122)
    at oracle.toplink.queryframework.DataReadQuery.executeDatabaseQuery(DataReadQuery.java:114)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:671)
    at oracle.toplink.queryframework.DataReadQuery.execute(DataReadQuery.java:100)
    at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:594)
    at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2632)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1014)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:986)
    at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:395)
    at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:502)
    at ejbmodel.SearchFacadeBean.queryProfilesByLastName(SearchFacadeBean.java:107)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:27)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:150)
    at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:420)
    at oracle.oc4j.security.JaasModeImpl$DoAsPrivilegedExecutor.execute(JaasModeImpl.java:280)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:57)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
    at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:58)
    at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:104)
    at SearchFacade_RemoteProxy_43jlpm9.queryProfilesByLastName(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.rmi.RmiMethodCall.invokeMethod(RmiMethodCall.java:104)
    at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:59)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: SQL string is not Query
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:72)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:105)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:168)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:224)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:439)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1302)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3522)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3574)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:267)
    at oracle_jdbc_driver_OraclePreparedStatementWrapper_Proxy.executeQuery(Unknown Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:754)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:518)
    ... 51 more

    Does this error only occur when the SQL is defined in orm.xml ? Have attempted to run this query in code only?
    --Gordon                                                                                                                                                                                                                                                   

  • Compatibility of Toplink with SQL SERVER 2005 Enterprise edition

    Hi All,
    We have J2EE application developed using TopLink ORM, which is running on SQL server 2000 standard edition, and now we are planing to migrate the SQL server 2000 to SQL server 2005 Enterprise edition, so please let me know whether TopLink supports for SQL server 2005 Enterprise edition or is there any disadvantages.
    Looking for your advice earliest
    Thanks in advance.
    Anand Siddacharya.

    Yes, TopLink supports any SQL compliant database with a JDBC compliant driver.
    As long as you have a JDBC driver that works correctly, I can't see any issues in the upgrade.
    James : http://www.eclipselink.org

  • TopLink with SQL Server 2005

    Could someone help answer this question:
    Has TopLink 10.1.3.x been certified to support SQL Server 2005?
    I appreciate your information.
    Haiwei

    It is certified on SQL Server 2000.
    I know some customers are using it with SQL Server 2005, though.

  • TopLink - Get sql code of a Named Query.

    Hi everyone!
    I'm wrinting to yours because I want to insert into a register of a table of my database the sql code generated of a named query. I mean, I have a named query with sql code, and I want to get that sql with the parameters that I used to execute that query.
    What would I do to get that information..??..
    I'll be wainting your responses.
    Thanks!
    Greetings, Lucho!

    You might want to ask this on the TopLink Forum.
    TopLink has levels of logging that will provide you with the queries executed.
    That said, if you want to log each operation on a table at the database level, then maybe looking into the database audit features would make more sense.

  • Oracle SQL - Bug

    Hi All,
    I am writing this so that someone someday can take this to Oracle Corp as this is a simple bug which ought to be rectified by Oracle.
    Eg: select * from emp a where a.empno in ( select empno from empl b)
    Here i am using an Isolation Level 1 by using a Sub-Query to only return rows that matches with empno in table Empl but Empl table used in Sub Query does not have a Column by name empno . This should have returned an Oracle error instead it is taking the Column alias of table emp in Main Query.
    Many of us here will think or presume that this is correct as when using Isolation levels but this is not happening that way . There is an Oracle Bug which ought to be rectified in their next release.

    Definitively not a bug, at least bad query writing.
    Use prefix should solve your problem, something like this :
    select * from emp a where a.empno in ( select[b] b.empno from empl b)Furthermore, I wouldn't understand why you want, in the subquery, get the empno from the emp table instead of empl.
    Here was some threads about that, please read one of them here below :
    Re: Bug in Oracle 9.2.0.1.0.
    Moreover, this is not because you said "many of us here" want a correction that Oracle will correct it, because that's not a bug !
    Nicolas.

  • SQL Bug on 11.2

    We recently upgraded to 11.2, but had to downgrade back to 10.2 due to an error with part of our application. This error does not occur in version 10 or 11.1. We are running Oracle on Windows 2003 Server (happens on my laptop also, Windows 7). We have asked a customer to run the query who run Oracle on Linux, same problem.
    To replicate this, I have simplified the table, view and query below, but the error still occurs. Note that it is four queries unioned. My developers insist that this is best practice to get the data they want so who am I to argue - fact that there are full table scans going on is irrelevant. Run each query on its own is fine. Take the last unioned query out and it works fine. Have all four queries and it fails.
    Table required:
    Create table GT_CONTACT_LVL1_DATA (
    LOCATIONID NUMBER(8) ,
    CALL_LOCATIONID NUMBER(8) ,
    LOC_SEQ NUMBER(3) ,
    CONTACTID NUMBER(8) ,
    CALL_CONTACTID NUMBER(8) ,
    CALL_SEQ NUMBER(3) ,
    LOC_REFNO VARCHAR2(60) ,
    PHONE VARCHAR2(40) ,
    PHONE_TYPE VARCHAR2(8) ,
    CASENO VARCHAR2(12) ,
    VERSION NUMBER(3) ,
    REP_SEQ NUMBER(3));
    View required:
    CREATE OR REPLACE VIEW VW_GT_CONTACT_TEL
    AS
    SELECT LOCATIONID, CONTACTID, CASENO, REP_SEQ, PHONE, LOC_REFNO
    FROM GT_CONTACT_LVL1_DATA
    WHERE PHONE_TYPE = 'TEL';
    The query:
    SELECT DISTINCT DR.LOCATIONID, DR.CALL_LOCATIONID, DR.LOC_SEQ, DR.CONTACTID, DR.CALL_CONTACTID, DR.CALL_SEQ,DR.CASENO, DR.VERSION, DR.REP_SEQ,
    DR.LOC_REFNO, DR1.PHONE
    FROM GT_CONTACT_LVL1_DATA DR LEFT OUTER JOIN VW_GT_CONTACT_TEL DR1 ON DR1.LOCATIONID = DR.LOCATIONID AND DR1.CONTACTID = DR.CONTACTID
    AND DR.CASENO = DR1.CASENO
    WHERE DR.CASENO IS NOT NULL AND
    (DR.LOCATIONID,DR.CONTACTID) IN (SELECT LOCATIONID,CONTACTID FROM GT_CONTACT_LVL1_DATA D
    WHERE CASENO IS NULL AND D.CONTACTID = DR.CONTACTID
    AND D.LOCATIONID = DR.LOCATIONID)
    UNION
    SELECT DISTINCT DD.LOCATIONID, DD.CALL_LOCATIONID, DD.LOC_SEQ, DD.CONTACTID, DD.CALL_CONTACTID, DD.CALL_SEQ,DD.CASENO, DD.VERSION, DD.REP_SEQ,
    DD.LOC_REFNO, DD1.PHONE
    FROM GT_CONTACT_LVL1_DATA DD LEFT OUTER JOIN VW_GT_CONTACT_TEL DD1 ON DD1.LOCATIONID = DD.LOCATIONID AND DD1.CONTACTID = DD.CONTACTID
    AND DD.CASENO = DD1.CASENO
    WHERE DD.CASENO IS NULL AND
    (DD.LOCATIONID,DD.CONTACTID) IN (SELECT LOCATIONID,CONTACTID FROM GT_CONTACT_LVL1_DATA D
    WHERE CASENO IS NOT NULL AND D.CONTACTID = DD.CONTACTID
    AND D.LOCATIONID = DD.LOCATIONID)
    union
    SELECT DISTINCT DR.LOCATIONID, DR.CALL_LOCATIONID, DR.LOC_SEQ, DR.CONTACTID, DR.CALL_CONTACTID, DR.CALL_SEQ,DR.CASENO, DR.VERSION, DR.REP_SEQ,
    DR.LOC_REFNO, DD.PHONE
    FROM GT_CONTACT_LVL1_DATA DR LEFT OUTER JOIN VW_GT_CONTACT_TEL DD ON DD.CASENO = DR.CASENO AND DD.REP_SEQ = DR.REP_SEQ
    AND DR.CASENO = DD.CASENO
    WHERE DR.CASENO IS NOT NULL
    AND (DR.LOCATIONID,DR.CONTACTID) NOT IN (SELECT LOCATIONID,CONTACTID FROM GT_CONTACT_LVL1_DATA WHERE CASENO IS NULL)
    UNION
    SELECT DISTINCT DD.LOCATIONID, DD.CALL_LOCATIONID, DD.LOC_SEQ, DD.CONTACTID, DD.CALL_CONTACTID, DD.CALL_SEQ,DD.CASENO, DD.VERSION, DD.REP_SEQ,
    DD.LOC_REFNO, DD1.PHONE
    FROM GT_CONTACT_LVL1_DATA DD LEFT OUTER JOIN VW_GT_CONTACT_TEL DD1 ON DD1.LOCATIONID = DD.LOCATIONID AND DD1.CONTACTID = DD.CONTACTID
    AND DD.CASENO = DD1.CASENO
    WHERE DD.CASENO IS NULL
    AND (DD.LOCATIONID,DD.CONTACTID) NOT IN (SELECT LOCATIONID,CONTACTID FROM GT_CONTACT_LVL1_DATA WHERE CASENO IS NOT NULL);
    Error:
    Error at Command Line:43 Column:90
    Error report:
    SQL Error: ORA-01790: expression must have same datatype as corresponding expression
    01790. 00000 - "expression must have same datatype as corresponding expression"
    *Cause:   
    *Action:
    Anyone have any idea what could be causing this and what we can do (apart from the obvious splitting the query) to fix this.
    Many thanks.
    James

    I Can reproduce the issue without problem.
    The query however needs to be revised, as all DISTINCTs are redundant: UNION will filter out duplicates as UNION is a set operation and by definition sets don't contain duplicates.
    I have formatted the query to make it readable
    SELECT  DR.LOCATIONID,
            DR.CALL_LOCATIONID,
            DR.LOC_SEQ,
            DR.CONTACTID,
            DR.CALL_CONTACTID,
            DR.CALL_SEQ,
            DR.CASENO,
            DR.VERSION,
            DR.REP_SEQ,
            DR.LOC_REFNO,
            DR1.PHONE
    FROM GT_CONTACT_LVL1_DATA DR LEFT OUTER JOIN VW_GT_CONTACT_TEL DR1
    ON DR1.LOCATIONID = DR.LOCATIONID
    AND DR1.CONTACTID = DR.CONTACTID
    AND DR.CASENO = DR1.CASENO
    WHERE DR.CASENO IS NOT NULL  -- CASENO IS NOT NULL AND A CORRESPONDING NULL CASENO EXISTS
    AND  (DR.LOCATIONID,DR.CONTACTID) IN
         (SELECT LOCATIONID,CONTACTID
          FROM GT_CONTACT_LVL1_DATA D
          WHERE CASENO IS NULL
            AND D.CONTACTID = DR.CONTACTID
           AND D.LOCATIONID = DR.LOCATIONID
    UNION
    SELECT DD.LOCATIONID,
           DD.CALL_LOCATIONID,
           DD.LOC_SEQ,
           DD.CONTACTID,
           DD.CALL_CONTACTID,
           DD.CALL_SEQ,
           DD.CASENO,
           DD.VERSION,
           DD.REP_SEQ,
           DD.LOC_REFNO,
    DD1.PHONE
    FROM GT_CONTACT_LVL1_DATA DD LEFT OUTER JOIN VW_GT_CONTACT_TEL DD1
      ON DD1.LOCATIONID = DD.LOCATIONID
    AND DD1.CONTACTID = DD.CONTACTID
    AND DD.CASENO = DD1.CASENO
    WHERE DD.CASENO IS NULL -- CASENO IS NULL AND A CORRESPONDING NOT NULL CASENO EXISTS
      AND (DD.LOCATIONID,DD.CONTACTID)
    IN (SELECT LOCATIONID,CONTACTID
        FROM GT_CONTACT_LVL1_DATA D
        WHERE CASENO IS NOT NULL AND D.CONTACTID = DD.CONTACTID
        AND D.LOCATIONID = DD.LOCATIONID
    union
    SELECT  DR.LOCATIONID,
            DR.CALL_LOCATIONID,
            DR.LOC_SEQ,
            DR.CONTACTID,
            DR.CALL_CONTACTID,
            DR.CALL_SEQ,
            DR.CASENO,
            DR.VERSION,
            DR.REP_SEQ,
            DR.LOC_REFNO,
            DD.PHONE
    FROM GT_CONTACT_LVL1_DATA DR LEFT OUTER JOIN VW_GT_CONTACT_TEL DD
      ON DD.CASENO = DR.CASENO
      AND DD.REP_SEQ = DR.REP_SEQ
      AND DR.CASENO = DD.CASENO
    WHERE DR.CASENO IS NOT NULL
    AND (DR.LOCATIONID,DR.CONTACTID)
    NOT IN (SELECT LOCATIONID,CONTACTID
            FROM GT_CONTACT_LVL1_DATA
            WHERE CASENO IS NULL
    UNION
    SELECT DD.LOCATIONID,
           DD.CALL_LOCATIONID,
           DD.LOC_SEQ,
           DD.CONTACTID,
           DD.CALL_CONTACTID,
           DD.CALL_SEQ,
           DD.CASENO,
           DD.VERSION,
           DD.REP_SEQ,
           DD.LOC_REFNO,
           DD1.PHONE
    FROM GT_CONTACT_LVL1_DATA DD LEFT OUTER JOIN VW_GT_CONTACT_TEL DD1
    ON DD1.LOCATIONID = DD.LOCATIONID
    AND DD1.CONTACTID = DD.CONTACTID
    AND DD.CASENO = DD1.CASENO
    WHERE DD.CASENO IS NULL
    AND (DD.LOCATIONID,DD.CONTACTID) NOT IN
    (SELECT LOCATIONID,CONTACTID
    FROM GT_CONTACT_LVL1_DATA
    WHERE CASENO IS NOT NULL
    Sybrand Bakker
    Senior Oracle DBA

  • Toplink 9.0.4.5  gradually generate extra columns in SQL

    We encounter a very interesting Toplink feature or bugs after we upgrade to 9.0.4.5
    The general pattern is that when we have SQL generated that involves joining more than 1 tables, after toplink run for a while, the join SQL statement get bigger and bigger with repeat of columns from some of the join table.
    Eventually, the SQL statements become so big with repeated groups of columns that oracle fails.
    The following are some example SQL from our log from the same run,
    ServerSession(1409420520)--Connection(840879336)-
    Notice the progression of more and more repeated column groups.
    ServerSession(1409420520)--Connection(840879336)--TopLink, version: OracleAS TopLink - 10g (9.0.4.5) (Build 040930)
    ServerSession(1409420520)--Connection(840879336)--connecting session: Not named
    ServerSession(1409420520)--Connection(840879336)--connecting(DatabaseLogin(
    platform=>Oracle9Platform
    user name=> "COMMON"
    datasource URL=> "jdbc:oracle:thin:@DEVT5DB1:1521:BASET7"
    ServerSession(1409420520)--Connection(840879336)--Connected: jdbc:oracle:thin:@DEVT5DB1:1521:BASET7
    User: COMMON
    Database: Oracle Version: Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    Driver: Oracle JDBC driver Version: 9.2.0.4.0
    ServerSession(1409420520)--Connection(103599336)--TopLink, version: OracleAS TopLink - 10g (9.0.4.5) (Build 040930)
    ServerSession(1409420520)--Connection(103599336)--connecting session: Not named
    ServerSession(1409420520)--Connection(103599336)--connecting(DatabaseLogin(
    platform=>Oracle9Platform
    user name=> "COMMON"
    datasource URL=> "jdbc:oracle:thin:@DEVT5DB1:1521:BASET7"
    ServerSession(1409420520)--Connection(103599336)--Connected: jdbc:oracle:thin:@DEVT5DB1:1521:BASET7
    User: COMMON
    Database: Oracle Version: Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    Driver: Oracle JDBC driver Version: 9.2.0.4.0
    ServerSession(1409420520)--Connection(389549288)--TopLink, version: OracleAS TopLink - 10g (9.0.4.5) (Build 040930)
    ServerSession(1409420520)--Connection(389549288)--connecting session: Not named
    ServerSession(1409420520)--Connection(389549288)--connecting(DatabaseLogin(
    platform=>Oracle9Platform
    user name=> "COMMON"
    datasource URL=> "jdbc:oracle:thin:@DEVT5DB1:1521:BASET7"
    ServerSession(1409420520)--Connection(389549288)--Connected: jdbc:oracle:thin:@DEVT5DB1:1521:BASET7
    User: COMMON
    Database: Oracle Version: Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    With the OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    Driver: Oracle JDBC driver Version: 9.2.0.4.0
    ServerSession(1409420520)--Connection(840879336)-
    SELECT
    t1.MODIFY_DT, t1.VER_ID, t1.CREATE_DT, t1.AUTHOR_ID, t1.ROLE_ID, t1.MEMBER_ID, t1.PERMISSION_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t2.PERMISSION_ID, t2.VER_ID, t2.CREATE_DT, t2.AUTHOR_ID, t2.MODIFY_DT, t2.ACTION_ID, t2.ENV_ID, t2.RESOURCE_ID
    FROM
    COMMON.MEMBER_ROLE_ASSIGNMENT t0,
    COMMON.PERMISSION t2,
    COMMON.MEMBER_ROLE_PERMISSION t1
    WHERE
    (((t1.MEMBER_ID = 'ctestqaa@adp') AND
    (t1.ROLE_ID = 'QAA')) AND
    ((t2.PERMISSION_ID = t1.PERMISSION_ID) AND
    ((t0.ROLE_ID = t1.ROLE_ID) AND
    (t0.MEMBER_ID = t1.MEMBER_ID))))
    ORDER BY t1.CREATE_DT ASC
    ServerSession(1409420520)--Connection(840879336)-
    SELECT
    t1.MODIFY_DT, t1.VER_ID, t1.CREATE_DT, t1.AUTHOR_ID, t1.ROLE_ID, t1.MEMBER_ID, t1.PERMISSION_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t2.PERMISSION_ID, t2.VER_ID, t2.CREATE_DT, t2.AUTHOR_ID, t2.MODIFY_DT, t2.ACTION_ID, t2.ENV_ID, t2.RESOURCE_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t2.PERMISSION_ID, t2.VER_ID, t2.CREATE_DT, t2.AUTHOR_ID, t2.MODIFY_DT, t2.ACTION_ID, t2.ENV_ID, t2.RESOURCE_ID
    FROM
    COMMON.MEMBER_ROLE_ASSIGNMENT t0,
    COMMON.PERMISSION t2,
    COMMON.MEMBER_ROLE_PERMISSION t1
    WHERE
    (((t1.MEMBER_ID = 'qaa09@adp') AND
    (t1.ROLE_ID = 'QAA')) AND
    ((t2.PERMISSION_ID = t1.PERMISSION_ID) AND
    ((t0.ROLE_ID = t1.ROLE_ID) AND
    (t0.MEMBER_ID = t1.MEMBER_ID))))
    ORDER BY t1.CREATE_DT ASC
    ServerSession(1409420520)--Connection(840879336)-
    SELECT
    t1.CREATE_DT, t1.MODIFY_DT, t1.BASE_CLIENT_ID, t1.VER_ID, t1.AUTHOR_ID, t1.ROLE_ID, t1.MEMBER_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID
    FROM COMMON.MEMBER_ROLE_ASSIGNMENT t0,
    COMMON.MEMBER_ROLE_CLIENT_ASSIGNMENT t1
    WHERE
    (((t1.MEMBER_ID = 'rliubsa@adp') AND
    (t1.ROLE_ID = 'QAA')) AND
    ((t0.ROLE_ID = t1.ROLE_ID) AND
    (t0.MEMBER_ID = t1.MEMBER_ID)))
    ServerSession(1409420520)--Connection(840879336)-
    SELECT
    t1.MODIFY_DT, t1.VER_ID, t1.CREATE_DT, t1.AUTHOR_ID, t1.ROLE_ID, t1.MEMBER_ID, t1.PERMISSION_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t2.PERMISSION_ID, t2.VER_ID, t2.CREATE_DT, t2.AUTHOR_ID, t2.MODIFY_DT, t2.ACTION_ID, t2.ENV_ID, t2.RESOURCE_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t2.PERMISSION_ID, t2.VER_ID, t2.CREATE_DT, t2.AUTHOR_ID, t2.MODIFY_DT, t2.ACTION_ID, t2.ENV_ID, t2.RESOURCE_ID,
    t0.VER_ID, t0.MODIFY_DT, t0.CREATE_DT, t0.AUTHOR_ID, t0.MEMBER_ID, t0.ROLE_ID,
    t2.PERMISSION_ID, t2.VER_ID, t2.CREATE_DT, t2.AUTHOR_ID, t2.MODIFY_DT, t2.ACTION_ID, t2.ENV_ID, t2.RESOURCE_ID
    FROM
    COMMON.MEMBER_ROLE_ASSIGNMENT t0,
    COMMON.PERMISSION t2,
    COMMON.MEMBER_ROLE_PERMISSION t1
    WHERE
    (((t1.MEMBER_ID = 'rliubsa@adp') AND
    (t1.ROLE_ID = 'QAA')) AND
    ((t2.PERMISSION_ID = t1.PERMISSION_ID) AND
    ((t0.ROLE_ID = t1.ROLE_ID) AND (t0.MEMBER_ID = t1.MEMBER_ID))))
    ORDER BY t1.CREATE_DT ASC

    The latest patch, TopLink 9.0.4.7 is available at metalink.oracle.com. It can be found by searching for patch 4309484.
    Note: TopLink patches are cumulative and contain fixes from all previous patches.
    The following is the bug description:
    "Introduced OracleAS TopLink 10g (9.0.4.5), OracleAS TopLink no longer appends duplicate fields to SQL when executing a query that includes mapping-level-joining."

Maybe you are looking for

  • Can not find master data in the cube

    ItemNo is an navigation attribute of 0Material. We are using 0material in a cube. When I display the cube data include ItemNo, I don't find the data I am looking for. For example: In 0Material: 0Material      ItemNo    Description AAA               

  • Help with clean Windows 8.1 install Yoga 2 Pro

    Hey guys, I purchased a Yoga 2 Pro about 4 months ago as a secondary computer for college. I've been a Mac user for most of my life, and was intersted in learning more about the Windows ecosystem. While messing around in the partition settings, I mus

  • Cisco Agent Desktop software running multiple times in Task Manager

    Has anyone seen an issue with Cisco Agent Desktop v 6.6(1) where after closing the program completely it stays running in Windows Task Manager. We have the Agent software installed on 8 PCs and only one of them is having this happen to them. One time

  • Printing a PDF file saves .prn but won't go to printer

    Windows 7 Utlimate, 32-bit.. Acrobat Pro 9.5.5. An HP Officjet and a Brother laser printer, both networked. Whenever I try to print from Acrobat, instead of going to my chosen printer I get a Save dialog box for a .prn file. Thus, I can no longer pri

  • Duplicates & triplicate Calendar items on my ipad after using the iCloud..

    i have duplicates Calendar items on my ipad after using the iCloud.. what am i doing wrong?? and how do i fix it?