Rrplease give me assistance to build correct query

Hi,
I wrote query for getting rows from previous year April to now onwards(current date).But it won't works.I don't know how to solve this problem.Please help to change this query
SELECT IN_TOTCHLD, IN_TOTHS
FROM PLSPLIDT_TB
WHERE
to_char(to_date(DT_DATE,'dd/mm/yyyy')) between
case when
TO_CHAR(TO_DATE('29/04/2009','DD/MM/YYYY'),'mm')<4 then to_date('Apr' || to_char(to_number( to_char('29/04/2009','YYYY')) - 1),'MonYYYY')
when
TO_CHAR(TO_DATE('29/04/2009','DD/MM/YYYY'),'mm')>=4 then to_date('Apr' || to_char(to_number(to_char('29/04/2009','YYYY'))),'MonYYYY')
end
AND TO_CHAR(TO_DATE('29/04/2009','DD/MM/YYYY'))
Regards,
Rajendar.
Edited by: Rajendar Are on Apr 28, 2009 11:52 PM

hi Vinay,
DT_DATE DATE(7)
In my table all this fields are stored like this format *04/22/2009 12:00:00 AM*
my java parmeter give rptdate=*29/04/2009* as java string
Query
SELECT IN_TOTCHLD
FROM PLSDTA_DTLS_TB
WHERE TO_DATE(DT_DATE,'DD-MM-YYYY') BETWEEN
(CASE WHEN TO_CHAR(to_date(rptdate,'DD-MM-YYYY'),'MM') <=3 THEN
TO_DATE('01-04-' || TO_CHAR(rptdate,'YYYY') - 1,'DD-MM-YYYY')
ELSE TO_DATE('01-04-' || TO_CHAR(rptdate,'YYYY'),'DD-MM-YYYY')
END)
AND TO_DATE(rptdate,'DD-MM-YYYY')
yet it gives error at
TO_DATE('01-04-' || TO_CHAR(rptdate,'YYYY') - 1,'DD-MM-YYYY')
ELSE TO_DATE('01-04-' || TO_CHAR(rptdate,'YYYY'),'DD-MM-YYYY')
above 2 lines.
regards,
Rajendar

