Extraction of data from Planning and load it into Oracle/SQL server (RDBMS)

Hi All,
ODI can extract data from Oracle/SQL server RDBMS and load it into Hyperion planning, but I wanted to know if it is possible to extract data from Hyperion Planning through ODI and load it into Oracle or SQL server RDMBS i.e the other way round.
Kindly let me know if that is possible or not,If yes then please let me know what is the exact process to achieve this through ODI.
Thanks & Regrads,
Gurpreet

Yes this can be done. Remember that Planning data is actually stored in Essbase so the Knowledge module you will need to use is LKM Essbase to SQL (DATA)

Similar Messages

  • How to Extract Data from SAP and Load it into Essbase

    Hi All,
    Can you recommend some ways to extract data from SAP and load it into Essbase?. I have no knowledge about SAP, not sure how I can perform this task. Can I use ODI for this job?
    Thanks

    hi,
    Not sure if this helps but give a try
    you can create connection from EAS to SAP .. using a plug-in .. if you have access to oracle Support go for [ID 968961.1]
    or
    below are steps
    1. In EASPATH\console, open components.xml in a text editor.
    2. Under <PluginList>, enter <Plugin archiveName="SAP" packageName="com.essbase.eas.sap.ui"/> before the closing </PlugIn> tag.
    3. Save and close the file.
    4. In EASPATH\console\bin, open admincon.lax in a text editor.
    5. Search for lax.class.path= and append ;..\lib\sap_client.jar;..\lib \sap_common.jar to the entry. Save and close the file.
    6. In EASPATH\server\bin, open adminsvr.lax in a text editor.
    7. Search for lax.nl.java.option.additional, and append -DRFC_INI=EASPATH\server\saprfc.ini. Save and close the file.
    8. Create a new environment variable, RFC_INI, with a value of EASPATH\server\saprfc.ini
    9. Copy librfc.dll andsapjcorfc.dll to EASPATH\server\bin. You may need to obtain these files from SAP.
    let me know if it works :)

  • Open an Excel file to read and load it into Oracle - Oracle COM Automation

    Hello All,
    Please I need your help for this problem:
    I need to load Excel sheet data (read the data) and load it into Oracle database (insert into a table), the excel file created and has data before, and saved with xls format. and I need to do that using the Oracle® COM Automation (ordcom package). The examples I found open and create a new workbook and deletes the old saved data, so I need to open (edit) the sheet just for reading.
    I appreciate ans sample code to help me do that, Please help me out. This is very urgent.
    Thanks alot and best regards,
    Nabil

    For reading from Excel, there are some easy ways like Oracle Heterogenious Services. If you want to use COM then:
    My orawpcom.dll file exists in the directory C:\oracle\product\10.2.0\db_2\bin
    C:\oracle\product\10.2.0\db_2\bin>dir orawpco*.dll
    Volume in drive C is C_Drive
    Volume Serial Number is 8A93-1441
    Directory of C:\oracle\product\10.2.0\db_2\bin
    03/20/2006  05:06 PM            61,440 orawpcom.dll
    10/11/2006  03:20 PM            81,920 orawpcom10.dll
                   2 File(s)        143,360 bytes
                   0 Dir(s)  65,407,717,376 bytes free
    C:\oracle\product\10.2.0\db_2\bin>Information about my database version.
    SQL> /* My databaser version */
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> Preparing the user SCOTT for COM automation.
    Now, I will run comwrap.sql from scott user. I have edited the comwrap.sql to adjust my library path here:
    create library utils_lib as 'C:\oracle\product\10.2.0\db_3\bin\orawpcom.dll';Running comwrap.sql and ExcelSolution.sql .....
    SQL> conn scott@orclsb
    Enter password: *****
    Connected.
    SQL> @c:\comwrap.sql
    drop library utils_lib
    ERROR at line 1:
    ORA-04043: object UTILS_LIB does not exist
    Library created.
    drop package ORDCOM
    ERROR at line 1:
    ORA-04043: object ORDCOM does not exist
    drop TYPE OAArgTable
    ERROR at line 1:
    ORA-04043: object OAARGTABLE does not exist
    Type created.
    drop TYPE OAArgTypeTable
    ERROR at line 1:
    ORA-04043: object OAARGTYPETABLE does not exist
    Type created.
    drop function OAgetNumber
    ERROR at line 1:
    ORA-04043: object OAGETNUMBER does not exist
    Function created.
    drop function OAgetStr
    ERROR at line 1:
    ORA-04043: object OAGETSTR does not exist
    Function created.
    drop function OAgetBool
    ERROR at line 1:
    ORA-04043: object OAGETBOOL does not exist
    Function created.
    drop function OAsetNumber
    ERROR at line 1:
    ORA-04043: object OASETNUMBER does not exist
    Function created.
    drop function OAsetString
    ERROR at line 1:
    ORA-04043: object OASETSTRING does not exist
    Function created.
    drop function OAsetBoolean
    ERROR at line 1:
    ORA-04043: object OASETBOOLEAN does not exist
    Function created.
    drop function OAInvokeDouble
    ERROR at line 1:
    ORA-04043: object OAINVOKEDOUBLE does not exist
    Function created.
    drop function OAInvokeBoolean
    ERROR at line 1:
    ORA-04043: object OAINVOKEBOOLEAN does not exist
    Function created.
    drop function OAInvokeString
    ERROR at line 1:
    ORA-04043: object OAINVOKESTRING does not exist
    Function created.
    drop function OACreate
    ERROR at line 1:
    ORA-04043: object OACREATE does not exist
    Function created.
    drop function OADestroy
    ERROR at line 1:
    ORA-04043: object OADESTROY does not exist
    Function created.
    drop function OAGetLastError
    ERROR at line 1:
    ORA-04043: object OAGETLASTERROR does not exist
    Function created.
    drop function OAQueryMethods
    ERROR at line 1:
    ORA-04043: object OAQUERYMETHODS does not exist
    Function created.
    Package created.
    Package body created.
    SQL>
    SQL> @c:\ExcelSolution.sql
    drop package ORDExcel
    ERROR at line 1:
    ORA-04043: object ORDEXCEL does not exist
    Package created.
    Package body created.
    SQL>
    I have modified ORDExcel a little bit and renamed it as ORDExcelSB. You need this version for reading the excel.
    SQL> @C:\ExcelSolutionSB.sql
    Package dropped.
    Package created.
    Package body created.
    SQL> The actual code of ORDExcelSB (ExcelSolutionSB.sql) Is:
    set serveroutput on;
    drop package ORDExcelSB;
    CREATE PACKAGE ORDExcelSB AS
       /* Declare externally callable subprograms. */
       FUNCTION CreateExcelApplication(servername VARCHAR2) RETURN binary_integer;
       FUNCTION OpenExcelFile(filename VARCHAR2, sheetname VARCHAR2) RETURN binary_integer;
       FUNCTION CreateExcelWorkSheet(servername varchar2) return binary_integer;
       FUNCTION InsertData(range varchar2, data binary_integer, type varchar2) return binary_integer;
       FUNCTION InsertDataReal(range varchar2, data double precision, type varchar2) return binary_integer;
       FUNCTION GetDataNum(range varchar2) return binary_integer;
       FUNCTION GetDataStr(range varchar2) return varchar2;
       FUNCTION GetDataReal(range varchar2) return double precision;
       FUNCTION GetDataDate(range varchar2) return date;
       FUNCTION InsertData(range varchar2, data varchar2, type varchar2) return binary_integer;
       FUNCTION InsertData(range varchar2, data Date, type varchar2) return binary_integer;
       FUNCTION InsertChart(xpos binary_integer, ypos binary_integer, width binary_integer,
                                  height binary_integer, range varchar2, type varchar2) return binary_integer;
       FUNCTION SaveExcelFile(filename varchar2) return binary_integer;
       FUNCTION ExitExcel return binary_integer;
    END ORDExcelSB;
    CREATE PACKAGE BODY ORDExcelSB AS
       DummyToken          binary_integer;     
       applicationToken binary_integer:=-1;
       WorkBooksToken     binary_integer:=-1;
       WorkBookToken     binary_integer:=-1;
       WorkSheetToken     binary_integer:=-1;
       WorkSheetToken1     binary_integer:=-1;
       RangeToken          binary_integer:=-1;
       ChartObjectToken     binary_integer:=-1;
       ChartObject1          binary_integer:=-1;
       Chart1Token          binary_integer:=-1;
       i                    binary_integer;
       retNum               binary_integer;
       retReal               double precision;
       retStr               varchar2(255);
       retDate               DATE;
    error_src varchar2(255);
    error_description varchar2(255);
    error_helpfile varchar2(255);
    error_helpID binary_integer;
    FUNCTION CreateExcelApplication(servername VARCHAR2) RETURN binary_integer IS
      BEGIN
        dbms_output.put_line('Creating Excel application...');
        i := OrdCOM.CreateObject('Excel.Application',
                                 0,
                                 servername,
                                 applicationToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking Workbooks...');
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkBooks',
                                0,
                                WorkBooksToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        RETURN i;
      END CreateExcelApplication;
      FUNCTION OpenExcelFile(filename VARCHAR2, sheetname VARCHAR2)
        RETURN binary_integer IS
      BEGIN
        dbms_output.put_line('Opening Excel file ' || filename || ' ...');
        ORDCOM.InitArg();
        ORDCOM.SetArg(filename, 'BSTR');
        i := ORDCOM.Invoke(WorkBooksToken, 'Open', 1, DummyToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Opening WorkBook');
        i := ORDCOM.GetProperty(applicationToken,
                                'ActiveWorkbook',
                                0,
                                WorkBookToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheets..');
        i := ORDCOM.GetProperty(applicationToken,
                                'WorkSheets',
                                0,
                                WorkSheetToken1);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Invoking WorkSheet');
        ORDCOM.InitArg();
        ORDCOM.SetArg(sheetname, 'BSTR');
        i := ORDCOM.GetProperty(WorkBookToken, 'Sheets', 1, WorkSheetToken);
        IF (i != 0) THEN
          ORDCOM.GetLastError(error_src,
                              error_description,
                              error_helpfile,
                              error_helpID);
          dbms_output.put_line(error_src);
          dbms_output.put_line(error_description);
          dbms_output.put_line(error_helpfile);
        END IF;
        dbms_output.put_line('Opened ');
        RETURN i;
      END OpenExcelFile;
    * Invoke the Excel Automation Server and create a Workbook object as
    * well as a worksheet object
    FUNCTION CreateExcelWorkSheet(servername varchar2) return binary_integer IS
    BEGIN
         dbms_output.put_line('Creating Excel application...');
         i:=ORDCOM.CreateObject('Excel.Application', 0, servername,applicationToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         dbms_output.put_line('Invoking Workbooks...');
         /*i:=ORDCOM.Invoke(applicationToken, 'WorkBooks',0, WorkBooksToken);*/
         i:=ORDCOM.GetProperty(applicationToken, 'WorkBooks', 0, WorkBooksToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         dbms_output.put_line('Invoking Add to WorkBooks...');
         ORDCOM.InitArg();
         ORDCOM.SetArg(-4167,'I4');
         i:=ORDCOM.Invoke(WorkBooksToken, 'Add', 1, WorkBookToken);
    IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         dbms_output.put_line('Invoking WorkSheets..');
         ORDCOM.InitArg();
         ORDCOM.SetArg('Sheet 1','BSTR');
    /*     i:=ORDCOM.Invoke(applicationToken, 'WorkSheets', 1, WorkSheetToken);*/
    i:=ORDCOM.GetProperty(applicationToken, 'WorkSheets', 0, WorkSheetToken1);
    IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
    i:=ORDCOM.Invoke(WorkSheetToken1, 'Add', 0, WorkSheetToken);
    IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         return i;
    END CreateExcelWorkSheet;
    * Invoke the Range method to obtain a range token. Then set the property value
    * at the specified range to the data required
    FUNCTION InsertData( range varchar2,
                             data binary_integer,
                             type varchar2)
                             RETURN binary_integer IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.SetProperty(RangeToken, 'Value', data, type);
         IF (i=0) THEN
               i:=ORDCOM.SetProperty(RangeToken, 'ColumnWidth', 15, 'I2');
         END IF;
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN i;
    END InsertData;
    * Invoke the Range method to obtain a range token. Then set the property value
    * at the specified range to the data required
    FUNCTION GetDataNum( range varchar2)
                             RETURN binary_integer IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.GetProperty(RangeToken, 'Value', 0, retNum);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN retNum;
    END GetDataNum;
    FUNCTION GetDataReal( range varchar2)
                             RETURN double precision IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.GetProperty(RangeToken, 'Value', 0, retReal);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN retReal;
    END GetDataReal;
    FUNCTION GetDataStr( range varchar2)
                             RETURN varchar2 IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.GetProperty(RangeToken, 'Value', 0, retStr);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN retStr;
    END GetDataStr;
    FUNCTION GetDataDate( range varchar2)
                             RETURN Date IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.GetProperty(RangeToken, 'Value', 0, retDate);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN retDate;
    END GetDataDate;
    FUNCTION InsertData( range varchar2,
                             data DATE,
                             type varchar2)
                             RETURN binary_integer IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         i:=ORDCOM.SetProperty(RangeToken, 'Value', data, type);
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN i;
    END InsertData;
    FUNCTION InsertDataReal( range varchar2,
                             data double precision,
                             type varchar2)
                             RETURN binary_integer IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         i:=ORDCOM.SetProperty(RangeToken, 'Value', data, type);
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN i;
    END InsertDataReal;
    FUNCTION InsertData( range varchar2,
                             data varchar2,
                             type varchar2)
                             RETURN binary_integer IS
    BEGIN
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken, 'Range', 1, RangeToken);
         i:=ORDCOM.SetProperty(RangeToken, 'Value', data, type);
         i:=ORDCOM.DestroyObject(RangeToken);
         RETURN i;
    END InsertData;
    * Insert a chart at the x and y position of the spreadsheet with the desired
    * height and width. Then also uses the ChartWizard to draw the graph with data
    * in a specified range area with a specified charting type.
    FUNCTION InsertChart(xpos binary_integer, ypos binary_integer,
                              width binary_integer, height binary_integer,
                              range varchar2, type varchar2) RETURN binary_integer IS
         charttype binary_integer:= -4099;
    BEGIN
         ORDCOM.InitArg();
         i:=ORDCOM.GetProperty(WorkSheetToken, 'ChartObjects', 0, ChartObjectToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         ORDCOM.InitArg();
         ORDCOM.SetArg(xpos,'I2');
         ORDCOM.SetArg(ypos,'I2');
         ORDCOM.SetArg(width,'I2');
         ORDCOM.SetArg(height,'I2');
         i:=ORDCOM.Invoke(ChartObjectToken, 'Add', 4, ChartObject1);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.GetProperty(ChartObject1, 'Chart', 0,Chart1Token);
         ORDCOM.InitArg();
         ORDCOM.SetArg(range, 'BSTR');
         i:=ORDCOM.GetProperty(WorkSheetToken,'Range', 1, RangeToken);
         ORDCOM.InitArg();
         ORDCOM.SetArg(RangeToken, 'DISPATCH');
         IF type='xlPie' THEN
              charttype := -4102;
         ELSIF type='xl3DBar' THEN
              charttype := -4099;
         ELSIF type='xlBar' THEN
              charttype := 2;
         ELSIF type='xl3dLine' THEN
              charttype:= -4101;
         END IF;
         ORDCOM.SetArg(charttype,'I4');
         i:=ORDCOM.Invoke(Chart1Token,'ChartWizard', 2, DummyToken);
         i:=ORDCOM.DestroyObject(RangeToken);
         i:=ORDCOM.DestroyObject(ChartObjectToken);
         i:=ORDCOM.DestroyObject(ChartObject1);
         i:=ORDCOM.DestroyObject(Chart1Token);
         RETURN i;
    END InsertChart;
    * Save the Excel File. WARNING: Do not specify a filename that already exist
    * since there is no graphical context, Oracle would not be able to pop
    * out a warning message for existing file. This causes Excel to hang
    FUNCTION SaveExcelFile(filename varchar2) return binary_integer IS
    BEGIN
         dbms_output.put_line('Saving Excel file...');
         ORDCOM.InitArg();
         ORDCOM.SetArg(filename,'BSTR');
         i:=ORDCOM.Invoke(WorkBookToken, 'SaveAs', 1, DummyToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         RETURN i;     
    END SaveExcelFile;
    * Close the Excel spreadsheet and exit from it
    FUNCTION ExitExcel return binary_integer is
    BEGIN
         dbms_output.put_line('Closing workbook and quitting...');
         ORDCOM.InitArg();
         ORDCOM.InitArg();
         ORDCOM.SetArg(FALSE,'BOOL');
         dbms_output.put_line('Closing workbook...');
         i:=ORDCOM.Invoke(WorkBookToken, 'Close', 0, DummyToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.DestroyObject(WorkBookToken);     
         ORDCOM.InitArg();
         dbms_output.put_line('Closing workbooks...');
         i:=ORDCOM.Invoke(WorkBooksToken, 'Close', 0, DummyToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.DestroyObject(WorkBooksToken);
         i:=ORDCOM.Invoke(applicationToken, 'Quit', 0, DummyToken);
         IF (i!=0) THEN
         ORDCOM.GetLastError(error_src, error_description, error_helpfile, error_helpID);
         dbms_output.put_line(error_src);
         dbms_output.put_line(error_description);
         dbms_output.put_line(error_helpfile);
         END IF;
         i:=ORDCOM.DestroyObject(WorkSheetToken);     
         i:=ORDCOM.DestroyObject(WorkSheetToken1);     
         i:=ORDCOM.DestroyObject(applicationToken);
         i:=ORDCOM.DestroyObject(ChartObjectToken);
         i:=ORDCOM.DestroyObject(Chart1Token);
         i:=ORDCOM.DestroyObject(ChartObject1);
         i:=ORDCOM.DestroyObject(dummyToken);
         RETURN i;
    END ExitExcel;
    END ORDExcelSB;
    /I have created an excel named as C:\Example.xls.
    Name     SlNo     Job     Dept     Salary     Bonus
    Saubhik Banerjee     706090     IT Specialist     GBS     100     10
    Partha S Mohanty     706091     Pogrmmer     APPS     70     20
    Partha Sarkar     889300     Condultant     FIN     200     30
    Useless     98009     PM     PM     900     90
    SQL> SET SERVEROUT ON
    SQL> DECLARE
      2 
      3    v_Name          varchar2(90);
      4    v_SlNo          varchar2(100);
      5    v_Job           varchar2(200);
      6    v_Dept          varchar2(100);
      7    v_recon_remark  varchar2(50);
      8    v_sal_amt_usd   number;
      9    v_Bonus_amt_usd number;
    10 
    11    result INTEGER;
    12 
    13    i        binary_integer;
    14    filename varchar2(255);
    15 
    16  BEGIN
    17 
    18    filename := 'C:\Example.xls';
    19 
    20    result := ORDExcelSB.CreateExcelApplication('');
    21    result := ORDExcelSB.OpenExcelFile(filename, 'Sheet1');
    22 
    23    /* Excluding the header row and reading the first 5 row */
    24    FOR n in 2 .. 5 LOOP
    25   
    26      v_Name          := ORDExcelSB.GetDataStr('A' || n);
    27      v_SlNo          := ORDExcelSB.GetDataReal('B' || n);
    28      v_Job           := ORDExcelSB.GetDataStr('C' || n);
    29      v_Dept          := ORDExcelSB.GetDataStr('D' || n);
    30      v_sal_amt_usd   := ORDExcelSB.GetDataNum('E' || n);
    31      v_Bonus_amt_usd := ORDExcelSB.GetDataNum('F' || n);
    32   
    33      dbms_output.put_line(v_Name || '  ' || v_SlNo || '  ' || v_Job || '  ' ||
    34                           v_Dept || '  ' || v_sal_amt_usd || '  ' ||
    35                           v_Bonus_amt_usd);
    36   
    37    END LOOP;
    38 
    39    result := ORDExcelSB.ExitExcel();
    40  EXCEPTION
    41    WHEN OTHERS THEN
    42      result := ORDExcelSB.ExitExcel();
    43      RAISE;
    44  END;
    45  /
    Creating Excel application...
    Invoking Workbooks...
    Opening Excel file C:\Example.xls ...
    Opening WorkBook
    Invoking WorkSheets..
    Invoking WorkSheet
    Opened
    Saubhik Banerjee  706090  IT Specialist  GBS  100  10
    Partha S Mohanty  706091  Pogrmmer  APPS  70  20
    Partha Sarkar  889300  Condultant  FIN  200  30
    Useless  98009  PM  PM  900  90
    Closing workbook and quitting...
    Closing workbook...
    Closing workbooks...
    PL/SQL procedure successfully completed.
    SQL> Although, You haven't asked, but you can use this code to write to excel file (.xls)
    DECLARE
    CURSOR c1 IS     
         SELECT empno, ename, dname, sal, hiredate
         FROM emp e, dept d
         WHERE e.deptno = d.deptno;
    error_message varchar2(1200);
    n binary_integer:=2;
    i binary_integer;
    filename varchar2(255);
    cellIndex varchar2(40);
    cellValue varchar2(40);
    cellColumn varchar2(10);
    returnedTime varchar2(20);
    currencyvalue double precision;
    datevalue DATE;
    empno binary_integer;
    looptext varchar2(20);
    error_src varchar2(255);
    error_description varchar2(255);
    error_helpfile varchar2(255);
    error_helpID binary_integer;
    begin
    filename:='c:\example2.xls';
    i:=ORDExcel.CreateExcelWorkSheet('');
    i:=ORDExcel.InsertData('A1', 'EmpNo', 'BSTR');
    i:=ORDExcel.InsertData('B1', 'Name', 'BSTR');
    i:=ORDExcel.InsertData('C1', 'Dept', 'BSTR');
    i:=ORDExcel.InsertData('D1', 'Salary', 'BSTR');
    i:=ORDExcel.InsertData('E1', 'HireDate', 'BSTR');
    For c1_rec IN c1 LOOP
    cellColumn:=TO_CHAR(n);
    cellIndex:=CONCAT('A',cellColumn);
    cellValue:=TO_CHAR(c1_rec.empno);
    empno:=cellValue;
    i:=ORDExcel.InsertData(cellIndex, empno, 'I2');
    cellIndex:=CONCAT('B',cellColumn);
    cellValue:=c1_rec.ename;
    i:=ORDExcel.InsertData(cellIndex, cellValue, 'BSTR');
    cellIndex:=CONCAT('C',cellColumn);
    cellValue:=c1_rec.dname;
    i:=ORDExcel.InsertData(cellIndex, cellValue, 'BSTR');
    cellIndex:=CONCAT('D',cellColumn);
    cellValue:=c1_rec.sal;
    currencyValue:=cellValue;
    i:=ORDExcel.InsertData(cellIndex, currencyValue, 'CY');
    cellIndex:=CONCAT('E',cellColumn);
    dateValue:=c1_rec.hiredate;
    i:=ORDExcel.InsertData(cellIndex, dateValue, 'DATE');
    n:=n+1;
    END LOOP;
    i:=ORDExcel.SaveExcelFile(filename);
    i:=ORDExcel.ExitExcel();
    EXCEPTION
    WHEN OTHERS THEN
      i:=ORDExcel.ExitExcel();
      RAISE;
    END;

  • Failed to retrieve data from the database. 42000(Microsoft)(ODBC SQL Server

    Failed to retrieve data from the database. 42000(Microsoft)(ODBC SQL Server Driver)(SQL Server)Line 1: Incorrect syntax near 's'

    Hi Diptesh,
       What is your crystal reports version ? CRXI or higher?
    And does your filter bject consists of apostrophie s fields?
    If this is the case then this is a known issue try installing the latest service packs or fix packs to see if it resolves the issue?
    Regards,
    Vinay

  • Extract Data from XML and Load into table using SQL*Loader

    Hi All,
    We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
    Your suggestion is highly appreciated.
    Thanks in advance

    Hi,
    First of all go to PSA maintanance ( Where you will see PSA records ).
    Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
    > Give the proper file name where you want to download and then-----> Generate.
    You will get ur PSA data in Excel Format.
    Thanks
    Mayank

  • Using RSCRM_BAPI to convert data from Query and load into PSA to DSO

    Hi Experts,
    I have a complex query which is being executed in BeX.
    I need to go in the reverse direction and extract the data from the Query and load into the PSA and then to a DSO.
    I am using RSCRM_BAPI for this purpose and have got data into the extract table successfully.
    But , my query has some variable screen wherein we need to give some inputs for selection.
    I have create those Infoobjects and put them in the DSO.
    How do I capture these inputs of  the selection screen for storing in fields of my DSO as the Extract table does not store these inputs  ???

    write the whole insert query desired by you with the help of excel formulas.they are very easy or google 'how to use excel formulas".
    then copy the fromula to whole set of data in excel fields.
    run the insert query in excel as batch.
    i hope this helps.

  • Extract the data from database and send to XI in form of file

    hi,
        I am working on a scenario in which i am to extract thew data from an ODBC database. and send it to Integration Engine using a file adapter. In this case which adapter i should use? If i go for file adapter then how i will extract the data and if i go for JDBCadapter then i can't send the data in the form of file which is my basic requirement.
    Can someone help me out.

    Hi,
    You can Use JDBC Adapter to pull the data from Dbase very well.
    Check this For Refference Use
    PERIODIC SCHEDULING OF DATA BETWEEN ORACLE DB & R/3 SYSTEM
    Regards
    Seshagiri

  • Extraction of data from SAP R/3 Bapi into SAP BW

    hi,
    i am extracting data from sap r/3 bapi into sap bw. can u please send me the link and documents of how to extract the data from bapi to sap bw.
    Answers will be rewarded
    Thanks
    sd shahid

    Hi Swapnali,
    In your case you have to send process order to XI and you have a bapi that satisfies your requirement.
    Here the solution depends what is the triggerring point of the Interface.
    If you want that from SAP side Interface should be triggered, then Use ABAP proxy program
    You have to craete a Abap proxy class using outbound message interafce defined in IR of XI.This can be done by transaction SPROXY.
    Then create a program that call sync/async method that is created by Sproxy t.code.
    In this way , when u will execute the proxy program in R/3 , then call will be made to BAPI in Sap from XI server and u will get output back to your proxy program.
    If your requirement is to not to trigger from SAP then nothing is required in R/3 side.
    In XI , Bapi will be added in imported objects in Integration repository and bapi will be called.
    Hope this will help u.
    Please revert in case of queries.
    Regards,
    Monica

  • How to fetch data from SolMan and move it into SAP BI?

    Hi all,
         I have the portal activity report data residing in the SolMan ( achieved by configuring portal and SolMan).  I need to extract this data from Solution Manager into SAP BI, such that i can report on the data in SAP BI using the BEx tools. How will i proceed with it ? Your response is higly appreciated.
    Regards,
    Divya.

    Hello Divya,
    You must set up E2E Diagnostics for the managed system (portal system).
    You can accomplish this by running transaction solman_setup  in the Sollution Manager and ensure that Initial and Basic Configurations are performed. Afterwards, you must follow the Managed System Configuration (also in solman_setup) for the managed system.
    Afterwards you must activate some specific Portal Activity Data Collectors following the note 1309740.
    Best regards,
    Guilherme Balbinot

  • What are the Major and Minor Diffs between oracle,sql server,MSAccess

    Hi all,
    Can any one explain or send me all the diff between
    oracle ,sql server,access..like how much data can each
    support,...
    Thanks

    Dear sir,
    here it is.
    http://www.oracle.com/database/product_editions.html

  • How to extract data from CLOB and insert them into DB?

    Hi PL/SQL Gurus,
    I have no experience in PL/SQL, but I have a requirement now where I have to use it.
    We have a table with 10 columns, one of them is a CLOB and it holds XML data. The XMLs are very huge in size.
    Two new columns are added to the table and the data has to be filled for the existing records from the corresponding XML. The XML has all the data as attributes. I started searching on the internet and tried if I could extract the data out of XML.
    SELECT extractValue(value(x), '/Order/Package/@Code',
    'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"' )
    FROM ORDER_TABLE A
    , TABLE(
    XMLSequence(
    extract(
    xmltype(A.XML_DATA)
    , '/ns0:Root'
    , 'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"'
    ) x;
    But this isn't working. Could anyone please provide some ideas.
    I just want to confirm that I am able to extract data. Once this is done I would like to create a procedure so that all the existing records can be updated.
    Thanks in advance.
    Regards,
    Fazzy

    Can this be acheived using a SQL statement.Yes, you can do it with the DML error logging clause.
    Here's a quick example I've just set up :
    Base table
    SQL> create table order_table (
      2   order_id number,
      3   package_code varchar2(30),
      4   package_desc varchar2(100),
      5   xml_data clob
      6  );
    Table created
    SQL> alter table order_table add constraint order_table_pk primary key (order_id);
    Table altered
    Adding data...
    SQL> insert into order_table (order_id, xml_data)
      2  values (1, '<?xml version="1.0" encoding="UTF-8"?>
      3  <ns0:Root xmlns:ns0="http://mycompany.com/Order/OrderType.xsd" BookingDate="2009-06-07">
      4  <ns1:OrderKey xmlns:ns1="http://mycompany.com/Order/OrderKeyTypes.xsd" SystemCode="THOMAS" Id="458402-TM1" Version="1"/>
      5  <ns0:Package Code="0001" Desc="ProductName1"/>
      6  <ns0:PromotionGroup Code="DSP" Name="OrderThomasPortal"/>
      7  <ns0:Promotion Code="TH902" Name="OrderThomasPortal" SellingName="OrderThomasPortal" BackOfficeName="OrderThomasPortal"/>
      8  <ns0:FinancialSupplier Code="HHT" Name="NYOrdSupp"/>
      9  <ns0:SellingCurrency Code="EUR" Name="Euro"/>
    10  <ns0:Owner ClientId="02654144" ClientMandator="T" ClientSystem="ROSY"/>
    11  <ns0:Agent PersonInAgency="5254" AgentCode="000009" CommissionAmount="2.8" CommissionDueDate="2009-07-01+02:00" VatOnCommission="0"/>
    12  </ns0:Root>');
    1 row inserted
    SQL> insert into order_table (order_id, xml_data)
      2  values (2, '<?xml version="1.0" encoding="UTF-8"?>
      3  <ns0:Root xmlns:ns0="http://mycompany.com/Order/OrderType.xsd" BookingDate="2009-06-07">
      4  <ns1:OrderKey xmlns:ns1="http://mycompany.com/Order/OrderKeyTypes.xsd" SystemCode="THOMAS" Id="458402-TM1" Version="1"/>
      5  <ns0:Package Code="0002" Desc="ProductName2/>
      6  <ns0:PromotionGroup Code="DSP" Name="OrderThomasPortal"/>
      7  <ns0:Promotion Code="TH902" Name="OrderThomasPortal" SellingName="OrderThomasPortal" BackOfficeName="OrderThomasPortal"/>
      8  <ns0:FinancialSupplier Code="HHT" Name="NYOrdSupp"/>
      9  <ns0:SellingCurrency Code="EUR" Name="Euro"/>
    10  <ns0:Owner ClientId="02654144" ClientMandator="T" ClientSystem="ROSY"/>
    11  <ns0:Agent PersonInAgency="5254" AgentCode="000009" CommissionAmount="2.8" CommissionDueDate="2009-07-01+02:00" VatOnCommission="0"/>
    12  </ns0:Root>');
    1 row inserted
    SQL> commit;
    Commit complete
    {code}
    Note that the second row inserted contains a not well-formed XML (no closing quote for the /Root/Package/@Desc attribute).
    *Creating the error logging table...*
    {code}
    SQL> create table error_log_table (
      2   ora_err_number$ number,
      3   ora_err_mesg$   varchar2(2000),
      4   ora_err_rowid$  rowid,
      5   ora_err_optyp$  varchar2(2),
      6   ora_err_tag$    varchar2(2000)
      7  );
    Table created
    {code}
    *Updating...*
    {code}
    SQL> update (
      2    select extractvalue(doc, '/ns0:Root/ns0:Package/@Code', 'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"') as new_package_code
      3         , extractvalue(doc, '/ns0:Root/ns0:Package/@Desc', 'xmlns:ns0="http://mycompany.com/Order/OrderType.xsd"') as new_package_desc
      4         , package_code
      5         , package_desc
      6    from (
      7      select package_code
      8           , package_desc
      9           , xmltype(xml_data) doc
    10      from order_table t
    11    )
    12  )
    13  set package_code = new_package_code
    14    , package_desc = new_package_desc
    15  log errors into error_log_table ('My update process')
    16  reject limit unlimited
    17  ;
    1 row updated
    SQL> select order_id, package_code, package_desc from order_table;
      ORDER_ID PACKAGE_CODE                   PACKAGE_DESC
             1 0001                           ProductName1
             2                               
    {code}
    One row has been updated as expected, the other has been rejected and logged into the error table :
    {code}
    SQL> select * from error_log_table;
    ORA_ERR_NUMBER$ ORA_ERR_MESG$                                                                    ORA_ERR_ROWID$     ORA_ERR_OPTYP$ ORA_ERR_TAG$
              31011 ORA-31011: XML parsing failed                                                    AAAF6PAAEAAAASnAAB U              My update process
                    ORA-19202: Error occurred in XML processing                                                                       
                    LPX-00244: invalid use of less-than ('<') character (use &lt;)                                                    
                    Error at line 5                                                                                                   
                    ORA-06512: at "SYS.XMLTYPE", line 272                                                                             
                    ORA-06512: at line 1                                                                                              
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Request shows in Red status after extraction of Data from Planning area

    Hi Experts,
    I am extracting data from DP planning area to APO BW Info Cube. It was working fine but from last few days after extraction we are getting Red status of that request. However whatever data packages we are extracting we are getting same in to Info Cube also. But only status of that request is in Red.
    I gone through step by step analysis I found "Data selection succesfully finished?" statement in Red status & rest are in green. When I gone through the details of this statement then I found Missing "Message:Selection Completed" in yellow status.
    Any Idea? How do i resolve this issue?
    Please advise..
    Regards
    Sujay

    Hi Sujay,
    Check the logs obtained after the extraction.
    This only will tell you fare idea for you to proceed further
    to resolve the error that has happened.
    Also check whether the extracted data is correct by
    random sampling of extracted data
    Regards
    R. Senthil Mareeswaran.

  • Extracting data from SAP and dumping it into Non SAP System

    Hi All,
    We have an MS based in house system.  For our business process improvement, we need to import our customer's data and dump it into our application that has SQL server database - Our customers are running SAP.  Wanted to find out what steps we need to follow from the design perspective... also I am assuming we wll need an access to our customer's system to  code RFCs - is that correct ? Any information will be highly appreciated.
    Thanks,
    Neelima.

    Hi,
    it's really hard to answer your question without additional knowledge of your landscape. SAP support many ways of integrations. One way is using RFC. You would simply call function modules from your .NET application using RFC library. Another way is using web services. You can easily expose any RFC enabled function module as web service (if you are on NetWeaver). Another solution is using REST interface. Recently, there have been many articles dedicated to this approach here on SDN. This can be pretty nifty solution. Another way is file based integration (IDocs or simple flat files transfered via FTP).
    Cheers

  • Read data from db and write it into the txt file

    hi all
    could anyone please help me regarding the following:
    i would like to read the data from database using sql query and the write the data into a text file.
    I am able to connect the db, run the query, create file...but not knowing how to write the data into the file.
    could anyone please help me out.
    thanks in advance
    regards
    sasasa
    Edited by: sasasa on Sep 14, 2009 8:57 AM

    i would like to read the data from database using sql query and the write the data into a text file.
    I am able to connect the db, run the query, create file...but not knowing how to write the data into the file.
    There must be something that I am missing.
    How is it possible to be able to navigate JDBC, run a query and create a file but not know how to write to it?

  • Import data from a Fixed Length File into Oracle database

    Hi,
    I would like to import data from a Fixed Length text file into a table using HTML DB application.
    As of now, i have a .sql file(that uses external table) to import the data into Oracle tables
    I would like to integrate this in my HTML DB application so that the user can directly import the data into the table.
    Sample data
    XXXYYYYZZZZZ
    Data should be read to table that has
    Col1 Col2 Col3
    XXX YYYY ZZZZZ

    Hi,
    I would like to import data from a Fixed Length text
    file into a table using HTML DB application.AFAIK, fixed length imports are not something you can do directly with the HTML DB tools or available APIs.
    As of now, i have a .sql file(that uses external
    table) to import the data into Oracle tables
    I would like to integrate this in my HTML DB
    application so that the user can directly import the
    data into the table.Any fixed-length data needs to have a specification associated with it that indicates which character position begins a new column and what each column represents. Some also include what datatype should be used for each of those.
    If you really want to do this I would suggest that you create a table that you can store the file spec in. It would probably have columns for field name, start position, length or end position, datatype and any alias/column name you might want to apply. You would then use this table in a PL/SQL procedure (probably a package with the main processing procedure and various supporting procedures/functions) to read the file into memory, apply the file spec to each line and then do inserts into your table.
    Obviously, this is just a concept or strategy. Implementing it will depend on your PL/SQL skills and determination. If you want to pursue this strategy I'm sure you can find some jump-starts by doing a search on the PL/SQL forum.
    This may not sound like an answer - but the answer is you need to code it to fit your requirements. Hope that helps.
    Earl

Maybe you are looking for