SQL statement in servlet giving error

Please let me know if I need to post this on a different forum, but I thought it was applicable to here.
First, let me preface this post by saying I've inserted hardcoded values at the DB (Oracle) level and it worked just fine, so most of the statement is sound. All the values inserted properly when testing it that way. Also, I've printed the SQL statement to the console and all looks ok there, too.
Out of this, I'm getting an error citing the following:
java.lang.ArrayIndexOutOfBoundsException
also occasionally getting the following error:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
In my servlet, I'm attempting the following:
prior to the insert statement, I'm retrieving the last row number to start the increment from as in:
Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rst = stmt.executeQuery("select CHANGE_CTRL_ID from CHANGE_CONTROL_USER order by CHANGE_CTRL_ID");
     rst.last();
     int lastRowNum = Integer.valueOf(rst.getString("CHANGE_CTRL_ID")).intValue();
     rst.close();
     stmt.close();
------------ then ------------------------------------------------
String preparedQuery = "INSERT ALL " +
"INTO CHANGE_CONTROL_USER " +
"(CHANGE_CTRL_ID,REQUESTOR_NAME,REQUESTOR_EMAIL,BUS_CONTACT,DEPT,LOCATION,PHONE_NUM,DATE_REQ," +
"BUSVP,VP_PHONE,VP_DATE,BRANCH,PRIORITY,OPS_MAN_CHG,OPS_MAN_PPCHAP,TRAIN_REQ," +
"EXIST_SYS_FLD_CHG,BUS_RULES_CHG,NEW_CODING,NEW_BUS_RULE,NEW_SYS_FIELD,REQ_TYPE_OTHER,REQ_OTHER_SPECIFY,IMPACT_RE_COLL," +
"IMPACT_DEF_LM,IMPACT_DEF_REC_NRE,IMPACT_AUDIT,IMPACT_PERS_COLL,IMPACT_DEF_FCL,IMPACT_BUS_TECH,IMPACT_LEGAL,IMPACT_PRIV_COLL," +
"IMPACT_DEF_BKRUP_RE,IMPACT_DEC_SUPT,IMPACT_RISK_MGT,IMPACT_DEF_REO,IMPACT_DEF_BKRUP_NRE,IMPACT_QUALSVCS,IMPACT_INTERNAL_CTRL,IMPACT_DEF_WKFL," +
"IMPACT_DEF_WKOUT,IMPACT_TRAIN_TPI,IMPACT_OTHER,IMPACT_DEF_MGT,IMPACT_DEF_TAX,IMPACT_VEND_MGT,IMPACT_DEF_CTRL,IMPACT_DEF_REC_RE," +
"IMPACT_BUS_ADMIN,IMPACT_OTHER_SPECIFY,CHANGE_IN_KPMG,CHANGE_IN_OTS,CHANGE_IN_NFR,CHANGE_IN_ARR,CHANGE_IN_BRR, CHANGE_IN_PROC_IMP," +
"CHANGE_IN_INT_CITI_POL,CHANGE_IN_OTHER,CHANGE_IN_OTHER_SPECIFY, CHANGE_INIT_DETAILS,REQ_INFO_DESCRIPT,REQ_INFO_EXPLAIN_CURRBUS,REQ_INFO_EXPLAIN_PROPOSED,REQ_BEN_PROP_BENEFIT,REQ_BEN_FIN_IMPLEMENT," +
"REQ_BEN_OPS_IMPLEMENT,YES_FORM,VULN_ASSESS, CBA_CHG, RISK_ACCEPT,MARSITEM, GCCRFP, APP_COMPL_QUES,CAP_EXPEND)" +
" VALUES (changecontrol_user_seq.nextval,?,?,?,?,?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?," + "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
+ "INTO CHANGE_CONTROL_ADMIN "
+ "(AID,CHANGE_CTRL_ID,ADMNAME,CLOSEDATE,ACTIVE)"
+ "VALUES (changecontrol_admin_seq.nextval, changecontrol_user_seq.currval,NULL, NULL, -1)"
+ "SELECT object_name AS REQUESTOR_NAME FROM all_objects where rownum <= 1;";     
also I've declared all the respective strings for the PreparedQuery statement.
If you need to see those, here they are:
PreparedStatement pstmt = connection.prepareStatement(preparedQuery);
               // stmt = connection.stmt("INSERT INTO RMIS_USER VALUES (?,?,?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?,?,?,to_date(?,'YYYY-MM-DD HH:MI:SS')");
          pstmt.setInt(1,++lastRowNum);
          pstmt.setString(2,reqName);
          pstmt.setString(3,reqemail);
          pstmt.setString(4,buscont);
          pstmt.setString(5,reqDept);
          pstmt.setString(6,reqLocale);
          pstmt.setString(7,phone_num);
          pstmt.setDate(8,dtreq);
          //pstmt.setCalendar(8,rtnow);
          pstmt.setString(9,busvp_email);
          pstmt.setString(10,vpphone);
          pstmt.setDate(11,dt);
          pstmt.setString(12,branch);
          pstmt.setString(13,priority);
          pstmt.setString(14,opsmanchg);
          pstmt.setString(15,opsmanppchap);
          pstmt.setString(16,train_req);
          pstmt.setString(17,reqexist_sys_fld_chg);
          pstmt.setString(18,reqbus_rules_chg);
          pstmt.setString(19,reqnew_coding);
          pstmt.setString(20,reqnewbus_rule );
          pstmt.setString(21,reqnew_sys_fld);
          pstmt.setString(22,reqother);
          pstmt.setString(23,req_other_specify);
          pstmt.setString(24,imp_recoll);
          pstmt.setString(25,imp_deflm);
          pstmt.setString(26,imp_defrecnre);
          pstmt.setString(27,imp_audit);
          pstmt.setString(28,imppers_coll);
          pstmt.setString(29,imp_deffcl);
          pstmt.setString(30,imp_bustech);
          pstmt.setString(31,imp_legal);
          pstmt.setString(32,imp_privcoll);
          pstmt.setString(33,imp_defbkre);
          pstmt.setString(34,imp_decsupt);
          pstmt.setString(35,imp_riskmgt);
          pstmt.setString(36,imp_defreo);
          pstmt.setString(37,imp_defbknre);
          pstmt.setString(38,imp_qualsvc);
          pstmt.setString(39,imp_intlctrl);
          pstmt.setString(40,imp_defwkfl);
          pstmt.setString(41,imp_defwkout);
          pstmt.setString(42,imp_trtpi);
          pstmt.setString(43,impact_other);
          pstmt.setString(44,imp_defmgt);
          pstmt.setString(45,imp_deftax);
          pstmt.setString(46,imp_vendmgt);
          pstmt.setString(47,imp_defctrl);
          pstmt.setString(48,imp_defrecre);
          pstmt.setString(49,imp_busadm);
          pstmt.setString(50,impact_other_specify);
          pstmt.setString(51,change_in_kpmg);
          pstmt.setString(52,change_in_ots);
          pstmt.setString(53,change_in_nfr);
          pstmt.setString(54,change_in_arr);
          pstmt.setString(55,change_in_brr);
          pstmt.setString(56,change_in_proc_imp);
          pstmt.setString(57,change_inter_citpol);
          pstmt.setString(58,change_in_other);
          pstmt.setString(59,change_in_other_specify);
          pstmt.setString(60,change_init_details);
          pstmt.setString(61,req_info_descript);
          pstmt.setString(62,req_info_explain_currbus);
          pstmt.setString63,req_info_explain_proposed);
          pstmt.setString(64,req_ben_prop_benefit);
          pstmt.setString(65,req_ben_fin_implement);
          pstmt.setString(66,req_ben_ops_implement);
          pstmt.setString(67,projyes);
          pstmt.setString(68,vulnass);
          pstmt.setString(69,cbachg);
          pstmt.setString(70,riskacc);
          pstmt.setString(71,marsitem);
          pstmt.setString(72,gccrfp);
          pstmt.setString(73,applcomp);
          pstmt.setString(74,capexpend);
          pstmt.executeUpdate();