Similar Messages

  • Geting ORA 936 -while building dynamic query in for loop.

    HI,
    I hav written a SP and its compiled and giving me the results for the data I am quering but giving ORA936 - missing expressin and giving ORA 6512 at 2 lines. Please help me me out where I am going wrong.
    CREATE OR REPLACE TYPE LIST as VARRAY(5000) of NUMBER;
    CREATE OR REPLACE PROCEDURE test( V_id IN LIST,
    v-fdate IN DATE,
    v-tdate IN DATE,
    v_flg IN CHAR)
    AS
    TYPE opfld IS RECORD (
    FID TAB.ID%TYPE,
    FCURR TAB.CURR %TYPE,
    FCNT TAB.CNT%TYPE,
    FTOT TAB.TOT%TYPE );
    TYPE OPLIST IS REF CURSOR;
    Rc oplist;
    Edtab opfld;
    Selstr VACHAR2(200);
    Whstr1 VACHAR2(200);
    Whstr2 VACHAR2(200);
    Whstr3 VACHAR2(200);
    Whstr VACHAR2(200);
    Grpstr VACHAR2(200);
    Andstr VACHAR2(200);
    Fullstr VACHAR2(200);
    BEGIN
    Selstr := ‘SELECT col1,col2,sum(col3),sum(col4) from tab1 ’;
    Whstr1 := ‘ WHERE tdate BETWEEN TO_DATE(‘||’’’’||vfdate||’’’’||’)’;
    Whstr2: = ‘ AND TO_DATE(‘||’’’’||vtdate||’’’’||’)’;
    Whstr := whstr1||whstr2;
    Grpstr := ‘GROUP BY col1,col2’;
    IF v_flg IS NOT NULL THEN
    Whstr3 := whstr||’AND FLAG = ‘||v_flg;
    else
    Whstr3 := whstr ;
    END IF;
    FOR I IN 1..id.COUNT LOOP
    BEGIN
    Andstr := ‘ AND id =’|| v_id(i);
    Whstr := whstr3 || andstr ;
    Fullstr := selstr||whstr||grpstr;
    OPEN rc for fullstr;
    LOOP
    FETCH rc into edtab
    EXIT when rc%NOTFOUND;
    END LOOP;
    Andstr := ‘’;
    Whstr :=’’;
    END; ---BEGIN of FOR loop
    END LOOP; -- for end
    CLOSE rc;
    END; -- proc end
    Created above SP and its compiled. When I try to execute the SP with below code I am getting--
    DECLARE
    V_t LIST;
    BEGIN
    V_t:= LIST();
    V_t.EXTEND(10);
    V_t(1) := 10;
    V_t(2) := 20;
    Test(v_t,’25-APR-2012’,’30-APR-2012’,’Y’);
    END;
    The SP is building correct dynamic querry and its getting executed for id = 10 and 20, giving the correct results but though I defined only 2 ids while executing and written FOR lOOP upto ID.COUNT its building query for third time and that time its not getting id, so for the third time the last part of where clause is built like
    SELECT.....
    WHERE....
    AND id = (its taking blank here)
    GROUP BY ...;
    and thus its giving me ORA 936 missing expression and ORA 06152 at line of RECORD TYPE declaration and line of OPEN rc for fullstr;
    ERROR at line 1
    ORA 00936 misssing expresiion
    ORA 006152 at line 9
    ORA 006512 at line 87
    I hav put DBMS_OUTPUT statements @ every build of dynamic wuery and its correct. here I have not copid the code I hav typed hereso not wriiten DBMS_OUTPUT.
    I tried lot of ways redefining Andstr := ‘’;
    Whstr :=’’; after for endloop but its giving the same error. is this because I am using varray? If am providing 2 ids in anonymous block then how its building query for third blank ID value.
    Please help me out here..
    Thanks a lot..

    >
    I hav written a SP and its compiled and giving me the results for the data I am quering
    >
    Then you should have posted the one that compiles and gives you results.
    The code you posted will not compile without errors. Edit your original post and provide the corrected code.
    When you do please add \ tags on the line before and after the code to preserve formatting. See the FAQ for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to build a query based on(UNION) 3 vendor InfoObject

    Dear Experts:
    I have a requirement to build one query based on 3 vendor InfoObjct: 0VENDOR + 0VEN_COMPC + 0VEN_PURORG.
    I tried to build a multiprovider upon these 3 infoobjects, but when I Identify(Assign) the key for each InfoObject, supposely there should be 3 InfoObject for me to check (0VENDOR, 0VEN_COMPC and 0VEN_PURORG) so that I can UNION these 3 infoobjects together on vendor number. But since the reference infoobject of these 3 vendor master data is different, I can not check the 3 together.
    Can anybody let me know how to build that query? I only need vendor number show once, and the attributes of 0VEN_COMPC and 0VEN_PURORG can be union to 0vENDOR.
    Any post would be appreciated and thank you all in advance!
    Best Regards!
    Tim

    Hi,
    you can create a link between the vendor objects itself, means link 0vendor with 0ven_compc and 0ven_purorg. This should give you a list of all vendors multiplied with the comp codes multiplied with the purch. org. May be here it is possible to create another link between a attribute (eg. comp_code of 0ven_purorg with comp_code of 0ven_compc). In case it is not possible you need to add this link information somehow. Another option might be to create 2 queries. One on a infoset of 0vendor and 0ven_purorg and another one on 0vendor and 0ven_compc.
    regards
    Siggi

  • Instrument I/O Assistant not installed correctly

    I've been troubleshooting this problem for over 2 weeks now and every response to this question that has found success I have tried, but was unable to fix the problem.
    in labView, double selecting the I/O Assistant it reads the infamous text
    "I I/O Assistant Not installed correctly or..."
    I have downloaded the latest NI-VISA 5.1.3 (or the latest), NI-488.2.  In order to install the NI-VISA I needed to find a .net 4.0 framework & Visual Studios 2003 or better.  After this failed, I downloaded the DCD_AUG12_1 & 2_Downloaders.  After that did not work it left me considering if my machine or equipment is the problem, or if the software is just unable to support these features.
    My System Information includes
    Windows XP 32 bit
    Drivers Include:
    8757d
    Agilent 34401
    HP8753x
    Connection Attempting:
    GPIB Ethernet
    When launching labView I receive an error
    "The web server cannot start.  Is the webserver port already in use...
    ...labView Network Address is in use"
    When trying to communicate with the machine connected to my computer, I can write to it, however I cannot read from or query information from it.  NI says its connected just fine.
    Lastly my NI is 2005 and Labview is 8.0
    I am pretty novice in this equipment and technology.  So if there is any specific details that I need to add, please let me know and I will update the post to include such details.
    Solved!
    Go to Solution.

    RxTx,
    It looks like you might actually have too new of a version of VISA. Please see the following KnowlegdeBase article for more information about which version you require:
    http://digital.ni.com/public.nsf/allkb/E7C93038169B6E7686257847004B8B9C
    It looks like VISA 4.3 is the newest version you can have for your version of LabVIEW. 
    Let me know if that fixes the issue!
    Thanks,
    Joel C
    National Instruments

  • Cannot build the query or generate the report - BI4.0 Dashboard on WebService Error

    Hello All,
         I am trying to create a Dashboard with WebService connections in SAP BI4.0 SP04. While running the dashboard I am receiving the error, Cannot build the query or generate the report. I have already set the refresh parameter to TRUE (bound to an excel cell and I have tried with 1 also). Back end WebI Reports of the BIWS connections are created from BEx queries through BICS connection. I have two prompts to run the Web Service and the report. Please share your thoughts regarding this.
    Thanks and Regards,
      Debajyoti Dan

    Hi All,
        I have found the issue. The problem is coming only when I am receiving prompts from BEx query and trying to use them through dashboard. I replaced these BEx prompts with the same in WebI report. Then the entire functionality started working correctly from dashboard.
    But, this is only a work around and can not be applied at all times. So I have raised a message for the same to SAP. I will update the thread based on what I receive from SAP Support.

  • How to build sql query for view object at run time

    Hi,
    I have a LOV on my form that is created from a view object.
    View object is read-only and is created from a SQL query.
    SQL query consists of few input parameters and table joins.
    My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
    Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
    Thanks
    Srikanth Addanki

    As I understand you want to change the query at run time.
    If this is what you want, you can use setQuery Method then use executeQuery.
    http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_

  • Need help in building search query

    Guys ..
    Problem Description:
    I have a huge table that is indexed using CONTEXT.
    I want to write a search query that considers the following:
    1. number of keywords match
    2. takes care of spelling mistakes, synonyms and acronyms
    3. proximity - the keywords should not be too far of each other.
    e.g. I have this phrase: "Horizontal Stabilizer Trim Brake"
    I was thinking of writing a query like:
    SELECT SCORE(1) SCORE,
    TEXT text
    FROM MY_TABLE
    WHERE CONTAINS(TEXT, '(Horz | Horizontal) ACCUM (Stab | Stabilier) ACCUM Trim ACCUM (Brk | Break)', 1) >= 0
    ORDER BY SCORE DESC
    The results doesnt look satisfactory. I have not used "near" operator as i dont know how to use it.
    Please help me as I am very much new to Oracle Text.
    -G

    Well, I'm not going to write the function for you, but we can at least talk through a general strategy.
    A lot depends on how you help your users on the front end -- for example, if they're searching a technical document, you may want to return results that aren't perfect matches but you do want to make sure the user picks 'mandatory' and 'useful' keywords in a way that lets you figure out which ones are really important. On the other hand, if you're google and have to handle queries like 'horizontal stabilizer trim brake' and 'were Pete and Jenny in the break room' then you run the risk of spending too much time looking for interesting words, almost doing a full-text search on the query trying to derive meaning.
    So I'm going to presume that you have some control over what/how the users generate their searches so that finding keywords isn't the issue.
    The plan will be to parse the query a bit to find the interesting words, clean them up, and weigh their importance, then use transformed data to build the query template to score various combinations.
    So here's some pseudocode for the function:
    function parse_query(pQueryWords in clob) returns clob as
    begin
        generate_token_list (); -- split the query into a set of individual tokens/words
        for each token in token_list
            if it's a mandatory word then accumtokenlist := accumtokenlist || ' ' || token ||'*10' -- weigh the presence of the token strongly
            if it's a useful word then accumtokenlist := accumtokenlist || ' ' || token ||'*5' -- domain-specific words are also important
            if it's a stopword or reserved word, then do not add it to the list
            if it's not on my lists, then accumtokenlist := accumtokenlist || ' ' || token
                                         and normaltokenlist := normaltokenlist ||' ' || token
        end;
        --so now, we have two lists, one for NEAR and one for ACCUM
        now build the guts of the template
            querytemplate := querytemplate || '<seq> || normaltokenlist || '</seq>';
            querytemplate := querytemplate || '<seq> || replace (accumtokenlist, ' ',' ACCUM ') || '</seq>';
            querytemplate := querytemplate || '<seq>$' || replace(normaltokenlist,' ','$') || '</seq>';
            querytemplate := querytemplate || '<seq>? || replace(replace(accumtokenlist,' ',' ?'),' ', ' accum ') || </seq>';  -- first fuzzy the words, then accum
            querytemplate := querytemplate || '<seq>? || replace(replace(normaltokenlist,' ',' ?'),' ', ' near ') || </seq>';  -- first fuzzy the words, then near
        return querytemplate
    end;So, with a 'cooked' query text that is template-friendly, all we need to do is apply a template that is aware of your inputs:
    query_Template_string := '
    <query>
       <textquery lang="ENGLISH" grammar="CONTEXT"> horizontal stabilizer*5 trim brake*10
         <progression> '
    || parse_query('horizontal stabilizer trim brake')  ||
    '     </progression>
       </textquery>
      <score datatype="INTEGER" algorithm="COUNT"/>'
    </query>So that's an example of one approach.

  • How to build a query to join on two tables without mapping

    I did Automatic mapping by the workbench Directofield mapping with the table and java object.
    Wanted to build a simple join query by joining on the same field on both the tables.Not the sql query through the toplink using expression builder.
    Please help.............
    Spent one full day for this................

    Thanks Don for the reply,sorry to bug you,but i need help.....
    SELECT A.AGNCY_C,
         A.TYPE_C,
         A.RESN_C,
         A.S_TYPE_C,
         A.SUB_ID_C,
         A.RY_C
    FROM RATING A, REF B
    WHERE A.ID_C = B._ID_C
    AND A.ALPHA_C = B.ALPHA_C
    AND A.EFF_D >= B.MATURITY_D
    This is the real query i was talking about.I did mapping automatically through the workbench,generated java classes also throught the workbench.
    Now they don't want to execute the raw sql.They wanted to get all the RATING objects with the where condition.
    So how to build a query by using toplink.
    tried your example
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression creditRating = builder.getTable("RATING").getField("ID_C");
    Expression issue_ref = builder.getTable("REF").getField("ID_C");
    Expression join = creditRating.equal(issue_ref);
    I am getting java.lang.OutOfMemoryError
    error.
    I selected the option generate classes and descriptors
    from the tables (RATING,REF).,so it created the classes and dscriptors automatically.
    In Database script for the table RATING like this
    ALTER TABLE RATING ADD (
    CONSTRAINT RATING_F1 FOREIGN KEY (ID_C, ALPHA_C)
    REFERENCES REF (ID_C,ALPHA_C));
    I think when i generate descriptor automatically it is keeping this association.
    Please help me.........

  • How to build a query dynamically....

    hi...i want to build a query dynamically. i don't want to build query by using string buffer. i want to create it directly by using sql query itself.
    my situation is like this....i have four drop down list in a page. The user can search the things based on one or two or three or four selected values.
    how to build a query for this kind of situation....pls let me know.
    Edited by: success_shiva6mca on Mar 3, 2008 12:39 PM

    there are two problems with building sql directly.
    1. it allows sql injection
    2.it allows XSS
    google them and you will understand if you dont already.
    I will recoment catching the values and using preparedStatements

  • Again : I/O Assistant not installed correctly.

    I Run LV 8.6 and MAX 4.5 ( XP, SP3 , AMD64x2-6 GHz , 4 GB RAM, 3 TB HDD ).
    LV works perfectly.
    However, I stumble upon the very same problem of the past when trying to run the I-O Assistant express.vi ( " MAX or Instrument I/O Assistant not installed correctly. Install from LV Driver CD "),
    I installed the LV Driver CD ( the March 2008 1-2-3  version, this should work, it did in the past ).
    But at present no I/O Assistant shows up.
    Then I downloaded separately and installed the I/O-Assistant driver, but no success again.
    I recall from the past I encountered this very same problem, which was resolved in one way or another but I failed to document how.
    Help is appreciated.
    Solved!
    Go to Solution.

    Martijn,
     Do you have the VISA functions in your functions palette?
    Yes.
    Or are there none instrument IO functions available?
    They are
    Next we can check if the InstrIOAsst folder available in the vi.lib folder (national instruments\labview xx\vi.lib)
    Yes,  it says " InstrIOAsst " indeed, but this is not the " Instr Assist " express.vi from the Express>Input panel
    or is the instr folder available?
    Yes, i.e. " IO Assist " but when executing " I-O Assistant " it shows a peculiar " Instrument I/O Assistant Task " and not the wanted simple express " Instr Assist ".express vi
    If they are we can try to fix the driver through the windows control panel. If they are not; please run the installer again and double check if the Labview 8.5 API has been selected; you may also consider to use a newer driver; NI VISA 4.6 .
    I was puzzled and still am a bit, but WOW, as per your advice I deinstalled the NI-VISA 4.3 and downloaded and installed the 4.6 one and guess what ? It works.
    I wonder why the 4.3 obviously failed since it did do the job in the past.
    I wouldn't have raised myself the idea to reinstall the NI-VISA driver, so thanks.
    Kudos !
    Peter.

  • How to build a query to get the item properties is tick or not?

    hello everybody. i'm 1 of the sap b1 user. i face a problem in build a query to check one of the item properties is tick or not? pls help...

    Hi Grace,
    your query could look like this:
    Select itemcode from oitm where qrygroup1= "Y"
    qrygroup1 is item property 1, qrygroup2 is item property 2 etc.
    Regards
    Ad

  • Please can someone help me to build a query

    Please can someone help me to build a query for getting the following results. I work with Oracle 9.
    My data is about this:
    Projectid / Activitycode / Act.DS / Earlystart / ActualStart
    {color:#ff0000}P001 / 110M / blabla / 1-1-08 / 1-1-08{color}
    {color:#3366ff}P001 / 230M / fdsfds / 31-1-09 / null{color}
    P001 / 450M / fsfsd / 1-4-09 / null
    P002 / null / null / 1-12-08 / 1-12-08
    {color:#3366ff}P002 / 110M / nhggh / 5-2-09 / null{color}
    P002 / 750M / wdwdwd / 5-2-09 / null
    P002 / 210M / plplplp / 31-12-08 / 31-12-08
    {color:#ff0000}P002 / 550M / ewdwd / 5-1-09 / null{color}
    I'd like to get one row for each Projectid with the {color:#3366ff}first next Early- or Actualstart{color} {color:#3366ff}after today{color} and one row with the {color:#ff0000}latest early-/actualstart before today{color}. When there are two or more rows with the same date then I want the first (minimum) Activitycode. This last condition makes it insoluble for me!
    I've tryed SQL with nested Select-statements in the Where-clause. But I've got still 2 rows per projectid because I select the min(nvl(Earlystart ,ActualStart ) I've tryed SQL with an Select in the FROM-claus with Partion BY, but I can't get it work right.
    Can someone show me the right way to solve my problem?

    How's this?
    with my_tab as (select 'P001' projectid,
                           '110M' activitycode,
                           'blabla' act_ds,
                           to_date('01/01/2008', 'dd/mm/yyyy') earlystart,
                           to_date('01/01/2008', 'dd/mm/yyyy') actualstart
                    from   dual
                    union all
                    select 'P001' projectid,
                           '230M' activitycode,
                           'fdsfds' act_ds,
                           to_date('31/01/2009', 'dd/mm/yyyy') earlystart,
                           null actualstart
                    from   dual
                    union all
                    select 'P001' projectid,
                           '450M' activitycode,
                           'fsfsd' act_ds,
                           to_date('01/04/2009', 'dd/mm/yyyy') earlystart,
                           null actualstart
                    from   dual
                    union all
                    select 'P002' projectid,
                           null activitycode,
                           null act_ds,
                           to_date('01/12/2008', 'dd/mm/yyyy') earlystart,
                           to_date('01/12/2008', 'dd/mm/yyyy') actualstart
                    from   dual
                    union all
                    select 'P002' projectid,
                           '110M' activitycode,
                           'nhggh' act_ds,
                           to_date('05/02/2009', 'dd/mm/yyyy') earlystart,
                           null actualstart
                    from   dual
                    union all
                    select 'P002' projectid,
                           '750M' activitycode,
                           'wdwdwd' act_ds,
                           to_date('05/02/2009', 'dd/mm/yyyy') earlystart,
                           null actualstart
                    from   dual
                    union all
                    select 'P002' projectid,
                           '210M' activitycode,
                           'plplplp' act_ds,
                           to_date('31/12/2008', 'dd/mm/yyyy') earlystart,
                           to_date('31/12/2008', 'dd/mm/yyyy') actualstart
                    from   dual
                    union all
                    select 'P002' projectid,
                           '550M' activitycode,
                           'ewdwd' act_ds,
                           to_date('05/01/2009', 'dd/mm/yyyy') earlystart,
                           null actualstart
                    from   dual)
    -- above mimics your table; main query is below:
    select mt2.projectid,
           mt2.activitycode,
           mt2.act_ds,
           mt2.earlystart,
           mt2.actualstart
    from   (select mt.projectid,
                   mt.activitycode,
                   mt.act_ds,
                   mt.earlystart,
                   mt.actualstart,
                   mt.date_col,
                   mt.before_after_today,
                   row_number() over (partition by mt.projectid, mt.before_after_today
                                      order by mt.date_col asc) rn_after,
                   row_number() over (partition by mt.projectid, mt.before_after_today
                                      order by mt.date_col desc) rn_before
            from   (select projectid,
                           activitycode,
                           act_ds,
                           earlystart,
                           actualstart,
                           coalesce(actualstart, earlystart, to_date('01/01/4000', 'dd/mm/yyyy')) date_col,
                           case when coalesce(actualstart,
                                              earlystart,
                                              to_date('01/01/4000', 'dd/mm/yyyy')) <= trunc(sysdate) then 1
                                else 2
                           end before_after_today
                    from   my_tab) mt) mt2,
            (select 1 id, 1 col_id from dual union all
             select 1 id, 2 col_id from dual) dummy
    where  dummy.id = case when mt2.before_after_today = 1 then rn_before
                           else rn_after
                      end
    and    mt2.before_after_today = dummy.col_id
    PROJECTID     ACTIVITYCODE     ACT_DS     EARLYSTART     ACTUALSTART
    P001     110M     blabla     01/01/2008     01/01/2008
    P001     230M     fdsfds     31/01/2009     
    P002     550M     ewdwd     05/01/2009     
    P002     110M     nhggh     05/02/2009     

  • Correct Query For EJB

    I have such classes
    Entity bean
    @Entity(name = "Actor")
    @Table(name = "actor")
    public class Actor extends DomainObject{
        @Id
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "actor_id_seq")
        @Column(columnDefinition = "id")
        private Long id;   
        @Embedded
        @AttributeOverrides({
            @AttributeOverride(name="firstName", column=@Column(name = "firstname", nullable = false)),
            @AttributeOverride(name="lastName", column=@Column(name = "lastname", nullable = false))
        private PersonalInfo personalInfo;
       // getters and setters here
    }Here is an embedded class
    @Embeddable
    public class PersonalInfo {
        private String firstName;
        private String lastName;
        //getters and setters
    }And here is a stateless bean
    @Stateless
    @Remote(AccountService.class)
    public class AccountServiceBean implements AccountService {
        @PersistenceContext
        private EntityManager manager;
        public Actor findActorByFirstName(String firstName){
            Query q = manager.createQuery("SELECT actor FROM Actor actor WHERE actor.firstName = :firstName"); //!!!HERE
            q.setParameter("firstName", firstName);       
            return (Actor) q.getSingleResult();
    }Can anybody say, what is the reson why createQuery method doesn't work? Or maybe, somebody can help me with a correct query.
    I use Sun Application Server 9. In log i see such error
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: java.lang.NullPointerException
    java.lang.NullPointerException
         at com.sun.enterprise.util.EntityManagerWrapper.createQuery(EntityManagerWrapper.java:521)
         at net.sourceforge.openejforum.services.engine.ejb3.AccountServiceBean.findActorByFirstName(AccountServiceBean.java:40)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
    ...Thank you
    Message was edited by:
    awep

    You can try this in your query:
    Query q = manager.createQuery("SELECT actor FROM Actor actor WHERE actor.personalInfo.firstName = :firstName");
            q.setParameter("firstName", firstName);    I hope this can help you.

  • HT3275 I get this error Time Machine attempts a backup. The backup disk image "/Volumes/Data/Barbara's MacBook Pro.sparsebundle" is already in use."  Can anyone assist me in correcting the problem causing this?  Thanks.

    Time Machine fails with this error: "The backup disk image “/Volumes/Data/Barbara’s MacBook Pro.sparsebundle” is already in use." 
    Can anyone assist me in correcting the problem causing this?  Thanks.

    Reboot the TC.. Sometimes you need to reboot the whole network.
    This is what comes of Lion and then made worse in Mountain Lion of Apple not spending enough time to fix the bugs.
    Read C12 in pondini.
    http://pondini.org/TM/Troubleshooting.html
    C17 can be related I think.

  • What is correct query ?

    I have two tables: tmp and tmp1. the output should be, for each cno in tmp, its pno should be ALL in the tmp1. The correct output should be '1111'.
    I have written a query based on 1111, it works. But how could I extend to 2222, 3333 .... ? what is correct query ?
    Thanks.
    select * from tmp;
    CNO                    PNO                   
    1111                   10506                 
    1111                   10507                 
    1111                   10508                 
    1111                   10509                 
    2222                   10601                 
    2222                   10701                 
    3333                   10800                 
    3333                   10900                 
    8 rows selected
    select * from tmp1;
    PNO                   
    10506                 
    10507                 
    10508                 
    10509                 
    10701                 
    10800                 
    6 rows selected
    select * from tmp where
    cno = 1111
    and
    not EXISTS(select pno from tmp  where cno = 1111 minus select pno from tmp1)
    CNO                    PNO                   
    1111                   10506                 
    1111                   10507                 
    1111                   10508                 
    1111                   10509                 
    4 rows selectedEdited by: user533361 on Sep 27, 2009 1:47 PM

    with tmp as (
                 select 1111 cno,10506 pno from dual union all
                 select 1111,10507 from dual union all
                 select 1111,10508 from dual union all
                 select 1111,10509 from dual union all
                 select 2222,10601 from dual union all
                 select 2222,10701 from dual union all
                 select 3333,10800 from dual union all
                 select 3333,10900 from dual
        tmp1 as (
                 select 10506 pno from dual union all
                 select 10507 from dual union all
                 select 10508 from dual union all
                 select 10509 from dual union all
                 select 10701 from dual union all
                 select 10800 from dual
    select  cno
      from  tmp t1,
            tmp1 t2
      where t1.pno = t2.pno(+)
      group by cno
      having count(t1.pno) = count(t2.pno)
           CNO
          1111
    SQL> SY.

Maybe you are looking for

  • Returns Processing

    I already have done OTC cycle. Now i want to Run Returns Scenario. Please Give me suggestions what are the pre requisites to process RE. where I need to Tweak the system so that i can run RE. ALL IMG Activity including Answers will be Appriciated Reg

  • SOA Cluster: Managed Server startup issue

    Hi, I did the SOA clustering as follows: 10.111.122.133 – Admin Server and soa_server1 10.111.122.136 – soa_server2 Configured "soadomain" that contains Admin Server, soa_server1 and soa_server2. used pack and unpack to replicate domain structure in

  • Multiple nohup commands from same path

    I had a doubt which is very urgent as my live migration is going on. I had run the 2 import commands from $ORACLE_HOME/bin for importing 2 schemas like:- nohup imp JISPBILCORBILLINGPRD501/JISPBILCORBILLINGPRD501 fromuser=JISPBILCORBILLINGPRD501 touse

  • How to inject a POJO into an EJB

    This question relates to EJB 3.0 I have a POJO in a non-ejb jarfile that I want to inject into an EJB. Is this possible? If so, how do I go about making it work? Thanks, Dave.

  • I could not set Automatic SQL Tuning enabled

    Hi experts, I execute below command by sys user. BEGIN dbms_auto_task_admin.enable(client_name => 'sql tuning advisor', operation => NULL, window_name => NULL); END; It occur error: ORA-15604: Initialization parameters prevent client from being enabl