Problem with sql;query tag!  Please help ...

Dear all,
I have the following SQL statement submitted by a sql;query tag:
<c:out value='${namestring}'/> // <-- namestring is printed out as ABC-% here.
<sql:query var="resultset">
SELECT sales
FROM SALESTABLE
WHERE name LIKE <c:out value='${namestring}'/> //<-- appearently namestring is not ABC-% anymore!!!
</sql:query>
Everything is fine except the satement "WHERE name LIKE ?". The namestring passed in is supposed to be in the form 'ABC-%'. It indeed prints out as 'ABC-%' before the <sql:query/> tag.
Appearnetly, when it is passed to the statement "WHERE name LIKE ?", it becomes something else because it returns no data.
Note that when I hardcode 'ABC-%' to the WHERE statement, however, I do get a lot of data back.
I also tried to to use <sql:param/> tag to tackle it:
<sql:query var="resultset">
SELECT sales
FROM SALESTABLE
WHERE name LIKE ?
<sql:param value='${namestring}' />
</sql:query>
But still got no data. Is '%" considered as special characters that needs to be treated in a special way? What else do I need to do in order to pass in 'ABC-%' to the statement???
By the way, is there a way to print out the generated SQL statement to see how all the variables are evaluated?
Any help or suggestions will be highly appreciated. Thanks.
Robert.

Try to escape the special character '%' using '\%'.

