How to SQL intersect using Toplink expressions

I try to do this SQL intersect
SELECT part_k FROM ATTR_VALUE
where commodity_n ='dab badge' and attribute_n='Badge Width' and attribute_value_x='10'
INTERSECT
SELECT part_k FROM ATTR_VALUE
where commodity_n='dab badge' and attribute_n='Brand Logo' and attribute_value_x='Jaguar'
using the following Toplink expressions:
Expression e1 = builder.get("commodity").equal("dab badge")
.and(builder.get("attribute").equal("Badge Width"))
.and(builder.get("value").equal("10"));
Expression e2 = builder.get("commodity").equal("dab badge")
.and(builder.get("attribute").equal("Brand Logo"))
     .and(builder.get("value").equal("Jagua"));
Expression myExpression = e1.and(e2);
However, this would not give me the correct result.
Any suggestions would be greatly appreicated.

Right, TopLink doesn't have an Intersect operator. If it did, you might still get the same problem unless you are using a report query to return only the "part_k" value instead of an object since attribute_n cannot have a value of both 'Badge Width' and 'Brand Logo' at the same time.
You can get the part_k values or the objects from the ATTR_VALUE
table by using a report query for the second expression as a subquery to the IN clause. Something like
  ReportQuery subquery = new ReportQuery(yourclass.class);
  ExpressionBuilder subBuilder = subquery.getBuilder();
  Expression e2 = subBuilder.get("commodity").equal("dab badge").and(subBuilder.get("attribute").equal("Brand Logo")).and(subBuilder.get("value").equal("Jagua"));
  subquery.setSelectionCriteria(e2);
  subquery.addAttribute("partk");
  Expression myExpression = e1.and( builder.get("partk").in(subquery) );Regards,
Chris

