Container generating invalid SQL for mysql

Apparently sunone's container is putting double quotes around the table names and field names in the SQL in generates for CMP entities beans. MySQL is not happy about this. Is there someway to deal with this? Has anyone else who is using MySQL run across this yet ?

You can configure S1AS 7.0 to support Transparent Persistence with MySQL by doing the following:
1. Create a file named .tpersistence.properties, residing in the current working directory of the S1AS instance. This will allow you to override the default Persistence Manager settings for the MySQL database.
For example, create the file $AS_INSTALL/domains/domain1/server1/config/.tpersistence.properties containing the following:
database.mysql.QUOTE_CHAR_END=\
database.mysql.QUOTE_CHAR_START=\
database.mysql.RTRIM=
database.mysql.RTRIM_POST=
2. Restart the Sun ONE AS 7.0 instance.
Regards,
Chris Drake

Similar Messages

  • Howto generate correct SQL for Connector/J?

    I am trying to switch to MySQL and generated new SQL, deployed, and
    generated a new client (all using the deploytool).
    Now I am getting the exception below (SQL Syntax error) when
    running the client. How come?
    What I'm using:
    J2EE 1.4
    MySQL 4.0.12
    Connector/J 3.0.7
    The application was working with Cloudscape.
    Help is much appreciated.
    Caught an exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: createRace: nested exception is: java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"RaceBeanTable" WHERE "raceId" = '1'' at line 1"
    at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:61)
    at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
    at com.mnm.run.ejb.race._RaceController_Stub.createRace(Unknown Source)
    at com.mnm.run.client.RunningClient.insertRaceInfo(Unknown Source)
    at com.mnm.run.client.RunningClient.main(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:324)
    at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:315)
    at com.sun.enterprise.appclient.Main.main(Main.java:215)
    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:324)
    at org.apache.commons.launcher.ChildMain.run(ChildMain.java:280)
    Caused by: java.rmi.RemoteException: createRace: nested exception is: java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"RaceBeanTable" WHERE "raceId" = '1'' at line 1"
    at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:360)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:557)
    at com.mnm.run.ejb.race.RaceControllerBean_EJBObjectImpl.createRace(RaceControllerBean_EJBObjectImpl.java:181)
    at com.mnm.run.ejb.race._RaceControllerBean_EJBObjectImpl_Tie._invoke(Unknown Source)
    at com.sun.corba.se.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:517)
    at com.sun.corba.se.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:207)
    at com.sun.corba.se.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:109)
    at com.sun.corba.se.internal.iiop.ORB.process(ORB.java:252)
    at com.sun.corba.se.internal.iiop.RequestProcessor.process(RequestProcessor.java:81)
    at com.sun.corba.se.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:106)

    Manually removing the qoutes(") from the SQL statements
    that have been generated by deploytool from the deployment
    descriptor file seems to get around the SQL syntax error,
    but now the tables are not generated as requested:
    <create-table-deploy>true</create-table-deploy>
    Any help is much appreciated.
    Andreas
    Caught an exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.RemoteException: createRace: nested exception is: java.sql.SQLException: General error, message from server: "Table 'tcladb.racebeantable' doesn't exist"
    ...

  • Kodo 3.0 generates invalid SQL statement when deleting an instance

    Hi,
         kodo 3.0 generates an invalid SQL statement when deleting an instance
    that has a one-many inverse unidirectional association.
    All manipulations of the data go just fine except for the deletion of
    instances of Whole without Parts. Kodo 3.0 generates the following SQL
    statement UPDATE PART SET WHERE PARTID= ?.
    This problem does not occur when using a bidirectional relationship
    between Whole and Part. Is there an error in the mapping file somewhere?
    Thanks in advance,
    Stijn
    database schema
    <table name="PART">
    <column name="PARTID" type="bigint"/>
    <fk to-table="WHOLE">
    <join column="PARTID" to-column="WHOLEID"/>
    </fk>
    </table>
    <table name="WHOLE">
    <column name="WHOLEID" type="bigint"/>
    </table>
    classes
    public class Whole implements javax.jdo.InstanceCallbacks{
    private java.util.Set parts = new java.util.HashSet();
    public void jdoPreDelete {
         //implements cascading delete
    public class Part implements javax.jdo.InstanceCallbacks{
    private int partid;
    mapping
    <class name="Whole">
    <field name="parts">
    <jdbc-field-map type="one-many" column.PARTID="PARTID"
    ref-column.WHOLEID="PARTID" table="PART"/>
    </field>

    This bug is caused by the fact that your FK is using a column that is
    not nullable (in this case, because it is also a PK column). It is
    definitely a bug on our side, but I wanted to let our users know that
    most one-sided one-many relations won't exhibit this problem.
    Thank you for the report; we will try to correct the problem in an
    upcoming release.

  • EA2 - BUG: Export produces invalid SQL for BINARY_DOUBLE columns

    Description:
    When a table contains a BINARY_DOUBLE column, INSERTs for that column in SQL exported with Export Wizard are invalid.
    Steps to reproduce:
    - open SQL Developer, connect to DB
    - make a table containing a BINARY_DOUBLE column, e.g.:
    CREATE TABLE "TESTTABLE" ("BINDBLCOL" BINARY_DOUBLE) ;
    - add some data (floating-point numbers) to the table
    - choose Tools -> Export Wizard (or Export DDL and Data in SQL Developer v1.2)
    - check exporting of tables and data, on "Specify Objects/Data" choose your table
    - press "Apply"
    Error:
    Generated SQL contains invalid INSERTs: floating-point numbers are enclosed in apostrophes (see below, relevant part is underlined).
    -- DDL for Table TESTTABLE
    CREATE TABLE "TESTTABLE"
    (     "BINDBLCOL" BINARY_DOUBLE
    -- DATA FOR TABLE TESTTABLE
    -- FILTER = none used
    -- INSERTING into TESTTABLE
    Insert into TESTTABLE (BINDBLCOL) values ('1.2345');
    -- END DATA FOR TABLE TESTTABLE
    The script, when run, produces following error on INSERT line:
    SQL Error: ORA-01722: invalid number
    When apostrophes are removed manually, script runs without problems.
    Remarks:
    SQL Developer: 1.5.0.52 MAIN-52.03; the same bug also on 1.2.1, build MAIN-32.13
    Oracle DB: 10 Express
    OS: Windows 2000 Professional
    Java: 1.5.0.52: 1.5.0_15; 1.2.1: 1.6.0_03

    Description:
    When a table contains a BINARY_DOUBLE column, INSERTs for that column in SQL exported with Export Wizard are invalid.
    Steps to reproduce:
    - open SQL Developer, connect to DB
    - make a table containing a BINARY_DOUBLE column, e.g.:
    CREATE TABLE "TESTTABLE" ("BINDBLCOL" BINARY_DOUBLE) ;
    - add some data (floating-point numbers) to the table
    - choose Tools -> Export Wizard (or Export DDL and Data in SQL Developer v1.2)
    - check exporting of tables and data, on "Specify Objects/Data" choose your table
    - press "Apply"
    Error:
    Generated SQL contains invalid INSERTs: floating-point numbers are enclosed in apostrophes (see below, relevant part is underlined).
    -- DDL for Table TESTTABLE
    CREATE TABLE "TESTTABLE"
    (     "BINDBLCOL" BINARY_DOUBLE
    -- DATA FOR TABLE TESTTABLE
    -- FILTER = none used
    -- INSERTING into TESTTABLE
    Insert into TESTTABLE (BINDBLCOL) values ('1.2345');
    -- END DATA FOR TABLE TESTTABLE
    The script, when run, produces following error on INSERT line:
    SQL Error: ORA-01722: invalid number
    When apostrophes are removed manually, script runs without problems.
    Remarks:
    SQL Developer: 1.5.0.52 MAIN-52.03; the same bug also on 1.2.1, build MAIN-32.13
    Oracle DB: 10 Express
    OS: Windows 2000 Professional
    Java: 1.5.0.52: 1.5.0_15; 1.2.1: 1.6.0_03

  • Ejb3 entity bean not generating valid sql for postgres 8.1

    Hello,
    I originally posted this on the jboss seam board as I ran across this error on a seam test example, but it seems it's more generally applicable to ejb3 entity beans not generating sql that postgres can understand. I'll post my message below, all replies are appreciated.
    I'm going through the hello world example from the seam book, and I'm getting an error I cannot resolve, that with an auto generated sql statement, that's not valid for postgres 8.1, the database I'm on. Here's my error:
    17:40:31,370 INFO [STDOUT] Hibernate: select next value for person_id_seq from dual_person_id_seq
    17:40:31,394 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 42601
    17:40:31,394 ERROR [JDBCExceptionReporter] ERROR: syntax error at or near "value"
    17:40:31,396 FATAL [application] javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
    javax.faces.el.EvaluationException: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
    Here's the table definition
    - create table Person (id bigint not null, name varchar(255), primary key (id))
    - create table dual_person_id_seq (zero integer)
    - create sequence person_id_seq start with 1 increment by 1
    and here's the entity bean:
    @Entity
    @Name("person")
    @Table(name="person")
    @SequenceGenerator(name="person_sequence", sequenceName="person_id_seq")
    public class Person implements Serializable {
    private long id;
    private String name;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="person_sequence")
    public long getId() { return id;}
    public void setId(long id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    How do I get it to generate a valid sql statement for postgres?

    I think you should try putting the sequence generator annotation over the primary key field. Try it and be sure it works.
    regards,
    Michael

  • DS generating invalid SQL in Informix

    I have a problem with one of my source tables.  The table is names resource, and I'm guessing that is an informix reserved word.
    The table is in informix and I can import it, add it to a dataflow and preview it without issue.  The problem only occurs when I run thge job.  DS sends SQL to informix like this:
    Select col1, col2 from informix.resource resource
    This throws an error.  So I tried reproducing this in a query tool.  What I found it this indeed generates a syntax error. 
    If I vary the command to either:
    Select col1, col2 from informix.resource AS resource
    or
    Select col1, col2 from informix.resource resource2
    It works fine.  How to I change the way DS sends its SQL ? 
    I found an old post where someone had the same issue, but that is 3 years old. 
    http://www.forumtopics.com/busobj/viewtopic.php?t=137855&sid=ef00cdaab7a9ec33f4a739e15fdf7393
    It there any option other than doing what they did create views to work around this ?
    Thanks.

    reserved word can be escaped using quotes, but the sql that DS generates for informix doesn't quote the identifiers
    one possible option as suggestion in BOB post is to create a view with different name that is not a reserved word and import that is DS
    why you don't want to create a view and use that
    or you can try using SQL transform and use any of the following syntax
    Select col1, col2 from informix.resource AS resource
    or
    Select col1, col2 from informix.resource resource2

  • SAP generating invalid XML for ORDERS05 IDOC

    We have XI 3.0 SP 20 installed here.
    I just started working with XI/PI, so bear with me if this has been asked - I already searched SAP for a note on this and couldn't find one.
    We have integrated sales orders into another system - we have SAP generating an IDOC to be sent when a sales order is created.  We use XI to route it to a 3rd party provider.
    The problem that is occuring is that if an item on the order has an ampersand in the description, the system receiving it tells us that the XML is in error.  In examining the message, it is in error as it doesn't properly escape the ampersand.
    Is there a workaround or patch for this?
    Also - it's not XI that is complaining about the issue, it's our 3rd party provider that is.
    Edited by: Bruce Hartley on Dec 22, 2010 9:34 AM

    Stefan and Abhishek;
    I read the blog - and unless SAP support does not have a fix for issue, I'm not going to use the suggestion in the blog for the exact reasons pointed out by Stefan in the most recent comment.  I have opened a case for this with SAP support and when I get a resolution on it that is not covered by the blog post I will post it here.
    To me, this should work out of the box by SAP and I shouldn't have to write code to work around it.  We're not doing anything fancy or special, we just want to send the order to the 3rd party system via an IDOC interface.  If I was generating the XML by myself, then I would have to convert the stuff.
    I don't think we have < or > in our item descriptions, but I'm sure we have quote characters in there as well.
    We have other systems we use XML with and we did have this issue a long time ago and since I was the one doing the programming and had total control over the process, I was the one who had to fix it - so at least I was aware of it.

  • ORA-01489 Received Generating SQL for Report Region

    I am new to Apex and I am running into an issue with an report region I am puzzled by. Just a foreword, I'm sure this hack solution will get a good share of facepalms and chuckles from those with far more experience. I welcome suggestions and criticism that are helpful and edifying!
    I am on Apex 4.0.2.00.07 running on 10g, I believe R2.
    A little background, my customer has asked an Excel spreadsheet be converted into a database application. As part of the transition they would like an export from the database that is in the same format as the current spreadsheet. Because the column count in this export is dynmic based on the number of records in a specific table, I decided to create a temporary table for the export. The column names in this temp table are based on a "name" column from the same data table so I end up with columns named 'REC_NAME A', 'REC_NAME B', etc. (e.g. Alpha Record, Papa Record, Echo Record, X-Ray Record). The column count is currently ~350 for the spreadsheet version.
    Because the column count is so large and the column names are dynamic I've run into a host of challenges and errors creating this export. I am a contractor in a corporate environmentm, so making changes to the apex environment or installation is beyond my influence and really beyond what could be justified by this single requirement for this project. I have tried procedures and apex plug-ins for generating the file however the UTL_FILE package is not available to me. I am currently generating the SQL for the query in a function and returning it to the report region in a single column (the user will be doing a text-to-column conversion later). The data is successfully being generated, however, the sql for the headers is where I am stumped.
    At first I thought it was because I returned both queries as one and they were joined with a 'union all'. However, after looking closer, the SQL being returned for the headers is about +10K+ characters long. The SQL being returned for the data is about +14k+. As mentioned above, the data is being generated and exported, however when I generate the SQL for the headers I am receiving a report error with "ORA-01489: result of string concatenation is too long" in the file. I am puzzled why a shorter string is generating this message. I took the function from both pages and ran them in a SQL command prompt and both return their string values without errors.
    I'm hopeful that it's something obvious and noobish that I'm overlooking.
    here is the code:
    data SQL function:
    declare
      l_tbl varchar2(20);
      l_ret varchar2(32767);
      l_c number := 0;
      l_dlim varchar2(3) := '''|''';
    begin
      l_tbl := 'EXPORT_STEP';
      l_ret := 'select ';
      for rec in (select column_name from user_tab_columns where table_name = l_tbl order by column_id)
      loop
        if l_c = 1 then
            l_ret := l_ret || '||' || l_dlim || '|| to_char("'||rec.column_name||'")';
        else
            l_c := 1;
            l_ret := l_ret || ' to_char("' || rec.column_name || '")';
        end if;
      end loop;
        l_ret := l_ret || ' from ' || l_tbl;
      dbms_output.put_line(l_ret);
    end;header sql function:
    declare
      l_tbl varchar2(20);
      l_ret varchar2(32767);
      l_c number := 0;
      l_dlim varchar2(3) := '''|''';
    begin
      l_tbl := 'EXPORT_STEP';
      for rec in (select column_name from user_tab_columns where table_name = l_tbl order by column_id)
      loop
        if l_c = 1 then
            l_ret := l_ret || '||' || l_dlim || '||'''||rec.column_name||'''';
        else
            l_c := 1;
            l_ret := l_ret || '''' || rec.column_name || '''';
        end if;
      end loop;
        l_ret := l_ret || ' from dual';
      dbms_output.put_line(l_ret);
    end;-------
    EDIT: just a comment on the complexity of this export, each record in the back-end table adds 12 columns to my export table. Those 12 columns are coming from 5 different tables and are the product of a set of functions calculating or looking up their values. This is export is really a pivot table based on the records in another table.
    Edited by: nimda xinu on Mar 8, 2013 1:28 PM

    Thank you, Denes, for looking into my issue. I appreciate your time!
    It is unfortunately a business requirement. My customer has required that the data we are migrating to this app from a spreadsheet be exported in the same format, albeit temporarily. I still must meet the requirement. I'm working around the 350 columns by dumping everything into a single column, which is working for the data, however, the headers export is throwing the 01489 error. I did run into the error you posted in your reply. I attempted to work around it with the clob type but eneded up running into my string concatentation error again.
    I'm open to any suggestions at this point given that I have the data. I'm so close because the data is exporting, but because the columns are dynamic, the export does me little good without the headers to go along with it.

  • Ojdeploy sometimes generates invalid JARs

    We've encountered the following problem: sometimes ojdeploy (called via ant task) generates invalid JARs for some projects in the workspace. Invalid means they have a size less the 1KB, there may be only META-INF\manifest.mf and no classes at all inside that JAR, or there may be some (not all) classes. And consequently the whole build fails because of "package blah-blah-blah does not exist" etc.
    Here's the bit of example from the failed build (some parts of the log are obscured and skipped):
         [exec] 13.04.2011 17:31:48 oracle.ide.boot.Launcher throttleLocale
         [exec] INFO: Locale ru_RU is not supported by this product. Forcing locale to en_US.
         [exec] ----build file----
         [exec] <?xml version = '1.0' standalone = 'yes'?>
         [exec] <ojdeploy-build>
         [exec]     <deploy>
         [exec]         <parameter name="workspace" value="${workspace}\"/>
         [exec]         <parameter name="project" value="${project}"/>
         [exec]     </deploy>
         [exec]   <defaults>
         [exec]     <variable name="workspace" value="our workspace"/>
         [exec]     <variable name="project" value="BlahBlahBlah"/>
         [exec]     <parameter name="buildfile" value="our buildfile"/>
         [exec]     <parameter name="profile" value="*"/>
         [exec]     <parameter name="clean"/>
         [exec]   </defaults>
         [exec] </ojdeploy-build>
         [exec] ------------------
    ... skipped ...
         [exec] [5:32:00 PM] Clean completed.
         [exec] Compiling...
         [exec] Context: selection=BlahBlahBlah.jpr application=BlahBlahBlah.jws project=BlahBlahBlah.jpr node=BlahBlahBlah.jpr
         [exec]
         [exec] C:\Oracle\Middleware\jdk160_14_R27.6.5-32\bin\javac
         [exec] -g
         [exec] -Xlint:all
    ... skipped ...    
         [exec] Compiling 4 sources
         [exec]   Compiling ...Logger.java
         [exec]   Compiling ...SystemOutHandler.java
         [exec]   Compiling ...LogFormatter.java
         [exec]   Compiling ...LoggerFactory.java
         [exec]   Writing ...Logger$CSIntFormatter.class
         [exec]   Writing ...Logger.class
         [exec] Apr 13, 2011 5:32:02 PM oracle.jdevimpl.deploy.common.ModulePackagerImpl deployProfiles
         [exec] INFO: Deploying profile...
         [exec]
         [exec] Apr 13, 2011 5:32:02 PM oracle.jdeveloper.deploy.jar.ArchiveDeployer logFileWritten
         [exec] INFO: Wrote Archive Module to file:/...Logging.jar
         [exec] Apr 13, 2011 5:32:02 PM oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl$DeployConsoleLogger finished
         [exec] INFO: Elapsed time for deployment:  2 seconds
         [exec]
         [exec] Apr 13, 2011 5:32:02 PM oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl$DeployConsoleLogger finished
         [exec] INFO: ----  Deployment finished.  ----
         [exec]
         [exec]   Writing ...SystemOutHandler.class
         [exec]   Writing ...LogFormatter.class
         [exec]   Writing ...LoggerFactory.class
         [exec] [5:32:02 PM] Successful compilation: 0 errors, 0 warnings.BTW, I've noticed one strange thing while writing this. I see that ojdeploy says " Deploying profile... Wrote Archive Module to file:/...Logging.jar..." and <b>AFTER having created the JAR</b> it says "Writing ...SystemOutHandler.class Writing ...LogFormatter.class Writing ...LoggerFactory.class"
    Has anyone encountered such strange behavior of ojdeploy?

    (kinda bump)
    I haven't mentioned that we use JDeveloper 11.1.1.2

  • Bad SQL for JDO query

    Kodo JDO EE 2.3 RC1 (with InstantDB on JBoss 3.0 on JDK 1.3.1 on Mac
    OS X 10.1.5) generates wrong SQL for a JDO query with a parameter.
    Essentially (unimportant details omitted) I have the following:
    2 associated persistence-capable classes
    public class Person
         private String name;
    public class Issue
         private int id;
         private Person owner;
    both with application-managed identity (Person by name, Issue by id),
    both in the same package. I want to search the database for all Issues
    owned by a certain Person. My code looks like this:
    @pre p is persistent
    Collection findByOwner(Person p){
         // pm is the PersistenceManager
         //TODO pm.newQuery(Issue.class, filter) does not work with Kodo 2.3 RC1
         Extent extent = pm.getExtent(Issue.class, true);
         Query query = pm.newQuery(extent, "owner==person");
         query.setClass(Issue.class);
         query.setIgnoreCache(true);
         query.declareParameters(Person.class.getName() + " person");
         return (Collection)query.execute(p);
    and produces the following SQL statement
    SELECT t0.IDX, t0.JDOCLASSX, t0.JDOLOCKX, t0.NAME_OWNERX FROM ISSUEX
    t0, PERSONX t1 WHERE (t1.NAMEX = NULL AND t0.NAME_OWNERX = t1.NAMEX)
    which is wrong because the actual p.name, which is definitely not nil,
    got lost, and is even rejected by the database*, probably because
    NAMEX is the primary key and cannot be NULL.
    I am pretty sure that this used to work correctly with Kodo 2.2.4. Can
    anyone tell me what I could be doing wrong? I will provide the full
    source code at request.
    Thanks,
    Jakob
    * SQLException:
    Don't understand SQL after: "WHERE"
    Expected: "{" found: "NULL"

    This issue has been resolved in internal builds.
    Some tangential notes about the code below:
    - in our latest version, we no longer require extents when executing
    queries (the candidate class is sufficient).
    - I'm a little concerned about where the 'pm' variable came from in
    Issue.findByOwner(). If that's a member variable, you'd be better off
    doing 'JDOHelper.getPersistenceManager (this)' instead of caching it on
    your own -- this way, you'll avoid any potential issues with somehow
    using the wrong PM or something.
    - Given that all the info is stored in the database already, I'd suggest
    making the relation a bidirectional one, so that you can just traverse
    from Issue to Person without needing to do a query. This will be faster,
    as we will be able to leverage our PM and PMF caches rather than needing
    to execute a query against the data store.
    -Patrick
    Jakob Spies <[email protected]> wrote:
    Kodo JDO EE 2.3 RC1 (with InstantDB on JBoss 3.0 on JDK 1.3.1 on Mac
    OS X 10.1.5) generates wrong SQL for a JDO query with a parameter.
    Essentially (unimportant details omitted) I have the following:
    2 associated persistence-capable classes
    public class Person
    private String name;
    public class Issue
    private int id;
    private Person owner;
    both with application-managed identity (Person by name, Issue by id),
    both in the same package. I want to search the database for all Issues
    owned by a certain Person. My code looks like this:
    @pre p is persistent
    Collection findByOwner(Person p){
    // pm is the PersistenceManager
    //TODO pm.newQuery(Issue.class, filter) does not work with Kodo 2.3 RC1
    Extent extent = pm.getExtent(Issue.class, true);
    Query query = pm.newQuery(extent, "owner==person");
    query.setClass(Issue.class);
    query.setIgnoreCache(true);
    query.declareParameters(Person.class.getName() + " person");
    return (Collection)query.execute(p);
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • SQLJ-JPublisher - J2T-153, Invalid value for -context:while generating the

    Hi All,
    I am trying to generate the java code for the oracle types defined for one of the module in our project.for that i have defined a new context by extending the 'DefaultContext'
    provided by SQLJ and as mentioned in the below URL.
    http://docs.oracle.com/cd/A91202_01/901_doc/java.901/a90214/jpub.htm
    Topic : JPublisher Generation of SQLJ Classes
    MyContext:-
    import java.sql.Connection;
    import java.sql.SQLException;
    import sqlj.runtime.ref.DefaultContext;
    public class MyContext extends sqlj.runtime.ref.DefaultContext{
    static {
    DefaultContext defaultContext = null;
    try {
    defaultContext = new DefaultContext(<datasource>);
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    DefaultContext.setDefaultContext(defaultContext);
    public MyContext(Connection arg0) throws SQLException {
    super(arg0);
    public Connection getConnection(){
    Connection con = null;
    try {
    con = <datasource>getConnection();
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    return con;
    JPub command:
    jpub -user=usr/pwd -context=com.test.context.MyContext -sql=<My Types Here> -compile=false
    I am getting the below error while running the jpub command in dos prompt.
    Error Log:
    J2T-153, Invalid value for -context: com.test.context.MyContext. This must be set to generated or to DefaultContext.
    Please let me know if anybody has come across this problem before.
    Thanks,
    Vijay
    Edited by: 905698 on 03-Jan-2012 09:53

    Hi Vijay,
    This post DOES NOT correspond to this forum.
    The current forum is for BI Publisher. Your question is for JPublisher and believe it corresponds to PL/SQL forums.
    Please close the thread
    thanks
    Jorge

  • SSMS 2012:FOR XML PATH Using XPath Node Tests-Columnn name 'test()' contains an invalid XML identifier as required by FOR XML?

    Hi all,
    I am learning XPATH and XQUERY from the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles, (published by apress). I copied the Code Listing 12-8 FOR XML PATH Using XPath Node Tests (listed below) and executed it in my
    SQL Server 2012 Management Studio:
    --Coles12_8.sql // saved in C:/Documemnts/SQL Server Management Studio
    -- Coles Listing 12-8 FOR XML PATH Using XPATH Node Tests
    -- Retrieving Name and E-mail Addresses with FOR XML PATH in AdvantureWorks
    -- 16 March 2015 0935 AM
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "test()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH;
    I got the following error message:
    Msg 6850, Level 16, State 1, Line 2
    Column name 'test()' contains an invalid XML identifier as required by FOR XML; '('(0x0028) is the first character at fault.
    I have no ideas why I got this error message.  Please kindly help and advise me how to resolve this error.
    Thanks in advance,  Scott Chang

    Hi Michelle, Thanks for your nice response.
    I corrected the mistake and executed the revised code. It worked nicely.
    I just have one question to ask you about the appearance of the xml output of my Co;les12_8.sql:
    <row>
    <?nameStyle 0?>
    <Person ID="1" />
    <!--2003-02-08T00:00:00-->697-555-0142<Person><Name><First>Ken</First><Middle>J</Middle><Last>Sánchez</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="2" />
    <!--2002-02-24T00:00:00-->819-555-0175<Person><Name><First>Terri</First><Middle>Lee</Middle><Last>Duffy</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="3" />
    <!--2001-12-05T00:00:00-->212-555-0187<Person><Name><First>Roberto</First><Last>Tamburello</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="4" />
    <!--2001-12-29T00:00:00-->612-555-0100<Person><Name><First>Rob</First><Last>Walters</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="5" />
    <!--2002-01-30T00:00:00-->849-555-0139<Person><Name><First>Gail</First><Middle>A</Middle><Last>Erickson</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="6" />
    <!--2002-02-17T00:00:00-->122-555-0189<Person><Name><First>Jossef</First><Middle>H</Middle><Last>Goldberg</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="7" />
    <!--2003-03-05T00:00:00-->181-555-0156<Person><Name><First>Dylan</First><Middle>A</Middle><Last>Miller</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="8" />
    <!--2003-01-23T00:00:00-->815-555-0138<Person><Name><First>Diane</First><Middle>L</Middle><Last>Margheim</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="9" />
    <!--2003-02-10T00:00:00-->185-555-0186<Person><Name><First>Gigi</First><Middle>N</Middle><Last>Matthew</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="10" />
    <!--2003-05-28T00:00:00-->330-555-2568<Person><Name><First>Michael</First><Last>Raheem</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="11" />
    <!--2004-12-29T00:00:00-->719-555-0181<Person><Name><First>Ovidiu</First><Middle>V</Middle><Last>Cracium</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    I feel this xml output is not like the regular xml output.  Do you know why it is diffrent from the regular xml xml output?  Please comment on this matter.
    Thanks,
    Scott Chang
    What do you mean by regular xml document? Are you referring to fact that its missing a root element? if yes it can be added as below
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "text()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH('ElementName'),ROOT('RootName');
    replace ElementName and RootName with whatever name you need to set for element as well as the root element
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • SQL generated by EIS for Drill Through

    Hello,<BR>We are currently using EIS 7.1 on AIX. When we run a drill through report on a large flat dimensional member there are two separate SQLs generated. The first SQL has a where condition with appx. half of the child members and the second one with second half. Is this due to any kind of limitation on he length of the SQL generated?<BR>If so is there any way to work around with this?<BR>THanks a lot in advance<BR>Kris

    Hi Michael,
    I have got the following inputs from the OLAP forum on this query:
    P_S
    Posts: 40
    Registered: 5/29/07
    How to see the SQL (OLAP DML) generated by Discoverer for OLAP
    Posted: Aug 30, 2007 9:30 AM Reply
    Hi,
    I originally posted this query on the Discoverer forum, but it was then suggested to post it here in the OLAP forum. Please help.........
    Is there a way to see the SQL (OLAP DML) generated by Discoverer for OLAP (the way we have "View SQL" in Discoverer Relational). The version in use is 10.1.2.48.18.
    Thanks,
    Piyush
    KLaker
    Posts: 1,341
    From: Manchester, UK
    Registered: 1/10/01
    Re: How to see the SQL (OLAP DML) generated by Discoverer for OLAP
    Posted: Sep 5, 2007 7:34 AM in response to: P_S Reply
    Directly within Discoverer for OLAP (or Viewer)? No - because there is no way to change the behaviour of the generated SQL, you cannot add hints or create any MVs to change the SQL generated. You can trace the SQL generated during a Disco for OLAP query though by switching on some of the OLAP tuning and diagnostic features. There is more information contained in the Discoverer for OLAP Best Practices Guide:
    http://www.oracle.com/technology/products/discoverer/pdf/discoverer_plus_olap_best_practices.pdf
    Keith Laker
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/
    Regards,
    Piyush

  • Error when uninstalling App-V RDS client: Product: Microsoft Application Virtualization (App-V) Client for Remote Desktop Services 5.0 Service Pack 2 x64 -- Error 1324. The folder path 'C:' contains an invalid character

    Issue:  experienced when attempting to uninstall the App-V 5.0 SP2 RDS client. 
    Event Log:  Product: Microsoft Application Virtualization (App-V) Client for Remote Desktop Services 5.0 Service Pack 2 x64 -- Error 1324. The folder
    path 'C:' contains an invalid character
    Symptoms (when in this current state): 
    Unable to uninstall the SP2 client
    You can upgrade the client (via hotfix) and uninstall the hotfix, but you will not be able to remove the SP2 client
    AppvVfs filter driver will not create an instance, therefore applications will not be able to read into existing streamed VFS content, or trigger sparse files to stream content.  (you can still stream the content via other means, like the UI or powershell)
    Because of the AppvVfs filter driver not instantiating, applications that depend on licences that exist in VFS will not be able to be read causing certain applications to react as if the license does not exist or is an incorrect format

    Resolution:
    Check for the existence of a hidden folder named %appdata% in the C:\Program Files\Microsoft Application Virtualization\Client folder.  (You will need to un-check the folder options box in windows explorer for "Hide
    protected operating system files" to see it)
    If the hidden %appdata% folder exists, delete it.
    Proceed to uninstall the App-V client
    After a clean uninstall and removal of remnants of the client, reinstall the client again and apply the latest hotfix available (Hotfix 2 for SP2 at a minimum).

  • Problems using Quick Migrate in SQL Developer 1.5 for MySQL to Oracle 10g

    Hi all,
    I am trying to use SQL Developer 1.5 migration tools (Quick Migrate) to perform online capture and build source model to migrate from MySQL 5.x to Oracle 10g on Windows platform. I get these errors and the Quick Migrate process fails:
    oracle.dbtools.metadata.persistence.PersistableObject.doInsert(PersistableObject.java:238)
    I did a search and used the sqldeveloper.cmd script but still fails. Then I created a new database and truncated the repository. I now get the above error plus two new ones listed below:
    oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    Error loading nls:OALL8 is in an inconsistent state
    Error occurred during capture: Protocol violation
    It fails during the capture process for MySQL 5.1 database
    when it begins to capture the tables from MySQL.
    Does anyone know how to resolve these issues when migrating from MySQL to Oracle 10g using Quick Migrate with SQL Developer 1.5 release?
    Regards,
    Ben Prusinski
    Message was edited by:
    benprusinski
    Message was edited by:
    benprusinski

    Hi all,
    I put the following in my sqldeveloper.cmd file:
    SET ORACLE_HOME=%CD%
    What is very confusing is that with SQL Developer 1.5, there are several levels and several SQL Developer executables! I am really not sure which of these to use:
    I created the SQLDeveloper 1.5 directory called SQLDeveloper1_5 on Windows:
    1) cd C:\sqldeveloper1_5\sqldeveloper-5338
    there exists a sqldeveloper.exe
    2) cd c:\sqldeveloper1_5\sqldeveloper-5338\sqldeveloper\sqldeveloper.exe
    3) cd c:\sqldeveloper1_5\sqldeveloper-5338\sqldeveloper\sqldeveloer\bin\sqldeveloper.exe
    Which SQLDeveloper 1.5 executable should I be using and where should I place the
    sqldeveloper.cmd file?
    Also I did try to use a different database and schema for the repository with Quick Migrate but it appears a bug exists in SQL Developer 1.5 version that causes errors with Quick Migrate for MySQL to Oracle? Is this correct?
    As an update, I ran the following commands:
    cd to
    c:\sqldeveloper1_5\sqldeveloper-5338\sqldeveloper\sqldeveloper\bin
    sqldeveloper.cmd sqldeveloper.exe
    Start sqldeveloper.exe
    Perform standard capture for MySQL using the new mig2 schema as the new repository
    It starts the capture but fails on the errors below:
    Error loading nls:OALL8 is in an inconsistent state
    UPDATE
    ============================
    I tried this again and it worked with the exception of one error message listed below:
    Here are the steps that I followed:
    1. Create a Windows cmd script
    Put the following entries in the script:
    SET ORACLE_HOME=%CD%
    save the command windows script as sqldeveloper.cmd
    Copy this script to the base installation directory for SQLDeveloper
    Example:
    1. cd c:\SQLDeveloper1_5\sqldeveloper-5338\sqldeveloper
    2. Start SQLDeveloper with the command script that you created earlier
    Example:
    Open a Windows shell prompt window and execute the following scripts:
    a) sqldeveloper.cmd sqldeveloper.exe
    b) sqldeveloper.exe
    3) In SQL Developer 1.5
    From the Migrate menu,
    a) Delete current repository and create a new schema in Oracle target database call it mig2.
    b) Then create a new repository in SQL Developer 1.5
    c) Right mouse click on the MySQL 5.x database and choose capture
    It worked with the exception of one error message:
    o.jdbc.driver.OracleDriver     
    Error while registering Oracle JDBC Diagnosability MBean.
    So it looks like something is screwed up with my JDBC drivers and configuration for MySQL. How do I diagnose the JDBC driver issue for MySQL?
    Thanks!!!
    Ben
    Thanks
    Ben

Maybe you are looking for