Similar Messages

  • JSTL : problems with sql:query /forEach  tag

    I am not able to iterate thru the resultset provided by <sql:query> tag in JSTL. rowcount and columnName works, which means that query does produce a resultset. However, the <c:forEach> tag doesnt display the retrieved data. Code is approx like:
    c:catch var="e">
    <sql:query var="queryResults" >
    select * from emp
    </sql:query>
    </c:catch>
    <c:if test="${e!=null}">The caught exception is: ${e}
    ${queryResults.rowCount} <br>
    <c:forEach var="row" items="${queryResults.rows}">
    <tr>
    <td> <c:out value="${row.EMPNO}" /></td>
    </tr>
    </c:forEach>
    </table>
    Error thrown is :
    javax.servlet.ServletException: Unable to find a value for "EMPNO" in object of class "java.lang.String" using operator "."
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
         org.apache.jsp.jsp.sql.query_jsp._jspService(query_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    Pls. help!

    Thanks a lot all. My problem was solved by simply replacing the taglib directive
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    to
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    Cheers!

  • Problem with SQL Query

    I am a java developer and having problem writing a simple sql query. Any help is highly appreciated.
    USER_LOGIN
    CREATE TABLE USER_LOGIN
    EMAIL_ADDRESS VARCHAR2(30 BYTE) NOT NULL,
    PASSWORD VARCHAR2(30 BYTE) NOT NULL,
    LAST_NAME VARCHAR2(20 BYTE),
    FIRST_NAME VARCHAR2(20 BYTE),
    STATUS VARCHAR2(1 BYTE)
    DATA:
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, klein, james, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, cullen, sarah, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, cole, kling, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, stein, amy, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, stone, edward, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, simps, harris, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, brown, steven, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, kumar, vikram, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, gray, susan, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, green, monica, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, tile, eric, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, parder, sergey, 1);
    INSERT INTO USER_LOGIN (EMAIL_ADDRESS, PASSWORD, LAST_NAME, FIRST_NAME, STATUS) VALUES ( [email protected], UjBhZHJ1bm5lcg==, fossil, bill, 1);
    This is just the sample data. In production I have around 30,000 records and I have a requirement to retrieve the records in a batch of 5,000 at a time.
    For testing on the above 10 records, I need to retrieve 3 at a time.
    For instance: From my java servlet phase listener, I am going to run a loop, inside which I make a database call. For the first time inside the loop, it has to fetech records 1 to 3, the second time 4 to 6, the third time 7 to 9 and finally the last record. I will be able to pass two parameters for start and end row indexes.
    I have come up with the following query...
    SELECT U.EMAIL_ADDRESS,
    U.PASSWORD,
    U.LAST_NAME,
    U.FIRST_NAME,
    U.STATUS
    FROM USER_LOGIN U
    WHERE ROWNUM > /*start index*/ AND ROWNUM < /*end index*/
    ORDER BY EMAIL_ADDRESS
    But the results are not as expected. It works well for the first batch where start index is 0 and end index is 4, but it returns zero records when start index is 3 and end index is 7. Any help on this would be highly appreciated
    Thanks.

    Saludos Sirgeneral,
    This is one of the technique you should be working on
    SELECT * FROM(
    SELECT ROWNUM rn,e.* FROM emp e
    ORDER BY empno)
    WHERE rn BETWEEN &st_range AND &end_rangeIn your case the query would be
    select * from(
    SELECT rownum en, U.EMAIL_ADDRESS,
    U.PASSWORD,
    U.LAST_NAME,
    U.FIRST_NAME,
    U.STATUS
    FROM USER_LOGIN U
    ORDER BY EMAIL_ADDRESS)
    where rn between 4 and 6); --second set for exampleCheers!!!
    Bhushan

  • Firefox is having problems with "Southwest Airlines website" Please help soon

    Whenever I go on Southwest Airline website, it does not work. I am having this problem since last month. Please help on this as soon as you can.

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Other things that need your attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    * Shockwave Flash 10.0 r22
    * Java Plug-in 1.6.0_07 for Netscape Navigator (DLL Helper)
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://kb.mozillazine.org/Flash
    *http://www.adobe.com/software/flash/about/
    Update the [[Java]] plugin to the latest version.
    *http://kb.mozillazine.org/Java
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • Performance Problem with SQL Query

    Hi
    I have a SQL Query (say, SSS) which runs quite fast when I run it from TOAD.
    But when the same query is being used as
    INSERT INTO <table> VALUES <SSS>;
    It is taking hours to complete.
    The Original Query(OSQ) was changed to this SQL query(SSS) for Performance improvement.
    The Cost has also improved quite a lot from OSQ to SSS. But when SSS runs from inside a procedure it is taking the same long hours as OSQ used to take.
    Please help ASAP as it needs to get fixed.
    Thanks
    Arnab

    SELECT SRM.ID PROJECT_ID,
    SRM.UNIQUE_NAME PROJECT_CODE,
    ODFP.GS_FINANCE_PROJ_CODE,
    ODFP.GS_PRODUCT_CODE,
    ODFP.GS_CUSTOMER,
    ODFP.GS_LEGAL_ENT_REF,
    ODF_PRJ_TYPE.NAME GS_PROJ_TYPE,
    ODF_SRC_SYS.NAME GS_SOURCE_SYSTEM,
    RESM.FIRST_NAME||' '||RESM.LAST_NAME GS_PROJECT_MANAGER,
    ODFP.GS_LEG_PROJ_NUM,
    ODFP.GS_SUPP_DOC ,
    ODFP.GS_REQUEST_ID ,
    ODFP.GS_CONTRACT ,
    ODFP.GS_SIEBEL_REF,
    DECODE(budg.ODF_PARENT_ID,NULL,PRJP.bdgt_cst_total, budg.lab_budg)LAB_BDGT,
    DECODE(budg.ODF_PARENT_ID,NULL,0,budg.nli_budg)NLI_BDGT,
    (DECODE(budg.ODF_PARENT_ID,NULL,PRJP.bdgt_cst_total, budg.lab_budg))+(DECODE(budg.ODF_PARENT_ID,NULL,0,budg.nli_budg)) sum_lab_nonlab_budg,
    frct.LABOUR,
    frct.NON_LABOUR,
    frct.LABOUR+frct.NON_LABOUR FORCAST_TOT_SUM,
    gfr.code GFR_CODE,
    odfp.gs_rev_recognition,
    rev_rec.NAME gs_rev_recognition,
    DECODE(odfp.gs_prevent_reqtxn,1,'YES','0','NO','NO'),
    GS_PROGTYPE.NAME,
    COMM_APPR.UNIQUE_NAME COMM_APPROVER_EIN,
    COMM_APPR.FIRST_NAME||' '||COMM_APPR.LAST_NAME COMM_APPROVER_NAME,
    PR_APPR.UNIQUE_NAME PR_APPROVER_EIN,
    PR_APPR.FIRST_NAME||' '||PR_APPR.LAST_NAME PR_APPROVER_NAME,
    ODFP.GS_BILL_BUD,
    frct.FRCST_REVENUE TOTAL_FRC_REVENUE,
    actuals.LABOUR_ACTUALS,
    actuals.NL_ACTUALS,
    -- get_wip_totalcost(prjp.prid,'L') LABOUR_ACTUALS,
    -- get_wip_totalcost(prjp.prid,'M') NL_ACTUALS,
    ODFP.GS_ASS_PRODUCT_CODE,
    PROJ_TEMPLATE.ID GS_PROJ_TEMPLATE_ID,
    PROJ_TEMPLATE.UNIQUE_NAME GS_PROJ_TEMPLATE_CODE,
    PROJ_TEMPLATE.name GS_PROJ_TEMPLATE_NAME,
    DECODE( NVL(ODFP.GS_FIN_TEMPLATE,0) ,0,'NO',1,'YES') GS_FIN_TEMPLATE,
    ODF_PRJ_TYPE.LOOKUP_CODE GS_PROJ_TYPE
    FROM PROJECTS SRM,
    J_PROJECTS PRJP,
    A_PROJECT ODFP,
    RESOURCES RESM,
    s_gfr gfr,
    RESOURCES PROJ_ACCT,
    RESOURCES COMM_APPR,
    RESOURCES PR_APPR,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_PROJECT_TYPE'
    AND LOOKUP.ID =CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS') ODF_PRJ_TYPE,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_SOURCE_SYSTEM'
    AND LOOKUP.ID =CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS') ODF_SRC_SYS,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_PROG_TYPE'
    AND LOOKUP.ID =CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS')GS_PROGTYPE,
    (SELECT odf_parent_id
    ,SUM(gs_lab_budg) lab_budg
    ,SUM(gs_nl_budg) nli_budg
    FROM T_CHANGES
    WHERE gs_status='APPR'
    GROUP BY odf_parent_id) budg,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_REV_RECOGNITION'
    AND LOOKUP.ID = CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS') rev_rec,
    (SELECT FRCP1.project_id,
    NVL(SUM(CASE WHEN srmr.resource_type=0 THEN for_val.cost ELSE NULL END),0) AS LABOUR,
    NVL(SUM(CASE WHEN srmr.resource_type <> 0 THEN for_val.cost ELSE NULL END),0) AS NON_LABOUR,
    NVL(SUM(for_val.revenue),0) AS FRCST_REVENUE
    FROM T_PROPERTIES FRCP1,
    T_DETAILS FOR_DET,
    RESOURCES SRMR,
    T_VALUES FOR_VAL
    WHERE (FRCP1.project_id, revision) IN (SELECT project_id, MAX(revision)
    FROM T_PROPERTIES FRCP
    WHERE FRCP.status=2
    AND FRCP.PERIOD_TYPE='SEMI_MONTHLY'
    GROUP BY project_id)
    AND FRCP1.PERIOD_TYPE='SEMI_MONTHLY'
    AND FOR_DET.forecast_id=frcp1.id
    AND SRMR.id(+)=FOR_DET.detail_id
    AND FOR_VAL.currency_type='BILLING'
    AND FOR_VAL.forecast_details_id=FOR_DET.ID
    GROUP BY FRCP1.project_id) frct,
    (SELECT srmp.id
    ,NVL(SUM(CASE WHEN wip.transtype='L' THEN WIPVAL.TOTALCOST ELSE NULL END),0) AS LABOUR_ACTUALS
    ,NVL(SUM(CASE WHEN wip.transtype='M' THEN WIPVAL.TOTALCOST ELSE NULL END),0) AS NL_ACTUALS
    FROM A_WIP WIP
    ,om_periods biz
    ,P_VALUES WIPVAL
    ,PROJECTS SRMP
    ,A_PROJECT ODF
    WHERE biz.period_type ='SEMI_MONTHLY'
    AND TRUNC(wip.TRANSDATE) BETWEEN biz.start_date AND biz.end_date
    AND WIP.TRANSNO=WIPVAL.TRANSNO
    AND WIPVAL.CURRENCY_TYPE='BILLING'
    AND SRMP.UNIQUE_NAME=WIP.PROJECT_CODE
    AND SRMP.ID=ODF.ID
    AND UPPER(ODF.partition_code)='GLOBAL'
    AND UPPER(WIP.external_id) <> 'SPREADSHEET'
    GROUP BY srmp.id) actuals,
    RESOURCES BUD_HOLDER,
    PROJECTS PROJ_TEMPLATE
    WHERE SRM.ID = PRJP.PRID
    AND ODFP.ID=PRJP.PRID
    AND ODFP.PARTITION_CODE='GLOBAL'
    AND RESM.id(+)=prjp.manager_id
    AND ODFP.GS_PROJECT_TYPE = ODF_PRJ_TYPE.LOOKUP_CODE(+)
    AND ODFP.GS_SOURCE_SYSTEM = ODF_SRC_SYS.LOOKUP_CODE(+)
    AND ODFP.GS_prog_type = GS_PROGTYPE.LOOKUP_CODE(+)
    AND budg.odf_parent_id(+)=SRM.ID
    AND frct.project_id(+) = prjp.prid
    AND ODFP.gs_risk_gfr=gfr.code(+)
    AND ODFP.GS_REV_RECOGNITION=rev_rec.LOOKUP_CODE(+)
    AND ODFP.GS_PROJ_ACCT = PROJ_ACCT.ID(+)
    AND ODFP.GS_COMM_APPR = COMM_APPR.ID(+)
    AND ODFP.GS_PR_APPR = PR_APPR.ID(+)
    AND actuals.id(+) = prjp.prid -- Arnab
    AND ODFP.GS_BUDGET_HOLDER=BUD_HOLDER.ID(+)
    AND ODFP.GS_TEMPLATE_USED=PROJ_TEMPLATE.ID(+)
    The above is OSQ with cost 45000. ... takes 1-1.5 hours through Toad
    SELECT SRM.ID PROJECT_ID,
    SRM.UNIQUE_NAME PROJECT_CODE,
    ODFP.GS_FINANCE_PROJ_CODE,
    ODFP.GS_PRODUCT_CODE,
    ODFP.GS_CUSTOMER,
    ODFP.GS_LEGAL_ENT_REF,
    ODF_PRJ_TYPE.NAME GS_PROJ_TYPE,
    ODF_SRC_SYS.NAME GS_SOURCE_SYSTEM,
    RESM.FIRST_NAME||' '||RESM.LAST_NAME GS_PROJECT_MANAGER,
    ODFP.GS_LEG_PROJ_NUM,
    ODFP.GS_SUPP_DOC ,
    ODFP.GS_REQUEST_ID ,
    ODFP.GS_CONTRACT ,
    ODFP.GS_SIEBEL_REF,
    DECODE(budg.ODF_PARENT_ID,NULL,PRJP.bdgt_cst_total, budg.lab_budg)LAB_BDGT,
    DECODE(budg.ODF_PARENT_ID,NULL,0,budg.nli_budg)NLI_BDGT,
    (DECODE(budg.ODF_PARENT_ID,NULL,PRJP.bdgt_cst_total, budg.lab_budg))+(DECODE(budg.ODF_PARENT_ID,NULL,0,budg.nli_budg)) sum_lab_nonlab_budg,
    frct.LABOUR,
    frct.NON_LABOUR,
    frct.LABOUR+frct.NON_LABOUR FORCAST_TOT_SUM,
    gfr.code GFR_CODE,
    odfp.gs_rev_recognition,
    rev_rec.NAME gs_rev_recognition,
    DECODE(odfp.gs_prevent_reqtxn,1,'YES','0','NO','NO'),
    GS_PROGTYPE.NAME,
    COMM_APPR.UNIQUE_NAME COMM_APPROVER_EIN,
    COMM_APPR.FIRST_NAME||' '||COMM_APPR.LAST_NAME COMM_APPROVER_NAME,
    PR_APPR.UNIQUE_NAME PR_APPROVER_EIN,
    PR_APPR.FIRST_NAME||' '||PR_APPR.LAST_NAME PR_APPROVER_NAME,
    ODFP.GS_BILL_BUD,
    frct.FRCST_REVENUE TOTAL_FRC_REVENUE,
    -- actuals.LABOUR_ACTUALS, -- Arnab
    -- actuals.NL_ACTUALS, -- Arnab
    get_wip_totalcost(prjp.prid,'L') LABOUR_ACTUALS, -- Arnab
    get_wip_totalcost(prjp.prid,'M') NL_ACTUALS, -- Arnab
    ODFP.GS_ASS_PRODUCT_CODE,
    PROJ_TEMPLATE.ID GS_PROJ_TEMPLATE_ID,
    PROJ_TEMPLATE.UNIQUE_NAME GS_PROJ_TEMPLATE_CODE,
    PROJ_TEMPLATE.name GS_PROJ_TEMPLATE_NAME,
    DECODE( NVL(ODFP.GS_FIN_TEMPLATE,0) ,0,'NO',1,'YES') GS_FIN_TEMPLATE,
    ODF_PRJ_TYPE.LOOKUP_CODE GS_PROJ_TYPE
    FROM PROJECTS SRM,
    J_PROJECTS PRJP,
    A_PROJECT ODFP,
    RESOURCES RESM,
    s_gfr gfr,
    RESOURCES PROJ_ACCT,
    RESOURCES COMM_APPR,
    RESOURCES PR_APPR,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_PROJECT_TYPE'
    AND LOOKUP.ID =CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS') ODF_PRJ_TYPE,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_SOURCE_SYSTEM'
    AND LOOKUP.ID =CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS') ODF_SRC_SYS,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_PROG_TYPE'
    AND LOOKUP.ID =CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS')GS_PROGTYPE,
    (SELECT odf_parent_id
    ,SUM(gs_lab_budg) lab_budg
    ,SUM(gs_nl_budg) nli_budg
    FROM T_CHANGES
    WHERE gs_status='APPR'
    GROUP BY odf_parent_id) budg,
    (SELECT CAP.NAME
    ,LOOKUP.LOOKUP_CODE
    FROM S_NLS CAP,
    N_LOOKUPS LOOKUP
    WHERE LOOKUP_TYPE ='GS_REV_RECOGNITION'
    AND LOOKUP.ID = CAP.PK_ID
    AND CAP.LANGUAGE_CODE='en'
    AND CAP.TABLE_NAME = 'CMN_LOOKUPS') rev_rec,
    (SELECT FRCP1.project_id,
    NVL(SUM(CASE WHEN srmr.resource_type=0 THEN for_val.cost ELSE NULL END),0) AS LABOUR,
    NVL(SUM(CASE WHEN srmr.resource_type <> 0 THEN for_val.cost ELSE NULL END),0) AS NON_LABOUR,
    NVL(SUM(for_val.revenue),0) AS FRCST_REVENUE
    FROM T_PROPERTIES FRCP1,
    T_DETAILS FOR_DET,
    RESOURCES SRMR,
    T_VALUES FOR_VAL
    WHERE (FRCP1.project_id, revision) IN (SELECT project_id, MAX(revision)
    FROM T_PROPERTIES FRCP
    WHERE FRCP.status=2
    AND FRCP.PERIOD_TYPE='SEMI_MONTHLY'
    GROUP BY project_id)
    AND FRCP1.PERIOD_TYPE='SEMI_MONTHLY'
    AND FOR_DET.forecast_id=frcp1.id
    AND SRMR.id(+)=FOR_DET.detail_id
    AND FOR_VAL.currency_type='BILLING'
    AND FOR_VAL.forecast_details_id=FOR_DET.ID
    GROUP BY FRCP1.project_id) frct,
    /* (SELECT srmp.id
    ,NVL(SUM(CASE WHEN wip.transtype='L' THEN WIPVAL.TOTALCOST ELSE NULL END),0) AS LABOUR_ACTUALS
    ,NVL(SUM(CASE WHEN wip.transtype='M' THEN WIPVAL.TOTALCOST ELSE NULL END),0) AS NL_ACTUALS
    FROM A_WIP WIP
    ,om_periods biz
    ,P_VALUES WIPVAL
    ,PROJECTS SRMP
    ,A_PROJECT ODF
    WHERE biz.period_type ='SEMI_MONTHLY'
    AND TRUNC(wip.TRANSDATE) BETWEEN biz.start_date AND biz.end_date
    AND WIP.TRANSNO=WIPVAL.TRANSNO
    AND WIPVAL.CURRENCY_TYPE='BILLING'
    AND SRMP.UNIQUE_NAME=WIP.PROJECT_CODE
    AND SRMP.ID=ODF.ID
    AND UPPER(ODF.partition_code)='GLOBAL'
    AND UPPER(WIP.external_id) <> 'SPREADSHEET'
    GROUP BY srmp.id) actuals, */ -- Arnab
    RESOURCES BUD_HOLDER,
    PROJECTS PROJ_TEMPLATE
    WHERE SRM.ID = PRJP.PRID
    AND ODFP.ID=PRJP.PRID
    AND ODFP.PARTITION_CODE='GLOBAL'
    AND RESM.id(+)=prjp.manager_id
    AND ODFP.GS_PROJECT_TYPE = ODF_PRJ_TYPE.LOOKUP_CODE(+)
    AND ODFP.GS_SOURCE_SYSTEM = ODF_SRC_SYS.LOOKUP_CODE(+)
    AND ODFP.GS_prog_type = GS_PROGTYPE.LOOKUP_CODE(+)
    AND budg.odf_parent_id(+)=SRM.ID
    AND frct.project_id(+) = prjp.prid
    AND ODFP.gs_risk_gfr=gfr.code(+)
    AND ODFP.GS_REV_RECOGNITION=rev_rec.LOOKUP_CODE(+)
    AND ODFP.GS_PROJ_ACCT = PROJ_ACCT.ID(+)
    AND ODFP.GS_COMM_APPR = COMM_APPR.ID(+)
    AND ODFP.GS_PR_APPR = PR_APPR.ID(+)
    AND     actuals.id(+) = prjp.prid  Arnab
    AND ODFP.GS_BUDGET_HOLDER=BUD_HOLDER.ID(+)
    AND ODFP.GS_TEMPLATE_USED=PROJ_TEMPLATE.ID(+)
    This one in SSS where "-- Arnab " are only changes .....
    The cost of this 7000.....finishes in 1 - 1.5 min in Toad
    This is used as INSERT INTO TABLE <Select Query> ... this was taking 1.5 Hours to run.
    It was changed using BULK COLLECT - still its taking around 1.5 hours to run...
    Thanks
    Arnab

  • Problem with SQL Query Action

    Hi,
    I have a problem in using transactions with SQL Querys.
    I developed a TA based an SQL Querys against a MS SQL Server by using the jtds driver.
    After execution of the sql query I iterate through the result data by using the repeater action on the xMII XML results of the query. Using the jtds driver all table and field names are in lower case letters.
    Now I changed the data server to test it with oracle to an oracle database by using the oracle jdbc driver. The database and tables on both Oracle and MS are created with the same sql script.
    The oracle driver returns table and field names in only capital letters. So the created transaction can not be used. Because it for example accesses the node "type" in the XML structure which is fine for jtds. But when oracle is used, the node has the name "TYPE", so the TA tries to use node type but there is only node TYPE that causes the TA to run into an error.
    Anyone has an idea how to avoid / solve this problem?
    Regards
    Timo

    That's exactly what I used as solution now.
    Instead of doing
    "select fieldname from tablename"
    I do now
    "select fieldname as "fieldname" from tablename"
    So both in Oracle and Microsoft SQL Server the returned field names of the query are in lower case letters.
    Thank you for your help.
    Regards Timo

  • Problem with SQL query generated by setString

    Using Creator 2EA2 I have a rowset based on this query (it's actually only the last bit of it with the third parameter that is a problem):
    SELECT director.director_id,  director.name FROM director, director_last_modified WHERE name REGEXP '^[A-C]'  AND director_last_modified.dir_last_modified > ? AND director_last_modified.dir_last_modified <= ?  AND director.director_id = director_last_modified.director_id AND director_last_modified.dir_flagged = ? ORDER BY name; I use setObject to set the first and second parameters to a date. The third parameter refers to field in the database which indicates whether or not a director is 'flagged'. It's a TINYINT in a MySQL table and may contain either 0 or 1. If the user wants to see 'flagged' directors, I want to set the third parameter to 1. If they want to see all directors I want to set the third parameter to 0 OR 1.
    So I use setString with a String variable for the parameter:
    setString(3, strCriterion3);If strCriterion3 has been set as follows:
    strCriterion3 = "1";the generated SQL query ends with:
    director_last_modified.dir_flagged = '1' ORDER BY name; JDBC supplies the two apostrophes. So it would seem to follow that in order to produce a query which ends with:
    director_last_modified.dir_flagged = '1' OR '0' ORDER BY name;I shoud set strCriterion3 with:
    strCriterion3 = "1' OR '3";
    in order to get the required apostrophes.
    However, the generated query is then:
    director_last_modified.dir_flagged = '1\' OR '0\' ORDER BY name;How do I get rid of those backslashes? I've tried double apostrophes, by the way - that just gives me more backslashes.
    Thanks for any help you can offer.

    [Sorry, but I missed the parentheses from the query. It should end with:
    [code]AND (director_last_modified.dir_flagged = ?) ORDER BY name;
    - not that that makes any difference to the apostrophes problem.]
    I've just discovered a solution in this thread http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=56228
    So I've replaced = ? in the query with LIKE ?
    I then set strCriterion3 to either "1" or "%". That will do nicely, but it seems a bit of kludge and, under different circumstances, I'd still need to get rid of those pesky apostrophes. Any ideas?

  • Problem with SQL query region source containing OLAP clauses

    Hi team,
    I believe I found a bug when HTMLDB validates the SQL Query in a report region.
    My query includes an ORDER BY clause within a windowing function and HTMLDB refuses to accept the source owing to the presence of the ORDER BY and the column heading sort preference.
    Clearly the order-by in a window function has little to do with the column heading sort, but this error prevents me from updating the conditional display item in the page definition.
    Note also that the page was imported smoothly from the 1.5 version, so probably the region source is not checked at that time, but only when you update it "manually".
    So, in the end, if I don't change anything the page works because the sql query is assumed to be correct but unfortunately I need to change the condition and I cannot.
    The problem shows up in page 126 of app 21670, SQL query region.
    Bye,
    Flavio
    PS: may be I can work around this by using the pl/sql function returning the sql query.

    Flavio,
    We're aware of this problem. For now, your workaround is described in this thread:
    HTMLDB 1.6 and "order by" in analytic functions
    Sergio

  • Problem with adobe acrobat/reader - please help!

    Hello,
    My acrobat reader was fine and I was able to open the pdf files sent to me, then suddenly it just wouldn't open anything at all.  It went into open mode and just stayed there, and wouldn't let me close it.  Then I got a message saying "there is a problem with adobe acrobat/reader.  Please exit and try again".  I've done this lots of times and it still isn't working.
    I would be very grateful for any help or suggestions.  I have windows 7, and as I said its all been fine up until now.
    Thanks.
    mspryce.

    This is the Acrobat forum, not the Reader forum. You should check the reader forum. In the meantime, if you are not running AR9.3 or so, you should update. Prior versions before 9 are not designed for Win7 and that might be your issue -- you gave no indication of version.

  • Problem with Logic XS Key, PLEASE HELP

    I use my G4 Powerbook laptop for live. I am running most recent version of logic.
    What happens is that Logic will load up fine, but then for no apparent reason logic will come up with an error message saying that the logic key has been removed, but i have not touched it!! I then have to restart logic.
    PLease help i have to get this sorted ASAP cuz i have a gig tomorrow nite. Cheers guys

    Hmm, it does it on both USB ports? And you haven't noticed any problems with other USB gear on those ports?
    When the key is next not recognised by Logic, go into the system profiler and find your USB port that the XS key is on - the XS key will be labelled when it's functioning correctly. Is it still recognised by the computer, or has it gone completely?

  • Problem with simple drawing program - please help!

    Hi,
    I've only just started using Java and would appreciate some help with a drawing tool application I'm currently trying to write.
    The problem is that when the user clicks on a button at the bottom of the frame, they are then supposed to be able to produce a square or circle by simply clicking on the canvas.
    Unfortunately, this is not currently happening.
    Please help!
    The code for both classes is as follows:
    1. DrawToolFrame Class:
    import java.awt.*;
    import java.awt.event.*;
    public class DrawToolFrame extends Frame
    implements WindowListener
    DrawToolCanvas myCanvas;
    public DrawToolFrame()
    setTitle("Draw Tool Frame");
    addWindowListener(this);
    Button square, circle;
    Panel myPanel = new Panel();
    square = new Button("square"); square.setActionCommand("square");
    circle = new Button("circle"); circle.setActionCommand("circle");
    myPanel.add(square); myPanel.add(circle);
    add("South", myPanel);
    DrawToolCanvas myCanvas = new DrawToolCanvas();
    add("Center", myCanvas);
    square.addMouseListener(myCanvas);
    circle.addMouseListener(myCanvas);
    public void windowClosing(WindowEvent event) { System.exit(0); }
    public void windowOpened(WindowEvent event) {}
    public void windowIconified(WindowEvent event) {}
    public void windowDeiconified(WindowEvent event) {}
    public void windowClosed(WindowEvent event) {}
    public void windowActivated(WindowEvent event) {}
    public void windowDeactivated(WindowEvent event) {}
    2. DrawToolCanvas Class:
    import java.awt.*;
    import java.awt.event.*;
    public class DrawToolCanvas
    extends Canvas
    implements MouseListener, ActionListener {
    String drawType="square";
    Point lastClickPoint=null;
    public void drawComponent(Graphics g) {
    if (lastClickPoint==null) {
    g.drawString("Click canvas first",20,20);
    } else {
    if (drawType.equals("square")) {
    square(g);
    else if (drawType.equals("circle")) {
    circle(g);
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("square"))
    drawType="square";
    else if (event.getActionCommand().equals("circle"))
    drawType="circle";
    repaint();
    public void mouseReleased(MouseEvent e) {
    lastClickPoint=e.getPoint();
    public void square(Graphics g) {
    g.setColor(Color.red);
    g.fillRect(lastClickPoint.x, lastClickPoint.y, 40, 40);
    g.setColor(Color.black);
    public void circle(Graphics g) {
    g.setColor(Color.blue);
    g.fillOval(lastClickPoint.x, lastClickPoint.y, 40, 40);
    g.setColor(Color.black);
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) {}
    public void mousePressed(MouseEvent e) {}
    public void mouseClicked(MouseEvent e) {}
    Any help would be appreciated!

    Some of the problems:
    1) nothing calls drawComponent(Graphics g)
    2) Paint(Graphics g) has not been overriden
    3) myCanvas is declared twice: once as an instance variable to DrawToolFrame, and once local its constructor. Harmless but distracting.

  • Problem with Desktop Skype freezing, please help

    2 days ago, Dec. 23rd, I started up Skype as usual, but after about a minute, it froze, soon becoming "not responding". I opened Task Manager to try to end it manually, but Task Manager quickly became "not responding" as well, as did Chrome when I opened it when I tried to search for a solution. This had never happened before, and since has only happened when I am trying to use Skype for Desktop. I tried uninstalling and reinstalling multiple times, switching to an older version, and running an antivirus scan to see if a virus might be causing the problem, but none of this helped, and it still freezes itself along with all my other programs, forcing me to restart my computer if I want to be able to use it. I have been using Windows 8 Skype instead today, with no problems, but Skype for Desktop is more convenient for me, and I would very much appreciate it if someone would please help me.
    Also, I don't know if this might be related to the problem, but today I had Task Manager open before starting Skype for Desktop, hoping I could end it before it caused everything to freeze (I couldn't), I was able to see before it froze that Skype was using 100% of my Disk.
    Solved!
    Go to Solution.

    Please,  run the DirectX diagnostics tool.
    Go to Windows Start and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.

  • Weird problems with kt7 turbo (6330), PLEASE HELP!!

    I just this last week purchased an older kt7 turbo (6330) to upgrade my brother's computer. I am pairing this with an Athlon XP 1700 processor. After installing all the hardware and booting up the computer, I started getting various errors. Sometimes the screen would just flash all kinds of colors, sometimes it would say something about a bios check not detecting the a: drive followed by insistent beeping, sometimes it just wouldn't start at all. After much hassle, I finally got the newest bios installed from MSI that claimed to fix some stuff between this motherboard and an Athlon XP 1700. (I didn't at the time suspect this to be the true culprit) Finally on Sunday afternoon, after a cold start, it magically started up and I finally got Windows XP installed. I found some drivers on the reference CD that seemed to help some. But now, after about 5-10 minutes, depending on the software being used, the computer will just shut itself down after a 60 second warning message. When I try reseting it, I start getting all of those weird errors again. The only way to get the computer to start up normally again is to let it sit for about 10-15 minutes to cool down, and then cold start it. At which point it will work again for another 10-15 minutes and shut down again. I am getting SOOOOO tired of these MSI motherboards not working for me!! I think MSI has a personal problem with me. PLEASE help me!! By the way, I don't think it's power related, cause I just put in a brand new P4 certified 400Watt powersupply.

    Sounds like your heatsink on your CPU may not be seated correctly. Try pulling it, cleaning, reapplying compound, and reseating it.

  • Problem with SQL query pulling info out of a collection

    Here's my issue, I use a PL/SQL query to pull info from an XML file and put it in a collection. I then query the collection with a SQL statement to pull the info from the collection and put it into a table. I can see that the collection is being created properly, but then my SQL query is failing to pull the info out of the collection. Here's my PL/SQL query:
    declare
    l_clob clob;
    l_buffer varchar2(32767);
    l_url varchar2(4000);
    l_http_req utl_http.req;
    l_http_resp utl_http.resp;
    begin
    utl_http.set_proxy(apex_application.g_proxy_server, NULL);
    l_url := 'http://www.jobster.com/partnerfeeds/Servinity/Servinity.xml';
    l_http_req := utl_http.begin_request(l_url);
    l_http_resp := utl_http.get_response(l_http_req);
    dbms_lob.createtemporary( l_clob, FALSE );
    dbms_lob.open( l_clob, dbms_lob.lob_readwrite );
    begin
    loop
    utl_http.read_text(l_http_resp, l_buffer);
    dbms_lob.writeappend( l_clob, length(l_buffer), l_buffer );
    end loop;
    exception
    when others then
    if sqlcode <> -29266 then
    raise;
    end if;
    end;
    utl_http.end_response(l_http_resp);
    apex_collection.create_or_truncate_collection('JOB_RESPONSE');
    apex_collection.add_member(
    p_collection_name => 'JOB_RESPONSE',
    p_clob001 => l_clob );
    end;
    This part works fine because I can check the collection and see the info was put there properly. Here's the XML file (part of it at least):
    <?xml version="1.0" encoding="UTF-8" ?>
    <job-list xmlns="http://jobster.com/feed/1.3">
    <site>
    <name>Jobster</name>
    <url>http://www.jobster.com</url>
    </site>
    <job>
    <id>58117925</id>
    <key>51253677</key>
    <featurelevel>1</featurelevel>
    <title>
    And here's the SQL query which isn't pulling anything back:
    select extractValue(value(t),'/*/name') "Name",
    extractValue(value(t),'/*/url') "URL"
    from apex_collections c,
    table(xmlsequence(extract(xmltype.createxml(c.clob001),'/job-list/site'))) t
    where c.collection_name = 'JOB_RESPONSE'
    What am I missing? Thanks in advance!

    my mistake<br>
    take a look to the examples can be very<br> helpful...sometimes<br>
    <br>
    select anz,rueck<br>
    <br>
    from (select (case when exists(select ek_id<br>
    from bh_einkuenfte<br>
    where ek_vgid=:P51_VG_ID<br>
    and ek_artid = a.ea_id)<br>
    then 'anything'<br>
    else a.ea_bez end) anz,<br>
    a.ea_seite rueck <br>
    from bh_einkunftsarten a<br>
    where a.ea_nummer <= 70<br>
    order by a.ea_nummer)<br>

  • Problems with sql:setDataSource tags

    Hi guyz,
    I am a newbie tyring to print the records in jsp page by querying the MS Access database. I have already set the database and dsn is already set and it is correct. But when i try to use JSTL tags to connect to database i get this error:
    org.apache.jasper.JasperException: /pages/details.jsp(11,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    I am also attaching the code. Any help in this regard is appreciated.
    <%@ page import="java.util.*,com.examples.reg_dbbase.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <sql:setDataSource var="db1"
    driver="sun.jdbc.odbc.JdbcOdbcDriver"
    url="jdbc:odbc:java_access"
    user="" password=""/>
    <sql:query dataSource="${db1}" var="rs" >
    SELECT * FROM Employees1</sql:query>
    <c:forEach var="columnName" items="${rs.columnNames}">
        <th>
            <c:out value="${columnName}"/>
        </th>
    </c:forEach>
    <c:forEach var="row" items="${rs.rows}"> 
       <tr>   
           <c:forEach var="column" items="${row}">      
             <td><c:out value="${column.value}"/></td>   
           </c:forEach>
       </tr>
    </c:forEach>
    database name: db1
    type: MS Access
    table name: Employees1
    DSN name: java_access

    guyz,
    i found the answer myself. I was using the wrong URI in the JSP code(i had downloaded JSTL 1.1 but was using 1.0 URI)that i posted. I found this fix while i was surfing thru the others posts here. These forums really help a lot.
    1.0 = http://java.sun.com/jstl/core
    1.1 = http://java.sun.com/jsp/jstl/core

Maybe you are looking for

  • How can I allow other users on my macbook to view my iphoto library when th

    How can I allow other users on my macbook to view my iphoto library when they are logged in. I do not have a network, and the users (my family) all log in seperately when they use the computer. Does anyone know? Thank you.

  • My iPhone 4 is saying words when I am texting??

    Well I have had my iPhone 4 for a while and I noticed that last night when I was texting every once and a while in a females voice there would be some words like eff you and so on.. I was kinda shocked so I was woundering if anyone has had this probl

  • I insert my sd card into my New iMac and nothing happens?

    I bought a brand new iMac and when I insert my sd card w/adapter nothing happens.  I checked the preferences and on general and advanced the boxes are checked that external will appear.  Is this a hardware issue?

  • Unable to transform my object

    Hi All, When I create rectangle box and choose selection tool, I'm unable to transform my object. I can just move my object. I've also tried view bounding box option from View menu, but it haven't resolved my issue. Please help.

  • I would like to activate my adobe pro XI

    Hello, Sorry I can't speak english I don't understand what happens , i'm puzzled: I have installed adobe acrobat pro Xi win, I loaunched it,  I put the  serie's number win, i wanted to register and activate as they ask but  on my count Id adobe, no p