if anyone sees anything flawed here, please let me know!
Thanks!
Message was edited by:
bpropes20
Message was edited by:
bpropes20
Message was edited by:
bpropes20

What a mess. First off, the line pstmt.setInt(1,++lastRowNum); just needs to go away. You're already using a sequence to set the value for the primary keys, you don't need to add a mistake like this.
I then count 73 question marks (you can verify, I'm not counting again.) That would mean that your indices are off by one, and the ArrayIndexOutOfBounds is probably coming from pstmt.setString(74,capexpend); Dump the ++lastRowNum line, change all of your indices (after verifying the bind count!) and try it again.
You can see an inherent weakness in the PreparedStatement clauses - one change means manually rewriting all of the indices. A solution is dumping all of your bind values into a List, then loop through the list to do your setXXX statements. If all binds are not of the same type, you can bind the values to some object that identifies type and use those objects in the list instead of the values. A little more complex, but easier to maintain in my opinion.

Similar Messages

  • Adding a field to an sql statement in Oracle Reports error ORA-00933

    We have been requested to add a field that already exists in the table referred to by the sql statement in Oracle Reports Builder. The report was set up by a consultant about 3 yrs ago and we don't really have much skill in this area. What is happening when I try to modify the SQL statement, either adding a field or deleting a field to the SELECT statement, causes an error message preventing the statement from being saved. The only way out of the error message is to click Cancel. The error message is
    ORA-00933:SQL command not properly ended
    ORDER BY Program ==> NAME
    Even adding or deleting a space anywhere in the SQL statement causes the error (not adding any new fields). A coworker found that if we comment out the ORDER BY, the statement will accept the new field in the SELECT section, however then we lose the order by functionality. I would like to add one additional field before the FROM. Not sure if any additional data are needed. Thank you.
    SELECT p.person_uid PIDM_KEY, p.id_number ID,
                   p.full_name_lfmi name,            
                    p.BIRTH_DATE, p.GENDER Sex,
                    Decode(a.residency,'D',p.Primary_ethnicity,'F')  Ethn,
                    a.academic_period TERM,        
                    CASE WHEN :p_group_by = 'PROGRAM' THEN a.program
                                 ELSE ' '
                    END AS Program,
                    a.COLLEGE, a.degree, a.major, ' ' rule,
                    a.STUDENT_POPULATION,a.STUDENT_LEVEL,    a.application_status Status,  a.application_status_date app_sts_dte,
                    ad.decision_date1 Last_Dec_Date,
                    ad.decision1||' '||ad.decision2||' '|| ad.decision3||' '|| ad.decision4||' '|| ad.decision5 Decisions,
                    /*  Deposit Date uses the last term entered in :p_term parameter string */
                    (SELECT MAX(deposit_effective_date) FROM usf_as_deposit WHERE account_uid = a.person_uid &term_clause group by account_uid)   AS "DEPOSIT DATE",     
                    ph.phone as PHONE,
                    CASE WHEN PS.FIRST_CONTACT IN ('NET','PAP','COM','COP') THEN PS.First_Contact
                     ELSE CASE WHEN ps.latest_contact IN ('NET','PAP','COM','COP') THEN PS.Latest_Contact
                                ELSE '  '
                                END
                    END AS FIRST_CONTACT,
                    DECODE(:p_address,'Y',REPLACE(adr.street1||' '||adr.street2||' '||adr.street3||' '||adr.city||','||adr.state||' '||adr.nation||' '||adr.zip,'  ',' '),' ') as  address, adr.nation, adr.state,
                    goremal_email_address email, a.residency, a.application_date, p.primary_ethnicity, c.cohort
    FROM MST_ADMISSIONS_APPLICATION A,
               MST_PERSON p,mst_pre_student PS,  Admissions_Cohort c, usf_v_phone_pr_ma ph,
               MST_admissions_decision_slot AD, usf_v_email, usf_v_address_dr_lr_ma_pr adr
    WHERE a.PERSON_UID = p.person_uid
            AND a.curriculum_priority  = 1
            AND a.person_uid = ps.person_uid
           AND a.person_uid = ad.person_Uid(+)
           AND a.person_uid = goremal_pidm(+)
           AND a.person_uid = adr.pidm(+)
           AND a.person_uid = ph.pidm(+)
           AND ph.rnum(+) = 1
           AND a.person_uid = c.person_uid(+)
           AND a.academic_period = c.academic_period(+)
      &Where_Clause
           /*    TAKE OUT FOLLOWING LINE AFTER DATA IS CLEANED UP  */
            AND NOT(p.id_number = '00000000'   OR SUBSTR(p.id_number,1,1) = 'B'  OR UPPER(p.full_name_lfmi)  LIKE '%TESTING%')
           AND  a.application_status_date >= NVL(:p_as_of_date,sysdate-8000)
           AND a.academic_period = ad.academic_period(+)
            AND a.application_number = ad.application_number(+)
            AND a.degree <> 'ND'    /*   AND a.college <> 'LW'                         --  Does not need non-degree and law students    */
           &Cohort_Clause 
    ORDER BY Program  &ORDER_CLAUSE

    Hi Denis,
    I tried your suggestion. The good thing is that adding the comma allowed me to be able to add a.campus to the select statement, unfortunately, another error message happened.
    ORA-00936: missing expression SELECT p . person_uid PIDM_KEY ,
    p . id_number , p . full_name_lfmi name , p . BIRTH_DATE , p . GENDER Sex ,
    Decode ( a . residency , 'D' , p . Primary_Ethnicity , 'F' ) Ethn , a . academic_period TERM ,
    CASE WHEN : P_group_by = 'PROGRAM THEN a I started over and tried only putting in the comma and get the same message even though I didn't add campus. After that, removed the comma which led to the ORA-00933 error message. So once again, I had to close the file without saving, in order for the report to run at all.

  • SQL statement in servlet

    public synchronized Product GetProductItem (int productid) throws CategoryException
        Statement stmt  = null;
          stmt = conn.createStatement();
          ResultSet rs = stmt.executeQuery("select c.CategoryName, p.ProductName from category_product cp inner join category c on cp.CategoryID = c.CategoryID inner join product p on cp.ProductID = ?");
            Product p = new Product();
            p.setCategoryName(rs.getString("CategoryName"));
         p.setProductName(rs.getString("ProductName"));
      }How can I make the SQL statement to get the int parameter productid? As I want to show the particular product with it's own id.
    And, how can I display the product detail for that product? How can I show it as an object?

    I don't think your code will work. Don't you have to call next() on the ResultSet to advance the cursor to the first row? What if your query returns more than one row?
    In either case, I think your code should look more like this:
    ResultSet rs = ...;
    List products = new ArrayList();  // Or something else
    while (rs.next())
       Product p = new Product();
       // Set the values from the ResultSet
       products.add(p);
    rs.close();
    statement.close();Once you've got those, you can either pass Product to a JSP and have it display the values or you can write the HTML response to the browser from the servlet. I'd go with JSP myself. - MOD

  • Error in SQL Statement (ODS data loading Error)

    Hello Gurus...
    I am trying to loading the data Info Source To ODS in my ODS Key Figure Z_IVQUA (Invoice Quantity)
    is getting the Error Message Data shows 0 from 0 Records.
    I was Remove the Key Field from ODS Then try to load the data but i am getting same Error..
    Error in SQL Statement: SAPSQL_INVALID_FIELDNAME F~/BIC/Z_INVQUA
    Errors in source system
    Please Suggest....
    Thanks
    Prakash

    Hello All...
    Really appreciate if you can give me some advise. Thanks.
    Prakash
    Edited by: Prakash M on Jan 14, 2009 2:14 PM

  • Defaulting DFF Segment Value using sql statement in SSHR gives error when using parameter

    Dear All,
    i am having an issue that i am making one segment in DFF (SEGMENT3) being defaulted by using sql statement
    Select MAX(SEGMENT7) FROM PER_ANALYSIS_CRITERIA cri, PER_PERSON_ANALYSES ana where cri.Analysis_Criteria_id = ana.ANALYSIS_CRITERIA_ID and ana.PERSON_ID = :ANALYSES.PERSON_ID
    The Above Select Statement is working fine on the PUI form and getting the Default value correctly but when opening the SSHR page that contain this DFF, it  gives me the below error.
    "No field listener is registered to resolve field ANALYSES.PERSON_ID referenced by the flexfield with application short name PER and name PEA. Please contact your system administrator. "
    Any Help Please???

    Please see the following docs.
    Cannot Add Salary:No Field Listener is Registered to Resolve Field Review.assignment_id (Doc ID 558295.1)
    No Field Listener Is Registered To Resolve Field Assgt.Effective_start_date (Doc ID 889794.1)
    List of Current Enhancement Requests (ER) for Oracle EBS Self Service Human Resource (SSHR) (Doc ID 1381936.1)
    No field listener is registered to resolve field xxx.xxx referenced by the flexfield with application short name ASO... (Doc ID 1359270.1)
    Customer Form, Address Error: No field listener is registered to resolve field GLOB.FLEX_COUNTRY_CODE referenced by the flexfield with application short name AR (Doc ID 1276934.1)
    DFF issue : No Field Listener Is Registered To Resolve Field XXX Referenced By The Flexfield (Doc ID 555589.1)
    Thanks,
    Hussein

  • Executing the SQL statement is not allowed - Error

    I am getting "Executing the SQL statement is not allowed" for an INSERT cfquery that I'm running.  I checked the usual suspects:
    - DSN allows INSERT
    - I've seen reports online where certain field names or values are considered key words, so for protection CF blocks the query in this way (it would be nice if there was a different error message when it gets blocked this way vs. the DSN doesn't allow INSERT error message).  The field names and values were all benign strings, so it didn't seem like that.
    I took the same string for the query and ran it on another page and it ran fine (same DSN, too).

    SOLVED: I decided to enter this in here, just to get it into web searches for others since I couldn't find anything.
    - I was calling a function for one of the values in the query:  get_db_status_code("initialize")  Apparently CF parses the query to see if it's allowed BEFORE it runs the CFML in it, so something in that function name, or the parameter "initialize" was a key word that CF doesn't allow.  I moved the function call outside of the query and loaded a temp variable for use in the query and it then worked.

  • Problem w/ portion of SQL statement in servlet

    Hi folks,
    Don't know if this was one that should go under JDBC, but it's not so much of a connection problem as it is returning -- or not in this case -- a small result set I'm trying to make.
    I've got an INSERT statement up above this code that handles all of the data input from a form, but what I'm trying to accomplish is verification of the nextval ID into the Oracle db. By the way, this is nothing I'll keep in the servlet long term, just to test and then see what way's best to pass that thru an email with a link to an approval page.
    So at the end of the insert statement, I've got these lines:
    Statement stmto = connection.createStatement();
    ResultSet rsltst = stmto.executeQuery("SELECT MAX(CHANGE_CTRL_ID) FROM CHANGE_CONTROL_USER");
    String chgid= rsltst.getString(1);
    System.out.println("Change ID is" +chgid);
                I get an invalid cursor error from this. Any idea why?
    Any feedback would be appreciated.
    Thanks.
    Message was edited by:
    bpropes20

    Statement stmto = connection.createStatement();
    ResultSet rsltst = stmto.executeQuery("SELECT MAX(CHANGE_CTRL_ID) FROM CHANGE_CONTROL_USER");
    if (rsltst.next()) {
        String chgid= rsltst.getString(1);
        System.out.println("Change ID is" +chgid);
    } else
       System.out.println("No value!");BTW: Check if oracle (I've never worked with these DBM) has any function to retrieve the generated ID, it will be a bit more acurated ;)
    null

  • Broken pipe / timeout during slow SQL statement in servlet

    I have a servlet which supplies the client with quite a large block of data from an SQL query.
    This works fine in a local test environment but I get problems running it under a fully fledged application server environment.
    I find a "Broken Pipe" exception on the application log and the client side application gets an application error status code.
    07/07/16 09:32:30.85 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.85 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.85 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.85 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.85 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.85 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.86 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.86 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.86 lapSycWebsite: Broken pipe
    07/07/16 09:32:30.86 lapSycWebsite: Servlet error
    java.io.IOException: Broken pipe
    at sun.nio.ch.FileDispatcher.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
    at sun.nio.ch.IOUtil.write(IOUtil.java:75)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
    at java.nio.channels.Channels.write(Channels.java:60)
    at java.nio.channels.Channels.access$000(Channels.java:47)
    at java.nio.channels.Channels$1.write(Channels.java:134)
    at com.evermind.server.http.AJPOutputStream.endRequest(AJPOutputStream.j
    ava:117)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java
    :309)
    at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java
    :190)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSo
    cketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    :q
    We're looking for ways to get the SQL execution time down, but even if we succeed in this case it's a source of instability that will trip us up in the future.
    This SQL statment can take up to about 8 minutes to return the first row.
    The client is a Java swing program, by the way, not a browser as such.
    Later:
    We've got the SQL execution time down and it's working for the time being but it's a problem that's going to hit us again sooner or later. Still looking for a solution.
    Message was edited by:
    IronChicken

    Refer this url for inserting blob datatype to database.
    See the LOBDatatype sample. This sample uses java application but same works for a servlet too.
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
    You can refer source to see how the lob data is inserted.
    Chandar

  • Select SQL statement with variable syntax error

    Hi All,
    I am running a Web Application with a java bean to connect to a mysql database. i have compiled a test .java file whcih works using the same statement that has a problem in my web application. Taking the statement out of the Web App makes it work so it must be this stetment:
    String SQLStatement = "SELECT * FROM MASTER WHERE USERNAME LIKE '"+data+"' ";
    This works fine in testing a separate java file, but it does not compile when running ant build to compile the same line of code for my Web App.
    I have tried many possibilities of changing the syntax to no avail, its a puzzle!
    Many thanks for any swift reply.
    ChrisG

    prepare:
    copy:
    build:
    [javac] Compiling 1 source file to C:\jwsdp-1.3\garland\build\WEB-INF\classe
    s
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:20: cannot resolve symbol
    [javac] symbol : variable data
    [javac] location: class logonApp.LogonBean
    [javac] String SQLState2 = "SELECT PASSWORD FROM MASTER WHERE PASSWORD L
    IKE '"+data+"' ";
    [javac]
    ^
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:79: cannot resolve symbol
    [javac] symbol : variable SQLState1
    [javac] location: class logonApp.LogonBean
    [javac] rs = stmt.executeQuery(SQLState1);
    [javac] ^
    [javac] 2 errors
    Thats the compiler error, but it still works on a normal java file. ill try a prepared statement in the mean time.
    ChrisG

  • SQL statement gives a strange error

    Hey!
    We are running Oracle Database 10.2.0.2 x86_64 on SLES9
    The statment is:
    select distinct
    p.PRIO_REF_NUM as "Prioriteet",
    m.CODE as "Meede",
    p.project_number as "Proj. nr.",
    p.alternative_number as "Alternat. nr.",
    p.project_name as "Proj. nimi",
    i.type as "Ind. tüüp",
    pi.indi_level as "Ind. level",
    i.code as "Ind. kood",
    i.name as "Ind. nimi",
    pi.value_before as "Algväärtus",
    pi.target_value as "Sihtmäär (arv)",
    ( select dv.text
    from domain_value dv
    where dv.DOMA_TYPE_CODE = i.CHOICE_DOMAIN
    and dv.VALUE_CODE = pi.selected_choice
    ) as "Sihtmäär (tekst)",
    ( select avg( ip.CUMULATIVE_VALUE )
    keep ( dense_rank first order by ip.report_date desc )
    from PROJECT_INDICATOR_PROGRESS ip
    where ip.PROJECT_INDICATOR_REF_NUM = pi.REF_NUM
    -- väärtus raporteeritud enne kindlat kuupäeva
    --AND ip.report_date <= to_date('15.10.2005', 'dd.mm.yyyy')
    ) as "Saavutusmäär",
    ( select ps.status_code
    from project_status ps
    where
    ps.ref_num = (
    select max(ps2.ref_num)
    from project_status ps2
    where ps2.project_ref_num = p.ref_num
    and ps.project_ref_num = p.ref_num
    ) as "Projekti staatus"
    from project p,
    project_indicator pi,
    indicator i
    ,measure m
    ,project_status ps
    where p.ref_num = pi.PROJECT_REF_NUM
    and i.ref_num = pi.INDICATOR_REF_NUM
    AND m.REF_NUM = p.MEAS_REF_NUM
    AND ps.PROJECT_REF_NUM = p.REF_NUM
    AND ps.STATUS_CODE in ('ACCEPTED', 'FINISHED')
    order by p.PRIO_REF_NUM, m.CODE, i.code;
    And the error is ORA-03113: end-of-file on communication channel
    Looked into alert log
    ORA-07445: exception encountered: core dump [_intel_fast_memcpy.A()+10] [SIGSEGV] [Address not mapped to object] [0x2A97A67000] [] []
    Searched metalink and google, but no help.
    Any idea?

    This is likely an Oracle bug. You should contact Oracle support for this kind of errors.

  • DATAEXPORT to sql server is giving error

    Hi,
    I am using DATAEXPORT to export data to SQL tables but its giving error:
    MY TABLE:
    USE SBC;
    Create table TEST
         Period nchar(20),
         HSP_Rates nchar(20),
         Years nchar(10),
         Currency nchar(5),
         Scenario nchar(20),
         ICP nchar(20),
         [Co.] nchar(20),
         Version nchar(20),
         Product nchar(20),
         Entity nchar(30),
    Account nchar(50),
         Data numeric(18, 5)
    Created this order based on export taken on file
    **My Script:**
    SET DATAEXPORTOPTIONS
         DataExportLevel "ALL";
         DATAEXPORTCOLFORMAT ON;
         DataExportOverwriteFile ON;
         DataExportDecimal 4;
    DATAEXPORTCOND ("HSP_InputValue" <> #MISSING And "HSP_InputValue" <> 0);
    FIX (@REMOVE(@RELATIVE ("Balance_Sheet",0),"CY_Earnings"),"Per7","HSP_InputValue","FY12","Local","MY12 Budget", @RELATIVE ("ICP Top",0),@RELATIVE ("Co Total",0),Working,@RELATIVE (PODS,0),@RELATIVE ("Entity",0));
    /*DATAEXPORT "File" "," "D:\Test.txt"*/
    DATAEXPORT "DSN" "TEST" "Test" "admin" "XXXXXX";
    ENDFIX;
    Output when exported to File:
    "Per7"
    "HSP_InputValue","FY12","Local","MY12 Budget","No IC","Co 100","Working","ALLEZ","100-1050","Subs_Cash",500000.046
    "HSP_InputValue","FY12","Local","MY12 Budget","No IC","Co 100","Working","AirFreight","100-1050","Subs_Cash",534324.370
    ERROR IN LOGS:
    [Fri Feb 03 01:10:20 2012]Local/SBC///15796/Info(1013210)
    User [admin@Native Directory] set active on database [SBC]
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1013091)
    Received Command [Calculate] from user [admin@Native Directory]
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1013167)
    Received Command [Calculate] from user [admin@Native Directory] using [Test.csc]
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1021004)
    Connection String is generated
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1021041)
    Connection String is [DSN=SBC;UID=...;PWD=...;]
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1021000)
    Connection With SQL Database Server is Established
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1021013)
    ODBC Layer Error: [21S01] ==> [[Microsoft][ODBC SQL Server Driver][SQL Server]Column name or number of supplied values does not match table definition.]
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1021014)
    ODBC Layer Error: Native Error code [213]
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Error(1012085)
    Unable to export data to SQL table [Test]. Check the Essbase server log and the system console to determine the cause of the problem.
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1021002)
    SQL Connection is Freed
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Warning(1080014)
    Transaction [ 0xb0006( 0x4f2b885c.0xd4e40 ) ] aborted due to status [1012085].
    [Fri Feb 03 01:10:20 2012]Local/SBC/SBC/admin@Native Directory/2208/Info(1012579)
    Total Calc Elapsed Time for [Test.csc] : [0.022] seconds
    I have tried using SQL Drivers for ODBC connection as well as Wire protocol driver.
    Please assist asap.
    Regards,
    Vinit

    Chawla,
    Fixed in 9.3.3, Check out this, their are few more bugs fixed related to DataExport.
    http://docs.oracle.com/cd/E10530_01/doc/epm.931/esb_93300_readme.pdf
    8404516 Calculator.The DATAEXPORTCOND calculation command clashes with the FIX
    command.
    8913164 Calculator. Data exports that use DATAEXPORTCOND do not always export all
    the data expected because not all conditions are taken into account within the
    DATAEXPORTCOND statement
    8988310 Calculator. When exporting data using the DATAEXPORT command from a
    duplicate outline that contains a shared hierarchy, the exported data contains the
    shared member, not the prototype Etc..
    Cheers...!!
    Rahul S.

  • SQL Statement Error on DB2

    Hi there!!!!, maybe somebody can help me with this.
    We configure a connection Pool to get access to DB2 DataBase, When WLS Starts
    the pool starts well, but when we try to make a SQL statement it sends an error
    to the output browser.
    It's important to say that the same thing it works well with Sybase instead.
    An Exception occurred:
    COM.ibm.db2.jdbc.net.DB2Exception: [IBM][JDBC Driver] CLI0601E Invalid statement
    handle or statement is closed. SQLSTATE=S1000
    at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:340)
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:180)
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:188)
    at COM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:372)
    at COM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:358)
    at weblogic.jdbc.pool.Connection.createStatement(Connection.java:40)
    at examples.jdbc.pool.simpleselect.service(simpleselect.java:109)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Thanks & Regards

    Hi Mauricio,
    Which version of Weblogic do you use?
    Regards,
    Slava Imeshev
    "Mauricio Del Moral" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi there!!!!, maybe somebody can help me with this.
    We configure a connection Pool to get access to DB2 DataBase, When WLSStarts
    the pool starts well, but when we try to make a SQL statement it sends anerror
    to the output browser.
    It's important to say that the same thing it works well with Sybaseinstead.
    >
    >
    An Exception occurred:
    COM.ibm.db2.jdbc.net.DB2Exception: [IBM][JDBC Driver] CLI0601E Invalidstatement
    handle or statement is closed. SQLSTATE=S1000
    atCOM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGen
    erator.java:340)
    >
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:180)
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:188)
    atCOM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:372)
    >
    atCOM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:358)
    >
    atweblogic.jdbc.pool.Connection.createStatement(Connection.java:40)
    at examples.jdbc.pool.simpleselect.service(simpleselect.java:109)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :120)
    >
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:922)
    >
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:886)
    >
    atweblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java:269)
    >
    atweblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
    >
    atweblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
    >
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Thanks & Regards

  • SQl statement cause extreme Portal log growth

    Our Portal server log file is growing very fast (30 - 50 Mb per minute). When examining the log file we see that the log file does contain only the error messages:
    #1.5#00096BF521750058005A9CA900001E480003E80BD8A2C263#1099562506968#/System/Database/sql/jdbc/common#sap.com/irj#com.sap.sql.jdbc.common.StatementAnalyzerImpl#Guest#18####655e44612e4811d9b41300096bf52175#Thread[ThreadPool-Dispatcher,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error#1#com.sap.sql.jdbc.common.StatementAnalyzerImpl#Java#com.sap.sql.jdbc.common_1123#com.sap.sql.log.OpenSQLResourceBundle#The SQL statement "" contains the semantics error[s]: #2#SELECT MIN("ID"),"PRIORITY" FROM "KMC_TQ_QUEUE" WHERE "NAMESPACE_HASH" = ? AND "NAMESPACE" = ? AND "TASK_STATE" = 1 GROUP BY "PRIORITY" ORDER BY 2 DESC#type check error: the expression >>"NAMESPACE"<< (LONGVARCHAR) is not comparable and must not be used with "="
    This message occurs more than 500 times per log file. It has something to do with Knowledge management, but we cannot find anything that triggers this sql statement.
    Any ideas?
    Noel Hendrikx & Pascal Rijnart

    SAP tells us in reaction to our customer message:
    "The table's definition is correct. What has to be changed is the
    computed type for field NAMESPACE and the generated file for the table.
    As I wrote before, if you make any change in the field NAMESPACE the
    new computation is started (so change the description which has no
    effect on the table's version on the database). Make the change and
    save the table in the SapNetWeaver Developer Studio. You will then
    see that the field's JDBC-type changes to VARCHAR.
    Choose 'Create archive' for Dictionary Project the table belongs to
    and deploy the sda on the database. Both can be done in the studio."
    Can anyone tell us what to do now?
    Noel Hendrikx

  • The column name "PERNR" has two meanings. ABAP/4 Open SQL statement.

    Hi All,
    Could anyone advise on what are the error I encountered at below code.
    I get the error in " The column name "PERNR" has two meanings. ABAP/4 Open SQL statement." . This errors happen to all the key fields I have selected in below code (eg: pernr, subty, objps, sprps, begda, endda, seqnr).
    The field zeih also encountered error in "Unknown column name "ZEIH". not determined until runtime, you cannot specify a field list."      
      SELECT  pernr
                   subty
                   objps
                   sprps
                   begda
                   endda
                  seqnr
                  zlsch
                  ZEIH
      SELECT * INTO CORRESPONDING FIELDS
              OF TABLE  i_pa0009
              FROM pa0001 INNER JOIN pa0009
              ON pa0001pernr = pa0009pernr
              WHERE bukrs IN s_code AND
              banks NE space.

    Hi,
    In this query
    SELECT pernr
    subty
    objps
    sprps
    begda
    endda
    seqnr
    zlsch
    ZEIH
    if you have used joins and if both the database pa0001, pa0009 has the above mentioned fields you will get the error message as the control gets confused as to which table of the field you are referring to..., instead use them in this way
    SELECT pa0001~pernr
    for each field mention to which table it belongs and ~ before the field name in the above fashion, this will remove the error
    Regards,
    Siddarth

  • Executing multiple SQL statements fails using ODBC

    Executing multiple SQL statements will fail with error 'ORA-00911 invalid character' when connecting to an Oracle database using ODBC driver version 8.01.07.00.
    When I use either my application or the Oracle ODBC Test client utility connecting using ODBC driver version 8.01.07.00 I can only get a single CALL statement (as shown below) to execute:
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','
    ','Event File
    Name','\\KILLIANS\BATCHCTL\SampleDemo1\JOURNALS\1.evt','','AREA1','','','','','','1','','','','','',' ','');
    When I try to execute the following string with multiple CALL statements (as shown below) it fails with the following error being returned - ORA-00911: invalid character
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','
    ','Event File
    Name','\\KILLIANS\BATCHCTL\SampleDemo1\JOURNALS\1.evt','','AREA1','','','','','','1','','','','','',' ','');
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD
    HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','Version','Recipe Header','1.0','','AREA1',' ','
    ','','','','1','','','','','',' ','');
    CALL BHInsert (TO_DATE('2003.07.23 10:04:28','YYYY.MM.DD
    HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','Version Date','Recipe Header','5/18/2001 1:28:32
    PM','','AREA1',' ',' ','','','','1','','','','','',' ','');
    CALL BHInsert (TO_DATE('2003.07.23
    10:04:28','YYYY.MM.DD HH24:MI:SS'),'BATCH_ID','1:CLS_FRENCHVANILLA-1','Author','Recipe Header','Mark
    Shepard','','AREA1',' ',' ','','','','1','','','','','',' ','');
    I've tried adding a line feed in addition to the space at the end of each call but that doesn't seem to help. Also have tried unsuccessfully to change the seperator used between each call using various valid continuation characters.
    Executing multiple CALL statements from within Oracle's SQL Worksheet connecting as the same user and password, as my application executes successfully. However when I try this from within the Oracle ODBC test client, it fails with the same ORA-00911 error that I'm seeing in my application.
    I'm currently trying the more recent ODBC drivers, however any ideas or suggestions would be greatly appreciated.

    Can you take the begin ... end block and run it using SQL*Plus?
    I can't think of any documentation that would specifically answer this question. I'm sure if you read & absorbed the ODBC Programmers Reference (2000+ pages) you'd be able to find out, but I don't know of a quick way to find out.
    You can enable SQL*Net tracing. There are a fair number of options for enabling this tracing-- http://tahiti.oracle.com has all the Oracle manuals online, which should give you enough info to configure exactly what you want.
    I would suggest, however, that you look into more performant/ scalable alternatives rather than going too far down this path. A block with lots of SQL statements with literals isn't going to make your database happy even if you get it to work.
    Justin

Maybe you are looking for

  • Can i have minipci WiFi on my Satellite L20-182?

    Hi! I have Satellite L20-182 without wifi card but I want to install one. I have spear minipci slot but I dont know if I have aerial preinstalled. When I ve looked under the cover of minipci slot. I found 2 wires (red and black) but they seem to be c

  • Can't find transferred file on PB

    I feel incredibly stupid, but I transferred a file to my PB and now I can't find it.  I followed the very good instructions on how to transfer files from my computer via WiFi, and I know the document transferred because I can see it in my media\docum

  • How to fill PDF form programatically

    Hi everyone, We are automating a web application using QuickTest Pro. In some scenarios we need to fill a PDF form and click 'submit' button. Is there any way we can use Acrobat SDK to automate this process? I really appreciate your help. Thanks and

  • How do I move videos i recorded off my digital camera to iMovie? !!!!!!!!!!

    I hooked my digital that recorded said video, to my mac book but I can't find out how to move my video from my digital to iMovie please help!

  • No audio in my hp compaq presario f739 au

    I have HP compaq presario f 739 au, laptop running on windows XP. One fine morning I found audio missing, the symbol (a) for  opening the volume control  was not there,even volume control ( Realtek AC 97 ) could not be found. I tried few things like