Similar Messages

  • How can I start using Oracle Express Edition

    Good afternoon, how can I start using Oracle Express Edition? I have it installed it but I can not enter any user or key that allows me to manage the program from the Internet. I have understood that this version is free.
    Correct me I'm wrong and please do noted me. In my country this course very expensive and I'm looking to learn on my own.
    Edited by: user12301712 on 03-dic-2009 9:46

    Hi
    During installation wizard asked you about password for SYS and SYSTEM user, you had to set it. If you forgot you can loggin to ORACLE via SQL plus without password:
    c:\>SQLPLUS / sys as sysdba
    after connect you can set new password for any user, for example (SYSTEM user):
    ALTER USER SYSTEM identified by NEW_PASSWORD;
    After this you can login to APEX (Internet enviroment)
    Remember Oracle it's not only Internet frontend, it's huge tools with many functions. If you need study Oracle you need many time and zest but it is worth-while.
    Yes Oracle XE is free (read licence agreement).

  • Executing a PL/SQL block (using Toplink)

    I have a scenario where I need to execute some fairly complex PL/SQL blocks. As a tester, I am attempting to execute the following simple block:
    declare val NUMBER := 1; begin val := 2; end;
    Both wrapping this in an SQLCall, or a DataReadQuery give the following exception. What is the best way to execute a PL/SQL block using Toplink?
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00900: invalid SQL statement
    Error Code: 900
    Call: declare val NUMBER := 1; begin val := 2; end;
    Query:DataReadQuery()
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:290)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:570)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:442)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:453)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:117)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:103)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:174)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelect(DatasourceCallQueryMechanism.java:156)
         at oracle.toplink.queryframework.DataReadQuery.executeNonCursor(DataReadQuery.java:118)
         at oracle.toplink.queryframework.DataReadQuery.executeDatabaseQuery(DataReadQuery.java:110)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:603)
         at oracle.toplink.queryframework.DataReadQuery.execute(DataReadQuery.java:96)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2062)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:981)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:938)

    Could you try the following:
            Session s = ...
            DataModifyQuery dmq = new DataModifyQuery();
            SQLCall sqlCall = new SQLCall();
            sqlCall.setQueryString(
                "declare\n" +
                "  val NUMBER := 1;\n" +
                "begin\n" +
                "  val := 2;\n" +
                "end;");
            sqlCall.setQuery(dmq);
            dmq.setCall(sqlCall);
            s.executeQuery(dmq);

  • How to Query Multiple Fields from different Tables using Toplink Expression

    Hi,
    I am trying to prepare an Oracle Toplink Expression to qurey the multiple columns of different tables. the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to readAllObjects method as a parameter
    Expression exp = (..............this is the required qurey expression...................)
    Vector employees = session.readAllObjects(getClass(), exp);
    thanks,

    You havent given any information on the mapping between Cycle and Asp. I presume there is a one to one mapping between them. Also it appears there is no "WHERE" clause to limit the number of cycles being retrieved. If that is the case then I presume you want to load all cycles in the system.
    Thats just a clientSession.readAllObjects(Cycle.class). If you have indirection turned on the Asp should get loaded when you do a cycle.getAsp().
    I presume that SQL you posted loads all the columns of CYCLE and ASP. If you are interested in a subset of CYCLE or ASP then you should do a ReportQuery or partial object read.
    Hi,
    I am trying to prepare an Oracle Toplink Expression
    to qurey the multiple columns of different tables.
    the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME
    LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to
    readAllObjects method as a parameter
    Expression exp = (..............this is the required
    qurey expression...................)
    Vector employees = session.readAllObjects(getClass(),
    exp);
    thanks,

  • SQL query from toplink expression

    Hi,
    I have a oracle.toplink.expressions.Expression object with me which has been created using oracle.toplink.expressions.ExpressionBuilder. I want to find its equivalent SQL query(say select emp.empname,emp.empId from employee emp) which will be fired in order to fetch data i.e. find its equivalent Statement/PreparedStatement or anything which will help me obtain the raw SQL statement about to be fired.
    Please let me know if there is any soln.
    Thanks,
    Adithya.

    You can create ReadAllQuery with the expression and get the query's SQL using query.prepareCall() and then query.getSQLString().
    James : http://www.eclipselink.org

  • How to fetch substring using regular expression

    Hi,
    I am new to using regular expression and would like to know some basic details of how to use them in Java.
    I have a String example= "http://www.google.com/foobar.html#*q*=database&aq=f&aqi=g10&fp=c9fe100d9e542c1e" and would like to get the value of "q" parameter (in bold) using regular expression in java.
    For the same example, when we tried using javascript:
    match = example.match("/^http:\/\/(?:(?!mail\.)[^\.]+?\.)?google\.[^\?#]+(?:.*[\?#&](?:as_q|q)=([^&]+))?/i}");
    document.write('
    ' + match);
    We are getting the output as: http://www.google.com/foobar.html#q=database,*database* where the bold text is the value of "q" parameter.
    In Java we are trying to get the value of the q parameter separately or atleast resembles the output given by JavaScript. Please help me resolving this issue.
    Regards
    Praveen

    BalusC wrote:
    Regex is a cumbersome solution for fixed patterns like URL's. String#substring() in combination with String#indexOf would most likely already suffice.I usually agree, although, in this case, finding the exact parameter might be difficult without a small regex, perhaps:
    "\\wq=\\s*"in conjunction with Pattern/Matcher, used similarly to an indexOf() to find the start of the parameter value.
    Winston

  • How to Validate this using Regular Expressions

    Hi All,
    I have following types of Mail IDs, Each is a String.
    It may be either of the Following:
    [email protected]
    or
    Ameer<[email protected]>
    Then How to validate using the Regular Expressions.

    use this regex.. might need to convert it from perl regex flavor:
    (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
    )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
    \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
    ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
    \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
    31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
    ](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
    (?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
    (?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
    |(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
    ?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\
    r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
    \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)
    ?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t]
    )*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
    \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
    )(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
    )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)
    *:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+
    |\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r
    \n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
    \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t
    ]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031
    ]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
    ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?
    :(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?
    :\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?
    :(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
    [ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\]
    \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
    \\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
    @,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"
    (?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t]
    )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
    ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?
    :[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[
    \]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-
    \031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(
    ?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
    :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
    ^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\"
    .\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\
    ]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\
    [\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\
    r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
    \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]
    |\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0
    00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\
    .|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
    ;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
    :[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
    (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
    \[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[
    ^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]
    ]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(
    ?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
    ".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(
    ?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
    \["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t
    ])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t
    ])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?
    :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
    \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:
    [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
    ]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)
    ?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["
    ()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)
    ?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>
    @,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
    \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,
    ;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]
    )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
    ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?
    (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
    \[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:
    \r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
    "()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])
    *))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
    +|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\
    .(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
    |(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(
    ?:\r\n)?[ \t])*))*)?;\s*)

  • How I launch mailto using outlook express, my default mail program.

    I have downloaded firefox browser for Win XP. I have a default mail program on my computer. I have checked and firefox recognizes it as default. How can I access it from the browser and can I set a bookmark? for quick access. Thanks

    #Right click the Internet Explorer icon on your desktop and go to Properties.<br><br>
    #Click the Programs tab and make sure it says "Outlook Express" in the Email menu.<br><br>
    #Close that and then in Firefox, press the ALT key to toggle the text menu links on (and off).<br><br>
    #Click File and then "Send Link".
    It should open OE with the link to whatever page you're on.

  • How to use user defined function in select query using Toplink

    Hi Friends
    I am little bit of new in Toplink stuff... so please help me...
    I have to database functions 1. encrypt and 2. decrypt.
    I want to exceute the following sql query using toplink
    select port, database, user_name, decrypt(encrypt('String which is to be encrypt ','password'),'password') from CONFIGURATION
    can anyone tell me , how to write code in toplink which will give the about sql output.
    thanks .....

    The "Specifying a Custom SQL String in a DatabaseQuery" section in the TopLink Developer's Guide may help... http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b28218/qrybas.htm#BCFHDHBG

  • Help in Forming sql query in Toplink...

    Hi,
    I've the following query in SQL which I need to formulate the same using Toplink expression builder.
    SELECT AVG(HPE),AVG(DK), AVG(HDS), AVG(NAS), AVG(EMC), AVG(EBR), AVG(ARC), AVG(CEL)
    FROM V_SRTS_AGGREGATE WHERE DATACENTER_ID = 2 AND (UPPER(DATA_FLAG_365) = 'YES') and input_date between sysdate -365 and SYSDATE;
    And I've the following in my DAO for Toplink.
    UnitOfWork unitOfWork = getUnitOfWork();      
         ExpressionBuilder aSrtsAggregateView = new ExpressionBuilder();     
         ReportQuery query = new ReportQuery(aSrtsAggregateView);      
         query.setReferenceClass( SrtsAggregateView.class );     
         query.addAverage("EVA", aSrtsAggregateView.get("hpe"));      
         query.addAverage("DK", aSrtsAggregateView.get("dk"));      
         query.addAverage("HDS", aSrtsAggregateView.get("hds"));      
         query.addAverage("NAS", aSrtsAggregateView.get("nas"));
         query.addAverage("EMC", aSrtsAggregateView.get("emc"));      
         query.addAverage("EBR", aSrtsAggregateView.get("ebr"));      
         query.addAverage("ARC", aSrtsAggregateView.get("arc"));      
         query.addAverage("CEL", aSrtsAggregateView.get("cel"));      
              String fromdateLink = "SYSDATE-365";     
              String todateLink = "SYSDATE";
              locToLink = aSrtsAggregateView.get("datacenterid").equal(id);      
              Expression dateToLink = aSrtsAggregateView.get("inputDate").between(fromdateLink, todateLink);
              Expression flagToLink = aSrtsAggregateView.get("data_flag_365").equalsIgnoreCase("yes");
              query.setSelectionCriteria(locToLink.and(flagToLink).and(dateToLink));      
    I'm getting following error
    'Exception [TOPLINK-3005] (OracleAS TopLink - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.ConversionException
    Exception Description: Incorrect timestamp format: [SYSDATE-365] (expected [YYYY-MM-DD HH:MM:SS.NNNNNNNNN])
    Please advise if any one has suggestions..
    Thanks,
    Anil

    The TopLink expression method currentDate() should return the SYSDATE. You could also use ExpressionMath to subtract 365 from this. There is also an expression method literal() that is sometimes useful for advanced SQL.
    <p>
    i.e.
    <code source="java">
    Expression dateToLink = aSrtsAggregateView.get("inputDate").between(ExpressionMath.subtract(aSrtsAggregateView.currentDate(), new Integer(365)), aSrtsAggregateView.currentDate());
    <code>
    <p>---
    <br>James Sutherland
    <br>Oracle TopLink, EclipseLink
    <br>Wiki: Java Persistence, EclipseLink

  • Using Regular Expression

    I do have a table with one varchar2 column with the following values:
    COL_NAME
    1.1.3.TECH.SG.1.Action.2
    1.1.3.TECH.SG.1.Action.3
    1.1.3.TECH.SG.1.Action.4
    1.1.3.TECH.SG.1.Action.5
    1.1.3.TECH.SG.1.Action.6
    I need the last digit to be reduced by 1 like below:
    COL_NAME NEW_VALUE
    1.1.3.TECH.SG.1.Action.2 1.1.3.TECH.SG.1.Action.1
    1.1.3.TECH.SG.1.Action.3 1.1.3.TECH.SG.1.Action.2
    1.1.3.TECH.SG.1.Action.4 1.1.3.TECH.SG.1.Action.3
    1.1.3.TECH.SG.1.Action.5 1.1.3.TECH.SG.1.Action.4
    1.1.3.TECH.SG.1.Action.6 1.1.3.TECH.SG.1.Action.5
    How can this be achieved by a SQL statement using Regular Expression ?
    Pls suggest.
    Regards
    MS

    You don't really need regexps, you can just use normal instr() and substr():
      1  with v as (
      2     select '1.1.3.TECH.SG.1.Action.2' as val from dual union all
      3     select '1.1.3.TECH.SG.1.Action.3' as val from dual union all
      4     select '1.1.3.TECH.SG.1.Action.4' as val from dual union all
      5     select '1.1.3.TECH.SG.1.Action.5' as val from dual union all
      6     select '1.1.3.TECH.SG.1.Action.6' as val from dual
      7  )
      8  select val
      9  , substr(val, 1, instr(val, '.', -1))
    10  || to_char(to_number(substr(val, instr(val, '.', -1) + 1)) + 1) new_val
    11* from v
    SQL> /
    VAL                      NEW_VAL
    1.1.3.TECH.SG.1.Action.2 1.1.3.TECH.SG.1.Action.3
    1.1.3.TECH.SG.1.Action.3 1.1.3.TECH.SG.1.Action.4
    1.1.3.TECH.SG.1.Action.4 1.1.3.TECH.SG.1.Action.5
    1.1.3.TECH.SG.1.Action.5 1.1.3.TECH.SG.1.Action.6
    1.1.3.TECH.SG.1.Action.6 1.1.3.TECH.SG.1.Action.7
    5 rows selected.cheers,
    Anthony

  • How Do I Run Older AirPort Express Base Station with Yosemite

    I am running Yosemite, Airport Utility 6.3.4, which doesn't see my older Air Port Express.
    I also have an older Mac, running Snow Leopard, which does see it.
    In other threads discussing this same issue, access to an older mac is proposed as a solution... but the level of detail doesn't go much beyond, "use a Mac running an older operating system / version of airport utility to reconfigure the Air Port Express."
    How do I use the older version of the air port utility on one computer and ultimately get the newer computer with the newer version of the air port utility to see the Air Port Express? Step by step instructions would be much appreciated!

    Once setup the airport express can be used by any wireless device. The actual OS or firmware it is running is irrelevant.
    So simple.. set up the airport express in whatever role you want them.. I cannot give you details since you have not given any info on how you want to use them.
    Once setup say to play music to a speaker.. the Mac will be able to find the device.. airport utility will see the device .. it is simply that Apple decided you cannot configure it.
    If you want details, then we need full details of the network.. and how you intend to use the express.

  • How to use toplink "build expression"  with soundex function

    We are using toplink experssion builder to build the query. can any one help me on build a query with soundex using toplink..
    for example :
    SELECT last_name, first_name
    FROM hr.employees
    WHERE SOUNDEX(last_name)
    = SOUNDEX('SMYTHE');

    TopLink's ExpressionOperator does have an operator defined for soundex. I have an example that uses it that I customized to match you case.
    I would recommend defining these queries as named queries using an after-load method:
        public static void afterLoadEmployee(ClassDescriptor descriptor) {
            ReadAllQuery raq = new ReadAllQuery(Employee.class);
            ExpressionBuilder eb = raq.getExpressionBuilder();
            Expression fnExp =
                ExpressionOperator.soundex().expressionFor(eb.get("lastName"));
            Expression valExp =
                ExpressionOperator.soundex().expressionFor(eb.getParameter("L_NAME"));
            raq.setSelectionCriteria(fnExp.equal(valExp));
            raq.addArgument("L_NAME", String.class);
            descriptor.getDescriptorQueryManager().addQuery("Employee.findBySoundexLastName",
                                                            raq);
        }Now you can execute the query anywhere in your application using:
            List<Employee> emps =
                (List<Employee>)session.executeQuery("Employee.findBySoundexLastName",
                                                     Employee.class, "SMYTHE");The SQL generated is a little different due to the multiple tables used in the employee example model but here is what I got:
    SELECT t0.EMP_ID, t1.EMP_ID, t0.F_NAME, t1.SALARY, t0.L_NAME, t0.GENDER, t0.VERSION, t0.ADDR_ID,
    t0.MANAGER_ID, t0.END_DATE, t0.START_DATE FROM EMPLOYEE t0, SALARY t1
    WHERE ((SOUNDEX(t0.L_NAME) = SOUNDEX('SMYTHE')) AND (t1.EMP_ID = t0.EMP_ID))Doug

  • How can I use TopLink for querys that have two and more tables?

    I use TopLink today, and I can use one table to query, but how can I use TopLink for querys that have two and more tables?
    Thank you for see and answer this question.

    You can write a custom SQL query and map it to an object as needed. You can also use the Toplink query language "anyOf" or "get" commands to map two tables as long as you map them as one to one (get command) or one to many (anyOf command) in the toplink mapping workbench.
    Zev.
    check out oracle.toplink.expressions.Expression in the 10.1.3 API

  • Toplink expression - using complex in clause

    We are trying to build an toplink expression in java that would produce the following where clause:
    where (settlement_id, retailer_id, site_id, end_read_datetime, txn_datetime)
         in (select settlement_id, retailer_id, site_id, end_read_datetime, max(txn_datetime)
                   from tlsa_dim
         where end_read_datetime
         BETWEEN to_date('1/1/2002 00:00:01','mm/dd/yyyy hh24:mi:ss')
                        AND to_date('1/9/2002 00:00:00','mm/dd/yyyy hh24:mi:ss')
                   and site_id = '0040473041023'
              group by settlement_id, retailer_id, site_id, end_read_datetime )
    We have created a reportquery to represent the internal sub query, but
    cannot seem to find how to tell the ExpressionBuilder to get 5 fields together
    before the .in(reportQuery).
    Anyone have any ideas?          
    here is our java code
    public static ReportQuery getReportQueryForSiteIdAndEffectiveDateRangeAndMaxHistoricalStartDate() throws DataIntegrityException {
    ExpressionBuilder aBuilder = new ExpressionBuilder();
    ReportQuery query = new ReportQuery(aBuilder);
    query.setReferenceClass(Dim.class);
    query.addAttribute("settlementId", aBuilder.get("settlementId"));
    query.addAttribute("retailerId", aBuilder.get("retailerId"));
    query.addAttribute("siteId", aBuilder.get("siteId"));
    query.addAttribute("endReadDateTime", aBuilder.get("endReadDateTime"));
    query.addMaximum("max-txndatetime", aBuilder.get("historicalStartDate"));
    query.setSelectionCriteria(equalsSiteId.and(greaterThanEqualtoEffectiveStart.and(lessThanEqualtoEffectiveEnd)));
    query.addGrouping(aBuilder.get("settlementId"));
    query.addGrouping(aBuilder.get("retailerId"));
    query.addGrouping(aBuilder.get("siteId"));
    query.addGrouping(aBuilder.get("endReadDateTime"));
    // Vector reports = (Vector) session.executeQuery(query);
    return query;
    public static Expression forSiteIdAndEffectiveDateRangeAndMaxHistoricalStartDate(String siteId, DateInterval effectiveDateInterval) throws DataIntegrityException {
    ExpressionBuilder aBuilder = new ExpressionBuilder();
    Expression greaterThanEqualtoEffectiveStart = aBuilder.get("endReadDateTime").greaterThanEqual(effectiveDateInterval.getStartDate());
    Expression lessThanEqualtoEffectiveEnd = aBuilder.get("endReadDateTime").lessThanEqual(effectiveDateInterval.getEndDate());
    Vector parameterVector = new Vector();
    // trying a vector, but no luck
    parameterVector.addElement(aBuilder.get("settlementId"));
    parameterVector.addElement(aBuilder.get("retailerId"));
    parameterVector.addElement(aBuilder.get("siteId"));
    parameterVector.addElement(aBuilder.get("endReadDateTime"));
    parameterVector.addElement(aBuilder.get("historicalDateRange").get("historicalStartDate"));
    Expression inMaxGroup = aBuilder.get(parameterVector).in(getReportQueryForSiteIdAndEffectiveDateRangeAndMaxHistoricalStartDate());
    Expression equalsSiteid = forSiteId(aBuilder, aSiteId);
    return equalsSiteid.and(inMaxGroup);
    public static Expression forSiteId(ExpressionBuilder aBuilder, String aSiteId){
    Expression equalsSiteId = aBuilder.get("siteId").equalsIgnoreCase(aSiteId);
    return equalsSiteId;

    There is no expression support for this. You'll have to use SQL.
    Here is a thread of an example using Having with report queries.
    Re: How to build SQL Where clause "Having" using Toplink ExpressionBuilder
    - Don

Maybe you are looking for

  • CUP Provisions user to SAP successfully but gives "Auto-Provisioning" error

    Hi All, I'm getting an "auto-provisioning" error in CUP when a "Change Account" workflow is approved. The strange thing is, CUP does successfully provision the change to the SAP backend. Yet, the "New Account" provisions successfully without the erro

  • Backend error message when changing old PO's in upgraded system

    Hi, We upgraded our SRM system from 5 to 7.1 The issue we are facing is that fir all OLD PO's in the system,which were created before the upgrade,if we change the price or delete service lines in PO,then an error message is displayed "Backend error:P

  • Cost center for Production Order

    Hi all,      We are now not able to get a report of Material consumption cost, Cost center wise. It is Because cost center is not linked to Production order or not linked to material issued to production order. Can we get the cost of material cosumpt

  • Update & Insert into Internal table

    Dear Abapers, Is it possible to update a entry in the internal table if exists, otherwise inserts a new one. I think MODIFY <Internal Table> will not insert new one if the matching entry is not there. MODIFY <database_table> have this facility. Thank

  • Crash at start up due to audio units

    Anyone else, IK Multimedia Amplitube has some issues with VMware, it looses a authorization if i am no careful and start a PC program., any case FCP crashes