Invalid query key/Mapping View

Hi,
I am mapping a view without any primary key to a ValueObject. I am selecting three fields as primary keys such that the values are unique. I am getting an exception like
EXCEPTION DESCRIPTION: Invalid query key [lookupType] in expression.
The expression I am having is
Expression contactTypeExpr = builder.get("lookupType").equal("COUNTRIES");
constantsCol = tcaServerSession.readAllObjects(ConstantsLookupVO.class, contactTypeExpr);
Pls help me regarding this problem.
I have created a new Class mapping in which also I am facing the same problem.
Is there any other parameters that I have to consider while mapping objects to DB View.
Regards
Solomon

This error generally occurs when the mapping for this attribute does not exists. Please ensure that the attribute you are attempting to use in the expression has a valid mapping.
--Gordon

Similar Messages

  • Invalid Query Key when using ReadAllQuery.addOrdering()

    Hi,
    I have an object called Request mapped to the Request table and a field within it called creator which is mapped to the User object with a 1-1 mapping. the User object is mapped to the user table.
    Now when I do addOrdering() with an expression as below and execute the ReadAllQuery, I get an exception which says "Invalid Query Key[lastName]".
    raq.addOrdering(raq.getExpressionBuilder().get("creator").get("lastName").ascending());
    where raq is an instance of ReadAllQuery.
    Have anyone experienced this? Any help would be much appreciated.
    Thank you,
    Sanjay Mathew.

    I double checked and the attribute names look ok.
    Please see the code below:
    SearchCriteria p_searchCriteria = new SearchCriteria();
    sc.setSortAttribute (
    "m_creatorUser.m_lastName,m_creatorUser.m_firstName");
    sc.setSortOrder(SearchCriteria.ASCENDING);
    ReadAllQuery raq = new ReadAllQuery(Request.class, queryExpression);
    if (p_searchCriteria.getSortAttribute() != null &&
    p_searchCriteria.getSortAttribute().trim().length() > 0) {
    StringTokenizer st1 =
    new StringTokenizer(p_searchCriteria.getSortAttribute(), ",");
    while (st1.hasMoreTokens()) {
    ExpressionBuilder eb = raq.getExpressionBuilder();
    String sortattr = st1.nextToken();
    StringTokenizer st2 = new StringTokenizer(sortattr, ".");
    Expression orderexpr = null;
    while (st2.hasMoreTokens()) {
    String st2Str = st2.nextToken();
    if (orderexpr == null)
    orderexpr = eb.get(st2Str);
    else
    orderexpr = orderexpr.get(st2Str);
    if (p_searchCriteria.getSortOrder() == null ||
    (p_searchCriteria.getSortOrder() != null &&
    p_searchCriteria.getSortOrder().equals(SearchCriteria.
    ASCENDING))) {
    orderexpr = orderexpr.ascending();
    } else {
    orderexpr = orderexpr.descending();
    raq.addOrdering(orderexpr);
    I tried creating the expression with hard coded attribute names as well like this:
    raq.getExpressionbuilder().get("m_creatorUser").get("m_lastName").ascending()
    In both cases I get "Invalid query key" exception.
    Sanjay.

  • ReadObjectQuery - Invalid query key

    Hello again :)
    A have still stuck on TopLink :(
    I created very simple example:
    DB:
    create table TESTIK
    ID NUMBER not null,
    NAZEV VARCHAR2(255),
    VERSION NUMBER
    I created new project in TopLink WorkBench, created new session.. I mean, there is no problem (but I'm not sure :) ) .
    I created new Dynamic WebApplication in Eclipse, using Glassfish server and framework JSF...
    My source:
    This is my entity, represent table TESTIK
    Testik.class:
    package toplink.model.entity;
    import java.io.Serializable;
    public class Testik implements Serializable { // implements Serializable
         private int id;
         private String nazev;
         private int version;
         public Testik() {
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getNazev() {
              return nazev;
         public void setNazev(String nazev) {
              this.nazev = nazev;
         public int getVersion() {
              return version;
         public void setVersion(int version) {
              this.version = version;
    This is for create session - i don't now, is it rights? :)
    SessionSetting.class:
    package toplink.services.settings;
    import oracle.toplink.sessions.Project;
    import oracle.toplink.threetier.Server;
    import oracle.toplink.tools.workbench.XMLProjectReader;
    public class SessionSetting extends oracle.toplink.platform.xml. jaxp.JAXPPlatform {
         public SessionSetting() {
         public Server getSession(){
         System.setProperty("toplink.xml.platform", "oracle.toplink.platform.xml.jaxp.JAXPPlatform");
              Project myProject = XMLProjectReader.read("c:/ecl_work/TopLink_Intro/src/META-INF/TopLink_Intro.xml", Thread.currentThread().getContextClassLoader());
              Server serverSession = myProject.createServerSession();
              return serverSession;
    And if I want used some query:
    public Testik findById(int id) {
              SessionSetting ss = new SessionSetting();
              Server session = ss.getSession();
    Testik testik = (Testik) session.readObject(Testik.class, new ExpressionBuilder().get("id").equal(1));
              return testik;
    But this return Exception:
    javax.servlet.ServletException: #{testikManagedBean.najdiTestik}: Exception [TOPLINK-6015] (Oracle TopLink - 11g (11.1.1.0.0) (Build 080909)): oracle.toplink.exceptions.QueryException
    Exception Description: Invalid query key [id] in expression.
    Query: ReadObjectQuery(toplink.model.entity.Testik)
    Where testikManagedBean.najdiTestik call findById(int id) !
    I tried used StoredProcedureCall, ReadObjectQuery, ValueReadQuery, ReadAllQuery and nothing works :(
    Example:
    public Collection<Testik> findAll(){
              SessionSetting ss = new SessionSetting();
              Server session = ss.getSession();
              Collection<Testik> testiky = session.readAllObjects(Testik.class);
              return testiky;
    but in this example, it works a long time and return:
    javax.servlet.ServletException: #{testikManagedBean.vsechnyTestiky}: Exception [TOPLINK-4002] (Oracle TopLink - 11g (11.1.1.0.0) (Build 080909)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Exception input/output: The Network Adapter could not establish the connection
    Error Code: 17002
    Query: ReadAllQuery(toplink.model.entity.Testik)
    I know what it means in this problem, but I do not know where is it, because in the workbench I can normally connect to the database... Is this problem in sessions or where?
    Please, I tried some very simple example, how to use TopLink and Queries and i'm still stuck.. I'm newbie in toplink and I do not know your advice...
    Please, could you help me with my problem?
    Thanks in advance

    I still cannot find a problem :(
    My Toplink_Intro.xml source is here :
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink:object-persistence version="Oracle TopLink - 11g (11.1.1.0.0) (Build 080909)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <opm:name>TopLink_Intro</opm:name>
    <opm:class-mapping-descriptors>
    <opm:class-mapping-descriptor xsi:type="toplink:relational-class-mapping-descriptor">
    <opm:class>toplink.model.entity.Testik</opm:class>
    <opm:alias>Testik</opm:alias>
    <opm:primary-key>
    <opm:field table="TESTIK" name="ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <opm:events xsi:type="toplink:event-policy"/>
    <opm:querying xsi:type="toplink:query-policy"/>
    <opm:attribute-mappings>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="TESTIK" name="ID" xsi:type="opm:column"/>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>nazev</opm:attribute-name>
    <opm:field table="TESTIK" name="NAZEV" xsi:type="opm:column"/>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>version</opm:attribute-name>
    <opm:read-only>true</opm:read-only>
    <opm:field table="TESTIK" name="VERSION" xsi:type="opm:column"/>
    </opm:attribute-mapping>
    </opm:attribute-mappings>
    <toplink:descriptor-type>independent</toplink:descriptor-type>
    <toplink:locking xsi:type="toplink:version-locking-policy">
    <toplink:version-field table="TESTIK" name="VERSION" xsi:type="opm:column"/>
    </toplink:locking>
    <toplink:instantiation/>
    <toplink:copying xsi:type="toplink:instantiation-copy-policy"/>
    <toplink:tables>
    <toplink:table name="TESTIK"/>
    </toplink:tables>
    </opm:class-mapping-descriptor>
    </opm:class-mapping-descriptors>
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</toplink:platform-class>
    <toplink:user-name>tpl</toplink:user-name>
    <toplink:password>90412C7B7643C5A83BC1D672E05E1D31</toplink:password>
    <toplink:driver-class>oracle.jdbc.OracleDriver</toplink:driver-class>
    <toplink:connection-url>jdbc:oracle:thin:@172.17.2.69:1521:ORCL</toplink:connection-url>
    </toplink:login>
    </toplink:object-persistence>
    and sessions.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink-sessions version="11g (11.1.1.0.0)" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session xsi:type="database-session">
    <name>MyDBSession</name>
    <event-listener-classes/>
    <logging xsi:type="toplink-log">
    <log-level>fine</log-level>
    </logging>
    <primary-project xsi:type="xml">C:/ecl_work/TopLink_Intro/src/META-INF/TopLink_Intro.xml</primary-project>
    <login xsi:type="database-login">
    <platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</platform-class>
    <user-name>tpl</user-name>
    <password>90412C7B7643C5A83BC1D672E05E1D31</password>
    <sequencing>
    <default-sequence xsi:type="table-sequence">
    <name>Default</name>
    </default-sequence>
    </sequencing>
    <driver-class>oracle.jdbc.OracleDriver</driver-class>
    <connection-url>jdbc:oracle:thin:@172.17.2.69:1521:ORCL</connection-url>
    <struct-converters/>
    </login>
    </session>
    </toplink-sessions>
    Any idea, why I have still this exception:
    javax.servlet.ServletException: #{testikManagedBean.najdiTestik}: Exception [TOPLINK-6015] (Oracle TopLink - 11g (11.1.1.0.0) (Build 080909)): oracle.toplink.exceptions.QueryException
    Exception Description: Invalid query key [id] in expression.
    Query: ReadObjectQuery(toplink.model.entity.Testik)
    in this code?
    Testik testik = (Testik) session.readObject(Testik.class, new ExpressionBuilder().get("id").equal(1));
    Thanks in advance
    Edit:
    And if I used this code:
    Collection<Testik> testiky = session.readAllObjects(Testik.class);
    then returns this exception:
    javax.servlet.ServletException: #{testikManagedBean.vsechnyTestiky}: Exception [TOPLINK-4002] (Oracle TopLink - 11g (11.1.1.0.0) (Build 080909)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00936: missing word
    Error Code: 936
    Call: SELECT FROM TESTIK
    Query: ReadAllQuery(toplink.model.entity.Testik)
    Edited by: KLD on Nov 10, 2008 12:34 AM

  • Invalid query key

    I have the following class hierarchy
    A has a one-to-many relationship with B, B has a one-to-one relationship with C, C has a one-to-one relationship with D and D has a one-to-one relationship with E. B, C, D, and E each have a derived class B1, C1, D1 and E1 respectively.
    I am getting Invalid Query Key exception while trying to access a query key defined in E1 using the following toplink code
    ExpressionBuilder.get("A").anyOf("B").get("C").get("D").get("E").get("aFieldInE1");
    Any help on this will be greatly appreciated.
    Thanks,
    Milan Dattawade.

    I assume by "derived class" you mean subclass. If so, then this query breaks polymorphism. Although you may know that you only want A's that have an E that is specifically E1, the language doesn't know that.
    Luckily there is an easy way to handle this. You can create a Query Key in the class E that has the information about the subclass attribute in E1 that you want to be able to query through. In other words, hint to TopLink that you'd like to occasionally query and break polymorphism by assuming you're querying on specific subclass attributes.
    See:
    http://download-west.oracle.com/docs/cd/B10464_01/web.904/b10313/queries.htm#1108755
    (or search your PDF for Foundation Library for "DirectQueryKey") See Javadoc for DirectQueryKey too.
    - Don

  • QueryException Invalid query key in expression.

    Hi, I'm trying to run this select
    Query q = em.createQuery("SELECT R.receivedOn, COUNT(R)) FROM Responders R,"+ "ConsumerHistory ch WHERE ch.jobid = "+job.getJobid()+" and ch.trackid = R.trackid"+ "GROUP BY R.receivedOn");
    the[i] job.getJobid() is a parameter, the exception it throws
    Exception [TOPLINK-6015] (Oracle TopLink Essentials - 9.1 (Build b33e-beta)): oracle.toplink.essentials.exceptions.QueryException
    Exception Description: Invalid query key [jobid] in expression.
    Query: ReportQuery(com.a2mks.scimark.entidad.Responders)
         at oracle.toplink.essentials.exceptions.QueryException.invalidQueryKeyInExpression(QueryException.java:608)
         at oracle.toplink.essentials.internal.expressions.QueryKeyExpression.validateNode(QueryKeyExpression.java:657)
         at oracle.toplink.essentials.expressions.Expression.normalize(Expression.java:2562)
         at oracle.toplink.essentials.internal.expressions.DataExpression.normalize(DataExpression.java:343)
         at oracle.toplink.essentials.internal.expressions.QueryKeyExpression.normalize(QueryKeyExpression.java:440)
    The ConsumerHistory Class implementacion is
    @Entity(name = "ConsumerHistory")
    @Table(schema = "SCIMARK", name = "CONSUMER_HISTORY")
    public class ConsumerHistory implements Serializable {
    @Id
    @Column(name = "HISTORYID", nullable = false, length = 20)
    private long historyid;
    @Column(name = "JOBID")
    private long jobid;
    @Column(name = "TRACKID")
    private String trackid;
    Can any body give me some ideas.... thanks

    The specification states that "A property or field name specified as an orderby_item must correspond to a basic persistent property
    or field of the associated class or embedded class within it", so you cannot use type.code since it does not represent a property in Item.
    Please file a feature request if you wish to have this added to EclipseLink as an extension to JPA.

  • EJB3 / TopLink EntityManager - invalid query key in expression

    with Glassfish and TopLinka s the entity manager, I'm getting an QueryException that I don't understand. The complaint is that my key (enamelId) is invalid. However I can use the same key in a different query successfully.
    Any thoughts?
    this query gets no complaints:
    SELECT sh FROM Showpiece as sh WHERE sh.enamelId = '0301'
    this query fails:
    SELECT ex FROM Exhibition as ex, Showpiece as sh WHERE sh.enamelId = '0301' AND ex.id = sh.showId
    Exception [TOPLINK-6015] (Oracle TopLink Essentials - 2006.4 (Build 060412)): oracle.toplink.essentials.exceptions.QueryException
    Exception Description: Invalid query key [enamelId] in expression.
    Query: ReportQuery(com.schwarcz.enamels.model.Exhibition)
    at oracle.toplink.essentials.exceptions.QueryException.invalidQueryKeyInExpression(QueryException.java:608)
    at oracle.toplink.essentials.internal.expressions.QueryKeyExpression.validateNode(QueryKeyExpression.java:657)
    at oracle.toplink.essentials.expressions.Expression.normalize(Expression.java:2542)
    at oracle.toplink.essentials.internal.expressions.DataExpression.normalize(DataExpression.java:343)

    I don't remember the specifics of my solution. The base cause was indeed an error in my code. I dimly remember that I had written something so that TopLink was trying to generate a join table and I had defined one as a POJO as well. What I do remember was what I did to find a solution...
    I switched to using the Hibernate entity manager, got some different error messages and was able to correct my code. I now routinely switch back and forth between TopLink and Hibernate. Both seem to me to be pretty likely to produce error messages that are vague and not too helpful.

  • Invalid query key - JPA

    Hello,
    I'm trying to create a select which has 5 different tables and i'm getting the following error:
    Exception [TOPLINK-6015] (Oracle TopLink Essentials - 2006.4 (Build 060412)): oracle.toplink.essentials.exceptions.QueryException
    Exception Description: Invalid query key [
    Query Key usuarioSubgrupoPK
    Base entity.Usuario] in expression.
    Query: ReportQuery(entity.Usuario)
         oracle.toplink.essentials.exceptions.QueryException.invalidQueryKeyInExpression(QueryException.java:608)
         oracle.toplink.essentials.internal.expressions.ObjectExpression.getDescriptor(ObjectExpression.java:209)
         oracle.toplink.essentials.internal.expressions.QueryKeyExpression.getContainingDescriptor(QueryKeyExpression.java:213)
         oracle.toplink.essentials.internal.expressions.QueryKeyExpression.getQueryKeyOrNull(QueryKeyExpression.java:325)
         oracle.toplink.essentials.internal.expressions.QueryKeyExpression.isAttribute(QueryKeyExpression.java:366)
    My select is:
    List<Projeto> pList = em.createQuery(
    "select p "+
    " from "+
    " Usuario u, "+
    " UsuarioSubgrupo usb, "+
    " Subgrupo sb, "+
    " Grupo g, "+
    " Projeto p "+
    " where usb.usuarioSubgrupoPK.cdUsuar = u.cdUsuar "+
    " and usb.usuarioSubgrupoPK.cdSubgr = sb.cdSubgr "+
    " and sb.grupo = g "+
    " and g.projeto = p "+
    " and g.stAdmin = 1 "+
    " and u.cdUsuar = 1 ").getResultList();
    Relevant code:
    Usuario.class
    @Id
    @Column(name = "CD_USUAR", nullable = false)
    @SequenceGenerator(name="SqUsuario",sequenceName="SQ_USUARIO", allocationSize=20)
    @GeneratedValue(strategy=javax.persistence.GenerationType.SEQUENCE, generator="SqUsuario")
    private Long cdUsuar;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "usuario")
    private java.util.Collection <entity.UsuarioSubgrupo> usuarioSubgrupoCollection;
    UsuarioSubgrupo.class
    @EmbeddedId
    protected UsuarioSubgrupoPK usuarioSubgrupoPK;
    @JoinColumn(name = "CD_USUAR", referencedColumnName = "CD_USUAR", updatable=false, insertable=false)
    @ManyToOne
    private Usuario usuario;
    @JoinColumns({
    @JoinColumn(name = "CD_GRUPO", referencedColumnName = "CD_GRUPO", updatable=false, insertable=false),
    @JoinColumn(name = "CD_SUBGR", referencedColumnName = "CD_SUBGR", updatable=false, insertable=false)
    @ManyToOne
    private Subgrupo subgrupo;
    UsuarioSubgrupoPK.class
    @Id
    @Column(name = "CD_USUAR", nullable = false)
    private Long cdUsuar;
    @Id
    @Column(name = "CD_SUBGR", nullable = false)
    private Long cdSubgr;
    Subgrupo.class
    @Id
    @Column(name="CD_GRUPO", nullable = false, insertable = false, updatable = false)
    private Long cdGrupo;
    @Id
    @Column(name="CD_SUBGR", nullable = false)
    @SequenceGenerator(name="SqSubgrupo",sequenceName="SQ_SUBGRUPO", allocationSize=20)
    @GeneratedValue(strategy=javax.persistence.GenerationType.SEQUENCE, generator="SqSubgrupo")
    private Long cdSubgr;
    @ManyToOne
    @JoinColumn(name = "CD_GRUPO", referencedColumnName = "CD_GRUPO")
    private Grupo grupo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "subgrupo")
    private java.util.Collection <entity.UsuarioSubgrupo> usuarioSubgrupoCollection;
    Could someone give me a hand, please?
    Thanks a lot!
    !_Let's share ideas_!

    Is UsuarioSubgrupoPK.class annotated as @Embeddable? If not, that is required.
    Also, try removing the @Id annotations within the UsuarioSubgrupoPK and instead use basic mappings (the default). The @EmbeddedId annotation in UsuarioSubgrupo should be enough to make those fields IDs.

  • Query Key Definition when Inheritance is present

    Let me describe the domain model I am working with. There is a ProjectAgreement class that is a Contract (via extends) that is a VersionedObject (via extends). There is also a ProjectAgreementVersion class that is a ContractVersion (via extends) that is an ObjectVersion (via extends). The domain model also specifies that a VersionedObject has a collection of ObjectVersion instances.
    From the data model perspective, there are four tables of interest : CONTRACT, PROJECT_AGREEMENT, CONTRACT_VERSION, and PROJECT_AGREEMENT_VERSION. The persistent VersionedObject and ObjectVersion attributes are captured in these tables. The CONTRACT_ID column is present on both CONTRACT and PROJECT_AGREEMENT tables and is the primary key in both those tables. The CONTRACT_VERSION_ID column is present on both CONTRACT_VERSION and PROJECT_AGREEMENT_VERSION and is the primary key on both those two tables. There is also a CONTRACT_FK column on the CONTRACT_VERSION table to house the one to many relationship there.
    What I am attempting to do is add a OneToOneQueryKey to the Descriptor, at Descriptor definition time, for ProjectAgreementVersion so that I can write an expression of the form projectAgreementVersionExpression.get("projectAgreementQueryKey").get("someAspectOfAProjectAgreementInstance") ... While TOPLink doesn't complain at startup, I do get an invalid query key exception at run time when this relationship is attempted to be traversed via this query key.
    Here is one version of the query key as I have it defined against the ProjectAgreementVersion Descriptor:
    OneToOneQueryKey projectAgreementQueryKey = new OneToOneQueryKey();
              projectAgreementQueryKey.setName("projectAgreementQueryKey");
              projectAgreementQueryKey.setReferenceClass(ProjectAgreement.class);
              ExpressionBuilder x = new ExpressionBuilder();
              projectAgreementQueryKey.setJoinCriteria(x.getField("CONTRACT_VERSION.CONTRACT_VERSION_ID").equal(x.getParameter("PROJECT_AGREEMENT_VERSION.CONTRACT_VERSION_ID"))
              .and(x.getField("PROJECT_AGREEMENT.CONTRACT_ID").equal(x.getParameter("CONTRACT_VERSION.CONTRACT_FK"))));
              result.addQueryKey(projectAgreementQueryKey);
    Anybody have some ideas of the right combination of getField() and getParameter() calls against the ExpressionBuilder so that the query key is valid in TOPLink's eyes? Could the problem be that I must define the query key via a descriptor amendment method?
    Thanks,
    Doug

    James, thanks for the response. I had originally created and added the OneToOneQueryKey against the ProjectAgreementVersion Descriptor as the Descriptor was being built. I later attempted to defer the QueryKey creation and addition to the Descriptor to Descriptor amendment time, but got the same result.
    I also verify the Descriptor's QueryKeys after adding the OneToOneQueryKey and at the time an Expression is being built to use the QueryKey. At both times, a QueryKey exists by the given name as well as how you suggested. It appears that the QueryKey is present on the ProjectAgreementVersion Descriptor, but is simply invalid. Here is the stack trace this is generated when the ReadAllQuery is executed with the built Expression that uses this QueryKey:
    [java] [2005-07-06 15:53:31.407] LOCAL EXCEPTION STACK:
    [java] EXCEPTION [TOPLINK-6015] (TopLink - 9.0.3 (Build 423)): oracle.topli
    nk.exceptions.QueryException
    [java] EXCEPTION DESCRIPTION: Invalid query key [projectAgreementQueryKey]
    in expression.
    [java] QUERY: ReadAllQuery(ProjectAgreement)
    [java] at oracle.toplink.exceptions.QueryException.invalidQueryKeyInExp
    ression(Unknown Source)
    [java] at oracle.toplink.internal.expressions.RelationExpression.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.CompoundExpression.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.CompoundExpression.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.SQLSelectStatement.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.SubSelectExpression.norma
    lize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.FunctionExpression.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.CompoundExpression.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.CompoundExpression.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.CompoundExpression.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.expressions.SQLSelectStatement.normal
    ize(Unknown Source)
    [java] at oracle.toplink.internal.queryframework.ExpressionQueryMechani
    sm.buildNormalSelectStatement(Unknown Source)
    [java] at oracle.toplink.internal.queryframework.ExpressionQueryMechani
    sm.prepareCursorSelectAllRows(Unknown Source)
    [java] at oracle.toplink.queryframework.CursorPolicy.prepare(Unknown So
    urce)
    [java] at oracle.toplink.queryframework.ReadAllQuery.prepare(Unknown So
    urce)
    [java] at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(Unkn
    own Source)
    [java] at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown S
    ource)
    [java] at oracle.toplink.queryframework.ReadQuery.execute(Unknown Sourc
    e)
    [java] at oracle.toplink.publicinterface.Session.internalExecuteQuery(U
    nknown Source)
    [java] at oracle.toplink.threetier.ServerSession.internalExecuteQuery(U
    nknown Source)
    [java] at oracle.toplink.threetier.ClientSession.internalExecuteQuery(C
    lientSession.java:269)
    [java] at oracle.toplink.publicinterface.Session.executeQuery(Unknown S
    ource)
    [java] at oracle.toplink.publicinterface.Session.executeQuery(Unknown S
    ource)
    Any other ideas?
    Thanks,
    Doug

  • Map Viewer Query Rewriting for Dynamic themes and  Materialized Views.

    Hi,
    I am usng a WMS request to render FOI points in my map.
    Internally query rewrite is happening in Mapviewer for this dynamic theme and my data points query is getting converted as
    select FROM
    ( select status, shape from MatView.MyTab where id = '3' )
    WHERE MDSYS.SDO_FILTER(shape, MDSYS.SDO_GEOMETRY(2003, 4283, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(144.948120117188,-37.8162934802451,144.950866699219,-37.8141237016045)), 'querytype=WINDOW') = 'TRUE'
    here the rewritten query is not correct and is throwing exceptions in mapviewer log
    How can I make this query to be written correctly.
    (My orginal query before rewrite is: select status,shape from MatView.MyTab where id='3' )
    I am using a materialised view : MatView is a materialized view.
    When I used normal tables, the query is re written correctly.But for this materialized view this is happening.
    How can I correct the error?
    Is this has something to do with some Spatial Indexing in Materialised view or Query Rewriting for materialized view?
    Edited by: 841309 on Mar 10, 2011 11:04 PM

    Oops!
    The Materialized view was not accessible from the schema I tried :)
    And so when I gave permissions,it formed the correct query.
    So if permission is not there,map viewer will rewrite the query in a wrong way! New information.

  • Invalid option for MAP: MAP.

    Hi ,
    My replication file is running fine with below contents
    MAP PROD.f0911, TARGET PROD.f0911, &
    REPERROR (21000, EXCEPTION), &
    SQLEXEC (ID lookup, ON UPDATE, &
    QUERY "select count(*) conflict from PROD.f0911 where ID_NO = :p1 and &
    UPDT_DT > :p2", &
    PARAMS ( p1 = ID_NO, p2 = UPDT_DT ), BEFOREFILTER, ERROR REPORT, &
    TRACE ALL),&
    FILTER (lookup.conflict = 0, ON UPDATE, RAISEERROR 21000);
    MAP PROD.f0911, TARGET PROD.f0911_EI, EXCEPTIONSONLY, &
    INSERTALLRECORDS, &
    COLMAP (USEDEFAULTS ,
    dberr = @GETENV ("lasterr", "dberrnum");
    REPERROR (-1403, EXCEPTION)
    MAP PROD.f0911, TARGET PROD.f0911_EI,
    EXCEPTIONSONLY,
    INSERTALLRECORDS,
    COLMAP (USEDEFAULTS,
    dberr = @GETENV ("lasterr", "dberrnum");
    But when I am adding
    MACRO #exception_handler
    BEGIN
    ,TARGET PROD.f0911
    ,UPDATEINSERTS
    ,EXCEPTIONSONLY
    END;
    REPERROR (-1, EXCEPTION)
    MAP PROD.f0911, TARGET PROD.f0911;
    MAP PROD.f0911 #exception_handler()
    It is throwing error ---- ERROR OGG-00212 Invalid option for MAP: MAP.
    Can somebody please help how can I proceed with all the conditions.
    Thanks

    As per our requirement if there is "0001 -unique constraint violated" error while replication the insert record should be update in target table .So I have used
    UPDATEINSERT statement iin macro and it goes to the same main table but for others it has mapped to EXCEPTION table prodf0911_EI , so the record will go to exception table .But we need the record should go to main table and insert record should update in target table only in case of 0001 - unique key constraint violated error.

  • Key Mapping activates Versus Import Manager

    Hello,
    I have Key mapping activated in the console and Supress Unchaged Records activated in my syndication map.
    Case  : I import files (suppliers catalogs) to MDM via Import Manager manually. I am not sure about it, but since I activated Key mapping property,
    I noticed that for each supplier ID in the Supplier table, a lot of remote keys were created. Previously I only had one remote key for each supplier and now I have a list of other supplier's ID. ( Existent or nonexistent supplier IDs). This becomes an issue for my import, because  when I try to import a file where the supplier id does not exist in the MDM ( this scenario used to block my import and this is what a expect, as supplier is a key in my mapping),  the system automatically maps that nonexistent supplier to other supplier.
    Can you help me to understand if this is caused for the key mapping property ? Any Idea ?
    Thank you very much
    Luciana.

    Hello Stanley,
    The remote keys are form the same remote system.
    My story is : When I am importing a file , suppose my file has an invalid supplier ID. ( this means this supplier is not in the lookup table Suppliers)
    1)The import manager will give me a message such as : Map Supplier ID Values. This behavior was expected.
    2)I decided to test the automap. The invalid supplier was not mapped to a different value. I am ok with that.
    3)If the user ( dont ask me the reason ;-)) decides to map that invalid supplier ID to a different one, he/she is allowed to do so. I remember when the key mapping was not activated this option did not exist. The map and automap button was deactivated.
    What I am trying to make sure is : a remote key will be created for invalid suppliers ONLY if I choose to map it with a different supplier ID.
    Do you have any comments about it ?
    Thank you very much
    Luciana.

  • Key Mapping - Automation

    Hi , I have a following scenario that I want to automate within MDM :
    Vendor data coming from 3 remote systems ( say p-Carrd , Legacy Supply management and Invoice system) .
    1. Have loaded vendor data from all the systems in MDM using import manager .
    2. Have applied rules for match and then merge for likely identical records
    3. Now  I want to see the key mappings for the merged record to determine say what are the source records have been merged into a single record so one way is I could add the id of source systems for this MDM record but that is manual .
    Is there any way to automate this i.e. whenever I merge records and clieck on view key mapping I should have all the source system ids and remote systems appearing .? Key mapping is enabled for main table i.e. Vendor master
    Regards,
    Amit

    Hi Amit,
    first before importing any records, you should add your different source systems to your repository in MDM Console. You can do this in the Admin section. Having done this you can already import your source files for your source system. This step will automatically create a key mapping entry that can be seen in MDM Data Manager. Make sure that you map the actual key field of your record to the destination Remote Key field in your import map. If you now merge records from different source systems in MDM Data Manager, the merge will automatically append the remote keys of the  different systems to your merged record.
    Best regards
    Michael

  • Remote key mapping in Category table

    Hi,
    We are not able to populate the Remote key in the Category table.
    In standard repository the Category table only has one field 'Category Name' which is defined as Display Field.
    In order for us to map customer file records which has UNSPSC code with our Category definitions we have added a field 'UNSPSC ID' in the Category table.
    As 'Category Name' is the field that should be displayed we need to use the Remote Key function in order to get a unique identifier in the Category table for automatic mapping of supplier records to the Categories in the Category table. However, we are not able to populate the Remote key field in the destination table Categories.
    The Category table has 'Key mapping' set to yes and in the Import manager we clone the field 'UNSPSC ID' and map the clone to destination field 'Remote Key'. However, 'Remote Key' does not come up as unique Matching field and performing the Import we can see that the Remote key is blank for all records in the category table.
    Does anyone out there know what needs to be done in order to populate the 'Remote Key' in the Category table?
    Please note that we are able to map and populate the Remote key field in other tables such as Product Group, Supplier etc but not in the Category table. Is there some special considerations as this is a taxonomy table?
    Regards
    Jan

    Dear Poster,
    As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.
    Best Regards,
    SDN SRM Moderation Team

  • Changing the query on a view object

    I have a view object right now, based on an entity. It is the default view object, so that means the query in the view object is straight forward, it grabs all of the attributes from the table. And there is no WHERE clause.
    In reality I only want to show a finite set of rows from my table. Every time a record is changed/edited in this entity and committed, a new row in the database is created with the same information (I'm using CreateWithParams) except for a few columns.
    I actually don't really have update on this table, just creation of new rows. But to the user, I want it to 'look' like they are editing something in the table.
    Example:
    12, 11:32,Thompson, 60 (the user edits this information in an adf table, and a new row is created in the db)
    12, 11:55, Thompson, 75
    I have a timestamp (see above) field in the database that is used as part of my primary key, so that I know which record is the latest.
    When the VO query is run, I want the user to only see the latest row from the db.
    12, 11:55, Thompson, 75
    So...
    I went to my VO, and I changed the WHERE query to add this:
    where t1.TimeStamp = (Select MAX(t2.TimeStamp) FROM rcl.x t2 where t1.uid = t2.uid);
    Now, this isn't a mysql/sql question. There's actually a better query that I'd rather run, but the VO editor doesn't allow me to change the query itself....
    When I save the new WHERE to my VO, run my page again, I get the expected result (showing me only the latest records).
    However, when I try and sort on the table in which my data is displayed, I am now getting ORDER BY errors.
    I don't want my VO to be read-only sql based. I want to be able to update my table, so I have my VO running off of the entity.
    Why doesn't the VO allow me to change the query itself? (Like do a subquery, instead of having my where clause do the work)
    Why are order by errors being thrown when I sort on my adf table after changing the where clause in my view?
    Hopefully I wasn't too convoluted in the explanation of my problem..
    Thanks in advance,
    Joel

    HI Joe,
    Regarding your problem you can do one of the following tasks:
    1- easily to tuning on your view object, I mean in the tuning page of the view you can set that only return 1 record or 2-3 record fetch not all the record.
    in the order by you will order by the timestamp field and descending.
    2- you can order by the timestamp descending and in the where clause only set the rownum<2 (will return the last record) you can also set rownum<5 and get the 4 last record etc.
    3-editing the view query in the expert mode is not advised at all because of many consequences that you will face.
    4- maybe it is not bat that you add a readonly view for the table you mentioned and every time you unpdate the entity just re-execute the read-only view.( this method maybe is good maybe is not it depends on your business logic)
    Regards.
    Edited by: Amir Khanof on Sep 3, 2010 11:11 PM

  • Problem with key mapping in 10g

    Hello,
    my client is using key mapping on their reports server. It works fine except for parameter values...
    I can run this URL:
    http://<host>/reports/rwservlet?kr+2002+20
    and there is a mapping for kr in the cgicmd.dat file like this:
    kr: report=KR userid=<user>/<pw>@orcl desformat=html destype=cache p_verksamhetsar=%1
    p_verksamhetsar is a parameter of the report (meaning year).
    My problem is that when the report is run using the above URL the parameter gets the value 2002=
    An equal sign is added! The year column is a varchar2 so the query works but gives no result.
    I get the same problem if I try this URL:
    http://<host>/reports/rwservlet?kr%262002%2620
    If I run this URL it works fine (with a result as well):
    http://<host>/reports/rwservlet?report=KR&userid=<user>/<pw>@orcl&desformat=html&destype=cache&p_verksamhetsar=2004
    Any suggestions?
    Kind regards
    Tomas Albinsson

    Hi Kranthi,
    I think you mean %* at the end, meaning all parameters sent.
    Yes, I use this approach now as I've been unable to get %1, %2 etc to work.
    Strange, because %1 is described in the manual and I feel I use it like they say.
    Well, it works in a way, just that = is appended to the values.
    It has that buggy smell :)
    Kind regards
    Tomas

Maybe you are looking for

  • Trying to serialize C# object and store as XML Datatype in Sql Server 2005

    using if (Obj != null)                MemoryStream stream = new MemoryStream();                StreamWriter writer = new StreamWriter(stream);                XmlSerializer x = new XmlSerializer(Obj.GetType());                x.Serialize(writer, Obj);

  • Half of the bookmarks in my bookmarks toolbar have disappeared.

    I think this happened after a recent update. I still have the first half of my bookmarks in the bookmarks toolbar but the second half have disappeared. I still have all my other bookmarks but my history has also disappeared along with the most freque

  • SHUTDOWN: Active sessions prevent database close operation

    Hi Yesterday morning, our Oracle Apps Database did not shutdown and throws the following error. Fri May 11 06:57:18 2012 Active call for process 2031784 user 'xxxl' program 'oracleyyy@zzz' SHUTDOWN: waiting for active calls to complete. Fri May 11 07

  • I cant download the adobe flash player ive tried everything

    but it still says "your current settings do not allow this file to be download ive done the tools then enable downlod file but it keeps saying the same thing please help!!!

  • ERROR: Could not initialize random algorithm  ???

    Hello, Every think works normally but tuxedo prints this message : GP 1235 ERROR: Could not initialize random algorithm Description A failure occurred in the encryption subsystem Action Contact your BEA TUXEDO system Technical Support. does anyone kn