Wrong query is getting generated in WHERE NOT EXISTS  with group by clause

Query is getting generated wrongly in where not exists section when i use group by function.Please prvoide me any clue to over come the problem.
/* DETECTION_STRATEGY = NOT_EXISTS */
INSERT /*+ APPEND */ INTO STG_ETL.I$_DCMT_TIMEZONE_LOOKUP
     TZ_OFFSET,
     ADT_CRT_DT,
     ADT_UPDT_DT,
     IND_UPDATE
SELECT * FROM (
SELECT      
     to_number(KOFAX.RECEIVED_TZ)     TZ_OFFSET,
     min(sysdate)     ADT_CRT_DT,
     min(sysdate)     ADT_UPDT_DT,
     'I' IND_UPDATE
FROM     ESTG.FLAT_FIL_DMS_KOFAX KOFAX
WHERE     (1=1)
And (KOFAX.LD_DT = ( select MAX(LD_DT) from ESTG.FLAT_FIL_DMS_KOFAX INNER
where INNER.ENGAGEMENT=KOFAX.ENGAGEMENT
               and INNER.KOFAX_FILE_NM = KOFAX.KOFAX_FILE_NM
               AND INNER.IM_CUST_ID = KOFAX.IM_CUST_ID
          and INNER.BATCH_ID=KOFAX.BATCH_ID)
AND
(TO_DATE(KOFAX.LD_DT)>=TO_DATE(SUBSTR('#WAREHOUSE.P_EDW_LAST_RUN',1,10),'YYYY-MM-DD'))
And (substr(KOFAX.RECEIVED_TZ,1,1) <> '+')
Group By to_number(KOFAX.RECEIVED_TZ)
) S
WHERE NOT EXISTS (
     SELECT     'X'
     FROM     EDW.DCMT_TIMEZONE_LOOKUP T
     WHERE     T.TZ_OFFSET     = S.TZ_OFFSET AND
     )

Easiest fix for you would be to change the detection_strategy on the IKM from NOT_EXISTS to either :
MINUS
-- Try this out, it should work, it will give the same data through the equiverlant steps.
NONE
-- This will load all incoming data into your I$ table, there will be more rows to crunch in the following 'Flag Rows for Update' step, it might give incorrect results potentially - you will have to test it.
So try MINUS first, failing that, see if NONE gives you what you want in your target.
Are you inserting only new data or updating existing data?

Similar Messages

  • Custom IKM Knowledge Modules are not working with Group By Clause

    Hi All,
       I am facing an issue with custom IKM knowledge modules. Those are IKM Sql Incremental Update and IKM Sql Control Append.
    My Scenario is
    1. Created an interface with table on source and temporary datastore with some columns in target.
    2. In the Interface on the target i defined one column as UD1 and other column as UD2  for which group by to be implemented .
    3. Customized  IKM Sql Incremental Update  with " Group by " by making  modification in my IKM Sql Incremental Update
    detail step "Insert flow into I$ table"  i.e., i replaced like this whereever i find this <%=odiRef.getGrpBy()%> API
    Group By
    <%=snpRef.getColList("","[EXPRESSION]","","","UD1")%>,
    <%=snpRef.getColList("","[EXPRESSION]","","","UD2")%>
    Up to UD5.
    . Here in the place of [EXPRESSION] i passed column names for UD1 similarly other column name for [EXPRESSION] of UD2.
    4.Made all the proper mappings and also selected the KM's needed for that interface like CKM Sql ,IKM Sql Incremental Update.
    5. Executed the Interface with global context.
    Error i am getting in this case is :
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00979: not a GROUP BY expression
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
      at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
      at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1115)
    Here the columns in the select clause are there in Group By also.
    I did the same scenario using IKM Sql to file append .In that case i am able to do it. But not with the above mentioned KM's. Please let me know if any one know it or tried with this, as it is
    high priority for me.
    Please help me out.
    Thanks,
    keerthi

    Hi Keerthi,
    If your are transfering data from Oracle to Oracle (I means source is oracle Db and target is also oracle DB) then use below KM's and group by will come automatically based on the key values you selected on interface target datastore
    1) CKM Oracle
    2) LKM Oracle to Oracle (DBLINK)
    3) IKM Oracle Incremental Update (MERGE)
    Hope this will helps to resolve your issue
    Regards,
    Phanikanth

  • Using WHERE NOT EXISTS for a Fact Table Load

    I'm trying to set up a fact table load using T SQL, and I need to use WHERE NOT EXISTS. All of the fields from the fact table are listed in the WHERE NOT EXISTS clause. What I expect is that if the value of any one of the fields is different, that the whole
    record be treated as a new record, and inserted into the table. However, in my testing, when I 'force' a field value, new records are not inserted.
    The following is my query:
    declare 
    @Created_By nchar(50)
    ,@Created_Date datetime --do we need utc check?
    ,@Updated_By nchar(50)
    ,@Updated_Date datetime
    select @Created_By = system_user
    ,@Created_Date = getdate()
    ,@Updated_By = system_user
    ,@Updated_Date = getdate()
    insert fact.Appointment
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    select distinct
    Slot.Slot_ID 
    , Slot.Slot_Start_DateTime  as Slot_DateTime --???
    , Slot.Slot_Start_DateTime
    , Slot.Slot_End_DateTime
    , datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) as Slot_Duration_Min 
    , Slot.Created_Date as Slot_CreateDateTime
    , SlotCreateDate.Date_key as Slot_CreateDate_DateKey
    , HSite.Healthcare_System_ID
    , HSite.Healthcare_Service_ID
    , HSite.Healthcare_Service_ID as Healthcare_Supervising_Service_ID
    , HSite.Healthcare_Site_ID 
    , Ref.Booked_Appt_ID 
    , ApptSubmissionTime.Date_key as Appt_Notification_Submission_DateKey
    , ApptCompletionTime.Date_key as Appt_Notification_Completion_DateKey
    , datediff(mi,appt.SubmissionTime,appt.CompletionTime) as Appt_Notification_Duration
    , Appt.Appt_Notification_ID 
    , pat.Patient_ID 
    , 0 as Physician_ID
    , ref.Referral_ID
    , Hsrv.Specialty
    , appt.[Language] as LanguageRequested
    ,@Created_Date as Created_Date
    ,@Created_By as Created_By
    ,@Updated_Date as Updated_Date
    ,@Updated_By as Updated_By
    from dim.Healthcare_System HSys
    inner join dim.Healthcare_Service HSrv
    on HSys.Healthcare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Healthcare_Site HSite
    on HSite.HealthCare_Service_ID = HSrv.Healthcare_Service_ID
    and HSite.HealthCare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Referral Ref 
    on Ref.ReferralSite_ID = HSite.Site_ID
    and Ref.ReferralService_ID = HSite.Service_ID
    and Ref.ReferralSystem_ID = HSite.System_ID 
    right join (select distinct Slot_ID, Source_Slot_ID, Slot_Start_DateTime, Slot_End_DateTime, Created_Date from dim.slot)slot
    on ref.Source_Slot_ID = slot.Source_Slot_ID
    inner join dim.Appointment_Notification appt
    on appt.System_ID = HSys.System_ID
    inner join dim.Patient pat 
    on pat.Source_Patient_ID = appt.Source_Patient_ID
    inner join dim.SystemUser SysUser
    on SysUser.Healthcare_System_ID = HSys.Healthcare_System_ID
    left join dim.Calendar SlotCreateDate
    on SlotCreateDate.Full_DateTime = cast(Slot.Created_Date as smalldatetime)
    left join dim.Calendar ApptSubmissionTime
    on ApptSubmissionTime.Full_DateTime = cast(appt.SubmissionTime as smalldatetime)
    left join dim.Calendar ApptCompletionTime
    on ApptCompletionTime.Full_DateTime = cast(appt.CompletionTime as smalldatetime)
    where not exists
    select
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    from fact.Appointment
    I don't have any issues with the initial insert, but records are not inserted on subsequent inserts when one of the WHERE NOT EXISTS field values changes.
    What am I doing wrong?
    Thank you for your help.
    cdun2

    so I set up a WHERE NOT EXIST condition as shown below. I ran the query, then updated Slot_Duration_Min to 5. Some of the Slot_Duration_Min values resolve to 15. What I expect is that when I run the query again, that the records where Slot_Duration_Min resolves
    to 15 should be inserted again, but they are not. I am using or with the conditions in the WHERE clause because if any one of the values is different, then a new record needs to be inserted:
    declare 
    @Created_By nchar(50)
    ,@Created_Date datetime
    ,@Updated_By nchar(50)
    ,@Updated_Date datetime
    select
    @Created_By = system_user
    ,@Created_Date = getdate()
    ,@Updated_By = system_user
    ,@Updated_Date = getdate()
    insert fact.Appointment
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    select distinct
    Slot.Slot_ID 
    , Slot.Slot_Start_DateTime  as Slot_DateTime --???
    , Slot.Slot_Start_DateTime
    , Slot.Slot_End_DateTime
    , datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) as Slot_Duration_Min 
    , Slot.Created_Date as Slot_CreateDateTime
    , SlotCreateDate.Date_key as Slot_CreateDate_DateKey
    , HSite.Healthcare_System_ID
    , HSite.Healthcare_Service_ID
    , HSite.Healthcare_Service_ID as Healthcare_Supervising_Service_ID
    , HSite.Healthcare_Site_ID 
    , Ref.Booked_Appt_ID 
    , ApptSubmissionTime.Date_key as Appt_Notification_Submission_DateKey
    , ApptCompletionTime.Date_key as Appt_Notification_Completion_DateKey
    , datediff(mi,appt.SubmissionTime,appt.CompletionTime) as Appt_Notification_Duration
    , Appt.Appt_Notification_ID 
    , pat.Patient_ID 
    , 0 as Physician_ID
    , ref.Referral_ID
    , Hsrv.Specialty
    , appt.[Language] as LanguageRequested
    ,@Created_Date as Created_Date
    ,@Created_By as Created_By
    ,@Updated_Date as Updated_Date
    ,@Updated_By as Updated_By
    from dim.Healthcare_System HSys
    inner join dim.Healthcare_Service HSrv
    on HSys.Healthcare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Healthcare_Site HSite
    on HSite.HealthCare_Service_ID = HSrv.Healthcare_Service_ID
    and HSite.HealthCare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Referral Ref 
    on Ref.ReferralSite_ID = HSite.Site_ID
    and Ref.ReferralService_ID = HSite.Service_ID
    and Ref.ReferralSystem_ID = HSite.System_ID 
    right join (select distinct Slot_ID, Source_Slot_ID, Slot_Start_DateTime, Slot_End_DateTime, Created_Date from dim.slot)slot
    on ref.Source_Slot_ID = slot.Source_Slot_ID
    inner join dim.Appointment_Notification appt
    on appt.System_ID = HSys.System_ID
    inner join dim.Patient pat 
    on pat.Source_Patient_ID = appt.Source_Patient_ID
    inner join dim.SystemUser SysUser
    on SysUser.Healthcare_System_ID = HSys.Healthcare_System_ID
    left join dim.Calendar SlotCreateDate
    on SlotCreateDate.Full_DateTime = cast(Slot.Created_Date as smalldatetime)
    left join dim.Calendar ApptSubmissionTime
    on ApptSubmissionTime.Full_DateTime = cast(appt.SubmissionTime as smalldatetime)
    left join dim.Calendar ApptCompletionTime
    on ApptCompletionTime.Full_DateTime = cast(appt.CompletionTime as smalldatetime)
    where not exists
    select
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    from fact.Appointment fact
    where 
    Slot.Slot_ID  = fact.Slot_ID 
    or
    Slot.Slot_Start_DateTime   = fact.Slot_DateTime  
    or
    Slot.Slot_Start_DateTime = fact.Slot_StartDateTime
    or
    Slot.Slot_End_DateTime = fact.Slot_EndDateTime
    or
    datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) =
    fact.Slot_Duration_min
    or
    Slot.Created_Date  = fact.Slot_CreateDateTime
    or
    SlotCreateDate.Date_key = fact.Slot_CreateDate_DateKey
    or
    HSite.Healthcare_System_ID = fact.Healthcare_System_ID
    or
    HSite.Healthcare_Service_ID = fact.Healthcare_Service_ID
    or
    HSite.Healthcare_Service_ID  =
    fact.Healthcare_Service_ID 
    or
    HSite.Healthcare_Site_ID  = fact.Healthcare_Site_ID 
    or
    Ref.Booked_Appt_ID  = fact.Booked_Appt_ID 
    or
    ApptSubmissionTime.Date_key =
    fact.Appt_Notification_Submission_DateKey
    or
    ApptCompletionTime.Date_key =
    fact.Appt_Notification_Completion_DateKey
    or 
    datediff(mi,appt.SubmissionTime,appt.CompletionTime)  = fact.Appt_Notification_Duration
    or
    Appt.Appt_Notification_ID = fact.Appt_Notification_ID 
    or
    pat.Patient_ID  =
    fact.Patient_ID 
    or
    0 = 0
    or
    ref.Referral_ID = fact.Referral_ID
    or
    Hsrv.Specialty = fact.Specialty
    or
    appt.[Language] = fact.LanguageRequested

  • Getting Cost Center Does not exist error when executing BAPI_ACC_GL_POSTING

    Hi Champs,
    I am getting Cost Center Does not exist error when executing BAPI_ACC_GL_POSTING_CHECK.
    But when I checked for the particular Cost center, it is mapped to the same company code the program has got executed.
    Example:
    Cost center 1000/150402 does not exist on 17.11.2009.
    Cost center 1000/150402 does not exist
    Cost center 1000/150402 does not exist on 17.11.2009.
    Cost center 1000/150402 does not exist on 17.11.2009.
    Please let me know if you have any guess on this. It is very critical issue for me.
    Thanks for all your help in advance.
    With Best Regards,
    Ravi kanth Yechuri

    Use 0000150402 not 150402 .
    Rob

  • On my 3gs keep getting error message charging not supported with this accessory even when its not plugged in and i have done a restore anyone know how to fix

    on my 3gs keep getting error message charging not supported with this accessory even when its not plugged in and i have done a restore anyone know how to fix

    Clean the iPhone charging port with a clean dry toothbrush.

  • After downloading Lion the noise level of the fans increased. A noise which did not exist with Snow Leopard. Any ideas how to reduce noise?

    After downloading Lion the noise level of (what I believe to be ) the fans increased. A humming noise which did not exist with Snow Leopard. Any ideas how to reduce this noise?

    I have seen this mentioned a dozen times, here, on Lion,and MacRumors.
    Nope. Usual suspects.
    And whether you tried a clean install instead (backup and erase) and then use MA to import

  • Siebel Charts gets generated but does not display in the Web client

    Siebel Chart is getting generated in NetChart4.6\Server\root\projects\Siebel.chart folder. However does not display on the Web client
    There is either no error displayed on the front end...
    Also note that Charts is installed on Windows environment and Siebel Server is installed on Linux Server

    Dear User,
    Thanks for using Oracle communities.
    Does this happens in dedicated client as well?
    We would need to have traffic captured when you are actually executing actions. The tools like fiddler etc will help here to track the traffic.
    I would suggest you open SR with MOS since it will need some analysis on network trace like fiddler. You can refer this thread in SR as well, so that once issue gets resolved thread will get updated with solution which will benefit others.
    Best Regards,
    Chetan

  • I am getting this package does not exists , i want to write into excel shee

    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import org.apache.poi.hssf.usermodel.*;
    class Custprofile
    public int makeFile(String path) {
              HSSFWorkbook wb = new HSSFWorkbook();
              HSSFSheet sheet = wb.createSheet();               
              HSSFRow row = null;
              HSSFCell cell = null;
              Connection con = null;
              int j=0,k=2,value=0;
           /* String fromDate = SchDate.getYestDate(0) + " 00:00:00";
              String toDate = SchDate.getYestDate(0) + " 23:59:59";     */     
           // String heading =linkType+"From";                  
              try {
                   HSSFFont boldFont = wb.createFont();
                   boldFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
                   HSSFCellStyle boldStyle = wb.createCellStyle();
                   boldStyle.setFont(boldFont);
                   // create a row for heading
                   row = sheet.createRow((short)0);
                   cell = row.createCell((short)0);
                   // GREEN BOLD value               
                              boldFont.setColor((short)17);
                              cell.setCellStyle(boldStyle);     
                   //cell.setCellValue(heading);
                   /*cell = row.createCell((short)0);
                   cell.setCellValue(linkType);
                   cell = row.createCell((short)1);
                   cell.setCellValue(" Link Down ");
                   cell = row.createCell((short)2);
                   cell.setCellValue("Time Report ");
                   cell = row.createCell((short)3);
                   cell.setCellValue("From: ");
                   cell = row.createCell((short)4);
                   cell.setCellValue(fromDate);
                   cell = row.createCell((short)5);
                   cell.setCellValue(" To: ");
                   cell = row.createCell((short)6);
                   cell.setCellValue(toDate); */
                   // leave second row empty
                   try{
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                  /* the next 3 lines are Step 2 method 2 from above - you could use the direct
                                  access method (Step 2 method 1) istead if you wanted */
                                  String dataSourceName = "mdbTEST";
                                  String dbURL = "jdbc:odbc:" + dataSourceName;
                                  con = DriverManager.getConnection(dbURL, "","");
                        Statement stmt = con.createStatement();
                        String query = "Select * from empid";
                        ResultSet rs = stmt.executeQuery(query);
                           ResultSetMetaData rsmd = rs.getMetaData();
                               int numberOfColumns = rsmd.getColumnCount();
                                    String query1 = "Select * from empid";
                           Statement stmtn = con.createStatement();
                           ResultSet rs1 = stmtn.executeQuery(query1);
                           if(rs1.next())
                           value = rs1.getInt(1);
                                                     System.out.println("number of columns::"+numberOfColumns);
                                  System.out.println("number of rows:"+rs1.getInt(1));
                                  for(int i=1;  i <= numberOfColumns; i++)
                                  row = sheet.createRow((short)0);
                                  i--;
                                           cell = row.createCell((short)i);
                                                 cell.setCellStyle(boldStyle);     
                                  i++;
                                           cell.setCellValue(""+rsmd.getColumnLabel(i));
                                        for(int i=1; i < value+1; i++)
                                                       rs.next();
                                                       boldFont = wb.createFont();
                                                       boldFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
                                                       boldStyle = wb.createCellStyle();
                                                       boldStyle.setFont(boldFont);
                                           row = sheet.createRow((short)i);
                                for(int p=1;p<= numberOfColumns;p++){
                                   int t = p-1;
                                cell = row.createCell((short)t);
                                cell.setCellValue(""+rs.getString(p));
                   catch(Exception e)
                        System.out.println(e);
                                    Logging.addToLogFile("exporting into excel file exception"+e);
                   // create a row for fields
                   /*boldFont = wb.createFont();
                   boldFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
                   boldStyle = wb.createCellStyle();
                   boldStyle.setFont(boldFont);*/
              /*     row = sheet.createRow((short)2);
                   cell = row.createCell((short)0);
                 cell.setCellStyle(boldStyle);     
                   cell.setCellValue("Name");
                   cell = row.createCell((short)1);
                 cell.setCellStyle(boldStyle);     
                   cell.setCellValue("Start Date Time");
                   cell = row.createCell((short)3);
                 cell.setCellStyle(boldStyle);     
                   cell.setCellValue("End Date Time");
                   cell = row.createCell((short)5);
                 cell.setCellStyle(boldStyle);     
                   cell.setCellValue("Down Time"); */
                   //create rows for the data and insert the data into them
               /*  for(int i = 0, rowNum=3; i < vecRow.size(); i++ , rowNum++) {
                        boldFont = wb.createFont();
                        boldFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
                        boldStyle = wb.createCellStyle();
                        boldStyle.setFont(boldFont);
                      String r = (String)vecRow.get(i);
                        row = sheet.createRow((short)rowNum);
                        cell = row.createCell((short)0);
                        boldFont.setColor((short)39);                    
                       cell.setCellStyle(boldStyle);     
                       cell.setCellValue(r);
                        cell = row.createCell((short)1);
                        String startDateTime = "hello how r u";
                             //SchDate.getDateDdMmYyyy(r.startDateTime);
                        cell.setCellValue(startDateTime);
                        cell = row.createCell((short)3);
                        String endDateTime = "i am fine";
                             //SchDate.getDateDdMmYyyy(r.endDateTime);                    
                        cell.setCellValue(endDateTime);
                        cell = row.createCell((short)5);
                        cell.setCellValue(r);
                   // Create the file                  
                   FileOutputStream fileOut = new FileOutputStream(path);
                   wb.write(fileOut);
                   fileOut.close();
              } catch(IOException ie) {
               System.out.println(ie);
              /* making the excel file without using POI */
              /*try{
                   PrintWriter pw = new PrintWriter(new FileOutputStream(path),true);
                   pw.println(message);
                   pw.close();
              } catch(IOException ie) {
                   Logging.addToLogFile("Failed To Send Mail : "+ie+ie.getMessage());
                 //Constants.rootLogger.info("Failed To Send Mail : "+ie+ie.getMessage());               
                    return value;
         public void removeFile(String path) {
              File remFile = new File(path);
              remFile.delete();
       public static void main(String a[])
            excelfile ef = new excelfile();
            Vector news = new Vector();
           String v = "sasi";
            news.add(v);
            news.add(v);
            news.add(v);
            ef.makeFile("D:\\software\\d.xls");
            //ef.removeFile("D:\\Barcodes\\");
       }Here is the entire code i had placed the poi1/2/3.jar files in the classpath and i am compiling but i am getting 23 errors all related with that import org.apache.poi.hssf.usermodel.*; does not exist, wht shall i do, and i am using jdk 1.5 and my console is showing 1.3 version after typing java -version in console. reply asap.

    Thank you for your responses. Your feedback was helpful. This is what I ended up doing for a solution:
    DECLARE
    v_JOBTYPE varchar2(8);
    v_STATUS varchar2(8);
    v_FAILURE varchar2(8);
    v_CAUSE varchar2(8);
    v_ACTION varchar2(8);
    v_GROUP varchar2(30);
    BEGIN
    SELECT EVT_STATUS, EVT_FAILURE, EVT_CAUSE, EVT_ACTION, EVT_JOBTYPE, USR_GROUP
    INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, v_JOBTYPE, v_GROUP
    FROM R5EVENTS, R5USERS WHERE R5EVENTS.ROWID = :ROWID
    AND USR_CODE = O7SESS.CUR_USER;
    IF NVL(v_STATUS, 'X') = 'C' AND NVL(V_GROUP,'X') IN ('MTM','MTL','MTMGT','FTL','FTMGTS','PLANNER','DISPATCH','PMCOOR','R5') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
    RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
    END IF;
    END;

  • Getting a "Business partner not found with partner function type requester"

    Hi There,
    After I add a text item to the shopping cart using the SHOP t-code, I get a message "Business partner not found with partner function type requester" What could be causing this and how can I rectify this problem.
    Please help mas this is an urgent issue.
    Thanks,
    Grace

    Hi Grace,
    First check :
    1- transaction : CRM_OM_BP_INTEGRATE
    select org structure where your user is and check that you have green lights (no missing address....)
    2- Run transaction USERS_GEN
    Select check user
    Is everything correct or does the user need to be repaired ?
    Kind regards,
    Yann

  • Getting "Method 'sign_in' does not exist" Error (using Charles)

    This may be a bit off the FLEX field, and have to do with Zend Framework's ZEND_AMF class. Unfortunately I haven't been able to dig anything up, and comments posted on Wade Arnolds site have not received any responses, so I thought I'd give it a go here.
    My ServiceController Class:
    public function loginAction()
         $this->_helper->viewRenderer->setNoRender();
         $server = new Zend_Amf_Server();
         $server->setClass('LoginAmfService', 'LoginService');
         $server->setClassMap('CurrentUserVO', 'CurrentUserVO');
         $server->setProduction(false);
         print($server->handle());
    My LoginAmfService class:
    class LoginAmfService
          * Main login function.
          * @param  string        $name
          * @param  string        $password
          * @return CurrentUserVO
         public function sign_in($name, $password)
              $authAdapter     = new Zend_Auth_Adapter_DbTable(Zend_Registry::get('db'), 'users', 'user_name', 'password', 'PASSWORD(?) AND active = 1');
              $returnValue     = new CurrentUserVO();
              $authAdapter->setIdentity(htmlspecialchars($name))
                   ->setCredential(htmlspecialchars($password));
              $authResult = $authAdapter->authenticate();
              if ($authResult->isValid())
                   $userArray                          = $authAdapter->getResultRowObject(array('id', 'first_name', 'last_name', 'title', 'photo'));
                   $returnValue->first_name     = $userArray->first_name;
                   $returnValue->last_name          = $userArray->last_name;
                   $returnValue->title               = $userArray->title;
                   $returnValue->photo               = $userArray->photo;
                   $returnValue->token               = $userArray->id;
              return $returnValue;
          * Function used to log people off.
         public function sign_out()
              $authAdapter = Zend_Auth::getInstance();
              $authAdapter->clearIdentity();
    My SignIn FLEX module (the relevant portions):
         <mx:RemoteObject
              id="LoginRemote"
              destination="login"
              source="SignIn"
              showBusyCursor="true"
              fault="parentDocument.handleFault(event)"
         >
               <mx:method name="sign_in" result="signin_handle(event)" />
               <mx:method name="sign_out" result="signout_handle(event)" />
         </mx:RemoteObject>
         <mx:Script>
              <![CDATA[
                   import mx.rpc.events.FaultEvent;
                   import mx.utils.ArrayUtil;
                   import mx.rpc.events.ResultEvent;
                   import mx.controls.Alert;
                   import com.brassworks.ValueObjects.CurrentUserVO;
                   import mx.events.VideoEvent;
                   [Bindable]
                   private var this_user:CurrentUserVO = new CurrentUserVO();
                   private function mdl_init():void
                        focusManager.setFocus(txt_username);
                   private function signin_handle(event:ResultEvent):void
                             this_user = event.result as CurrentUserVO;
                             if (this_user.token == null) {Alert.show("Supplied login credentials are not valid. Please try again.");}
                             else
                                  this.parentApplication.setUser(this.this_user);
                   private function signout_handle(event:ResultEvent):void
                   private function sign_in(event:Event):void
                        try
                             //Alert.show(txt_name.text + "|" + txt_password.text);
                             LoginRemote.sign_in(txt_username.text, txt_password.text);
                        catch (error:Error)
                             this.parentDocument.handleFault(error);
                   private function sign_out(event:Event):void
                   private function show_error(error:Error, s_function:String):void
                        Alert.show("Method:" + s_function + "\nName: " + error.name + "\nID: " + error.errorID + "\nMessage: " + error.message + "\nStack Trace: " + error.getStackTrace() + "\nError: " + error.toString());
                   private function handleFault(event:FaultEvent):void
                        Alert.show(event.fault.faultDetail, event.fault.faultString);
              ]]>
         </mx:Script>
    Now, all this is great and good, as it works with Zend Framework 1.7.6. However, when I try to upgrade to 1.7.8 (to take advantage of session management and other bug-fixes), I get the following error (using Charles):
    #1 /var/web/htdocs/core/library/Zend/Amf/Server.php(390): Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))
    #2 /var/web/htdocs/core/application/default/controllers/ServicesController.php(73): Zend_Amf_Server->handle()
    #3 /var/web/htdocs/core/library/Zend/Controller/Action.php(503): ServicesController->loginAction()
    #4 /var/web/htdocs/core/library/Zend/Controller/Dispatcher/Standard.php(285): Zend_Controller_Action->dispatch('loginAction')
    #5 /var/web/htdocs/core/library/Zend/Controller/Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #6 /var/web/htdocs/core/application/bootstrap.php(39): Zend_Controller_Front->dispatch()
    #7 /var/web/htdocs/core/public/index.php(5): Bootstrap->runApp()
    #8 {main} ?Method "sign_in" does not exist
    I have no idea why this would not work anymore. My assumption is that I am not correctly setting up Zend_Amf (but then again, my counter-argument is that it worked before, so ..... ????)
    Thanks for any help!
    -Mike

    For those that are also fighting this issue:
    The problem appears to be that the RemoteObject needs to specify the class containing the methods as a source parameter. According to this bug report (http://framework.zend.com/issues/browse/ZF-5168) it is supposed to have been addressed, but apparently has re-emerged in Zend_Amf since version 1.7.7.
    Using my example above, I would have to specify the RO as:
    <mx:RemoteObject
              id="LoginRemote"
              destination="login"
              source="LoginAmfService"
              showBusyCursor="true"
              fault="parentDocument.handleFault(event)"
         >
               <mx:method name="sign_in" result="signin_handle(event)" />
               <mx:method name="sign_out" result="signout_handle(event)" />
         </mx:RemoteObjecct>

  • HOW DO I GET A SECOND IPHONE NOT TOSYNC WITH MY ICLOUD

    how do I get my second iphone not to sync with my icloud. this phone is for a family member.

    Don't sign into iCloud using your account on their phone.

  • Incorrect warning when parsing query with group by clause

    I am using SQL Developer 4.0.0.13.80 with JDK 1.7.0_51 x64 on Windows 8.1
    I have the following SQL, which works perfectly:
    select substr(to_char(tot_amount), 0, 1) as digit, count(*)
    from transactions
    where tot_amount <> 0
    group by substr(to_char(tot_amount), 0, 1)
    order by digit;
    However, SQL Developer is yellow-underlining the first line, telling me that:
    SELECT list is inconsistent with GROUP BY; amend GROUP BY clause to: substr(to_char(rep_tot_amount), 0, 1), substr(to_char(rep_tot_amount),
    which is clearly wrong.
    Message was edited by: JamHan
    Added code formatting.

    Hello,
    I also have found the same issue with the GROUP BY hint. Another problem I found is that the hint suggests to amend the GROUP BY members to add also constant values that are included in the SELECTed columns and whenever those constants include strings with spaces, it generates an invalid query. Normally, constant values won't affect grouping functions and as such they can be omitted from the GROUP BY members, but it seems SQL Dev thinks it differently.
    For example, if you try the following query:
    SELECT d.DNAME, sum(e.sal) amt, 'Total salary' report_title, 100 report_nr
    FROM scott.emp e, scott.dept d
    WHERE e.DEPTNO = d.DEPTNO
    GROUP BY d.DNAME;
    when you hover the mouse pointer on the yellow hint, a popup will show the following message:
    SELECT list inconsistent with GROUP BY; amend GROUP BY clause to:
    d.DNAME, 'Total, 100
    If you click on the hint, it will amend the group by members to become:
    GROUP BY d.DNAME, 'Total, 100;
    that is clearly incorrect syntax. You may notice that after the change the yellow hint is still there, suggesting to amend further the GROUP BY members. If you click again on the hint, you will end with the following:
    GROUP BY d.DNAME, 'Total, 100;
    , 'Total, 100
    and so on.
    I am not sure if this behaviour was already known (Vadim??), but it would be nice if somebody could file a bug against it.
    Finally when writing big queries with complex functions and constant columns, those yellow lines extend all over the select list and they are visually annoying, so I wonder if there is a way to disable the GROUP BY hint until it gets fixed.
    Thanks for any suggestion,
    Paolo

  • CFQUERYPARAM tag not working in GROUP BY clause

    I am getting an error whenever I put a CFQUERYPARAM tag in a
    GROUP BY clause. I saw on another message board someone was having
    a similar problem with the ORDER BY clause
    Here is a sample of what my code might look like
    select x, y, z from abc
    group by <cfqueryparam value="x"
    cfsqltype="cf_sql_float">
    Here is the error I receive.
    Error Executing Database Query.
    [Macromedia][Oracle JDBC Driver][Oracle]ORA-00979: not a
    GROUP BY expression
    Any insight?

    The cachedwithin and cachedafter functions store the query
    results in the server's RAM. That means, while it's cached,
    whenever you run it, you get the cached result instead of going to
    the database to run it again. This increases speed of course, but
    if the data changes during the cache period, you have accuracy
    problems.
    It does not create memory issues. In the administrator you
    reserve a certain amount of memory for query caching. If you exceed
    that amount, the last query in pushes the first query out, or
    something like that.
    With regards to what you are trying to do about binding
    variables in your group by clause, that's not what cfqueryparam was
    designed for. It was designed for
    where clauses (where this = <cfqueryparam etc>
    or insert queries (insert into my table (field) values
    (<cfqueryparam>
    and things like that.
    You are trying to use it for something other than what it was
    designed for, which explains why it's not working for you.

  • Strange behavior in inner query with group by clause

    Hi All,
    I found a very strange behaviour with Inner query having a group by clause.
    Please look the sample code
    Select b,c,qty from (select a,b,c,sum(d) qty from tab_xyz group by b,c);
    This query gives output by summing b,c wise. But when i run the inner query it gives error as "not a group by expression "
    My question is - though the inner query is wrong, how is it possible that this query gives output.
    it behaves like -
    Select b,c,qty from (select b,c,sum(d) qty from tab_xyz group by b,c);
    Is it a normal behaviour ?
    If it is a normal behaviour, then how group by behaves inside a inner query.
    Thanks !!

    This case I have tested already and it throws error.
    But why the initial posted query is not throwing
    error even the inner query is wrong.
    In what way oracle behaves for the initial posted
    query?what is the scenario that throws the error? is it at the time when you only run the inner query or the whole query?

  • Error: Requested resource does not exist with SAP WebAS..deployed an ear

    hi,
    i deployed an application using SDM gui deployement manger.   the application is built using struts,spring etc. I have also created a datasource with Oracel 9i succesfully and hav associated it with the application.
    When i try to access the application using the struts based path i get an "<b>ERROR 404:- Error: Requested resource does not exist</b>". I also tried accessing the index.jsp page directly without struts paths but dont know why i get an error "<b>File [appContext/admin/index.jsp] not found in application root of alias [/] of J2EE application [sap.com/com.sap.engine.docs.examples].</b>"
    The same ear is working perfectly fine with IBM WSAD but not in SAP Web AS ?? is there any configuration issues that i need to address ?? Kindly help me ASAP !!
    Regards,
    Vaibhav

    Hi,
    The Required server log contents are as follows:-
    #1.5#000CF1AFC124017A000000020000067000041B1D550F525C#1155712701853#com.sap.engine.services.servlets_jsp.server.jsp.JSPParser#sap.com/doculine#com.sap.engine.services.servlets_jsp.server.jsp.JSPParser#Guest#2####661184d02cf711db80fa000cf1afc124#SAPEngine_Application_Thread[impl:3]_37##0#0#Error#1#/System/Server#Plain###Runtime error in compiling of the JSP file <C:/usr/sap/J2E/JC00/j2ee/cluster/server0/apps/sap.com/doculine/servlet_jsp/doculine/root/admin/login.jsp> !
    The error is: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.ParseException: TagLibValidator returns error(s) for taglib [/WEB-INF/c.tld]: [
         com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Unsupported character: a9(:main:, row:739, col:23)(:main:, row=739, col=23) -> com.sap.engine.lib.xml.parser.ParserException: Unsupported character: a9(:main:, row:739, col:23)
    Exception id: [000CF1AFC124017A000000000000067000041B1D550F4D94]#
    #1.5#000CF1AFC124017A000000030000067000041B1D550F5C88#1155712701868#com.sap.engine.services.servlets_jsp.client.RequestInfoServer#sap.com/doculine#com.sap.engine.services.servlets_jsp.client.RequestInfoServer#Guest#2####661184d02cf711db80fa000cf1afc124#SAPEngine_Application_Thread[impl:3]_37##0#0#Error##Plain###Processing HTTP request to servlet [action] finished with error. The error is: com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException: Internal error while parsing JSP page [C:/usr/sap/J2E/JC00/j2ee/cluster/server0/apps/sap.com/doculine/servlet_jsp/doculine/root/admin/login.jsp].
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:117)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.getClassName(JSPServlet.java:238)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.compileAndGetClassName(JSPServlet.java:429)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:169)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:316)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:372)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
         at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1001)
         at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:560)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:209)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:316)
         at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:372)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.ParseException: TagLibValidator returns error(s) for taglib [/WEB-INF/c.tld]: [
         com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Unsupported character: a9(:main:, row:739, col:23)(:main:, row=739, col=23) -> com.sap.engine.lib.xml.parser.ParserException: Unsupported character: a9(:main:, row:739, col:23)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.validate(JSPParser.java:243)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.initParser(JSPParser.java:348)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:105)
         ... 37 more
    #1.5#000CF1AFC124017A000000050000067000041B1D550F5F94#1155712701868#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#sap.com/doculine#com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl#Guest#2####661184d02cf711db80fa000cf1afc124#SAPEngine_Application_Thread[impl:3]_37##0#0#Error#1#/System/Server/WebRequests#Plain###Processing HTTP request to servlet [action] finished with error.
    The error is: com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException: Internal error while parsing JSP page [C:/usr/sap/J2E/JC00/j2ee/cluster/server0/apps/sap.com/doculine/servlet_jsp/doculine/root/admin/login.jsp].
    Exception id: [000CF1AFC124017A000000030000067000041B1D550F5C88]#

Maybe you are looking for

  • How to insert code in ABAP program ( Z program) by ABAP coding.

    Hello, In ABAP is there any way to insert some code lines into an existing ABAP program (Z*) , We will insert in masse some code lines into a liste of program automatically ? Thanks in advance

  • Issues with migrating to SUN JVM

    Hi Chapter 4 of the "Microsoft Java Virtual Machine Transition Guide for IT Professionals" [part of the documentation for "The Diagnostic Tool for the Microsoft Virtual Machine"] contains[under a discussion of disabling Java] : (a) '... the Sun JRE,

  • How to close the freight line in SO so freight is not charged on backorders

    I am currently on SAP B1 8.82 PL 11 with an Addon Achieve Freight Control. My problem is that freight is being charged on backorders and I do not want that.  When the first order generated the delivery is there a way the sales order freight closes? T

  • When I add a title in iMovie, the last title disappears

    Using iMovie 10.0.5 on a Retina 15" running 10.9.5, I have added a series of titles (lyrics) over a music video. Now, suddenly, when I add the next one, the previous one I added disappears. It does allow me to add the new one, which is the sixth or s

  • HT204053 iCloud wont sync devices

    How can iCloud sync my devices (for photos, etc) if both my iPad and iPhone were required to have different Apple ID's on initial setup?  My iCloud account names cannot be changed on my devices.  I'm confused on how to get my content synced via the c