Fastest way to load csv into oracle BE table
I have csv file which is having 10 million records in it . what is the fastest approach to load this data to oracle BE table .
I am using Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining options .
csv format
first_name,last_name,occupation,address
above all the fields are of varchar data type.
I have tried to use external table while inserting its taking too much time .
Thanks
hi,
You can use sql loader.
options (skip=1)
LOAD DATA
INFILE 'csv file path'
truncate /append
INTO table table_name
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
trailing nullcols
column name ,
column name,
column name
{code}
Create this file as ctl(control file.) on the lcoation where your csv file is.
Execute it by goint to the path where your csv file resides.
{code}
cmd
cd path where your csv file resides
sqllder userid=username/password@database name control=your_control_file_name
{code}
Similar Messages
-
How to Load the data from excel file(Extension is .CSV) into the temp.table
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinHello Sachin,
You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
Instead of copy values into forms you can save them in your temporary table.
Kind regards,
Alex
If someone's helpful or correct please mark it accordingly. -
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,
NabilFor 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; -
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,
GurpreetYes 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)
-
Searching for flash based forums, or a way to load forums into flash ?
Im searching for flash based forums, or a way to load forums into flash ? i found this
http://activeden.net/item/flash-forum/52576?page=1
Any ideas or recommendations would be greatly appreciatedYou can load the raw html - if flash is told (e.g. via
flashvars) the url of the page that you want (its available in
flash as what you would think of as the browser's 'view source'
style plain text) with either as2 or as3.
But you can't do full browser-style rendering of the content
because flash just can't do all that. You could parse the raw html
(probably a custom parser as I think the internal xml parser might
choke on some of the tags in html that are not closed such as
<br> etc) and just pick out bits of text or images that you
could display but you can't achieve an embedded browser.
Adobe's AIR might be more what you want - it has embedded
browser support- but it doesn't run inside a browser like flash. -
Can i use one interface to load data into 2 different tables
Hi Folks,
Can i use one interface to load data into 2 different tables(same schema or different schemas) from one source table with same structure ?
Please give me advice
Thanks
Raj
Edited by: user11410176 on Oct 21, 2009 9:55 AMHi Lucky,
Thanks for your reply,
What iam trying is ...Iam trying to load the data from legacy tables(3) into oracle staging tables.But i need to load the same source data into two staging tables(these staging tables are in two different schemas)
can i load this source data into two staging tables by using single standard interface(some business logic is there)
If i can then give me some suggestion how to do that
Thanks in advance
Raj -
Fastest way to load data From MS Access to Oracle DB
Hi All,
We get an Access DB every week which we need to load to an Oracle DB, currently we have been using SQL loader but the process is slightly painful and horribly boring, so m trying to do some automation kind of stuff. I was thinking of doing the whole thing using a java application and then schedule it to run it at some pre-decided time. The approach I took was to read the access file and then load it using PreparedStatements to the oracle DB. But going through various threads in the forum, i found that its going to b a bit too slow (and the record count in my tables is around 600,000). Can there be a better way to do this? anyone done something similar b4.Well the only reason I want to use Java (i may go for C#) is that i dont want to spend time manually creating those CSV files from Access. Can that be done using something else?So use java to create the CSV files.
And have you actually tried going straight to Oracle? What exactly is your time constraint?
And another issue is that I sometimes have to make some adjustments (rounding off) to the data which is usually through query, but that is usually done after the data has been loaded in the DB.Which would make it irrelevant to actually moving the data then. If you are cleaning the data with SQL already then it is simple to wrap that in a proc and do it that way. Presumably you are loading to temp (non-production in-lined) tables first, then cleaning and moving. -
Loading shapefiles into Oracle Spatial
Fellow Oracle Spatiallers!
Currently we edit Oracle Spatial data by checking data out into a shapefile,
making our changes off-line, and reloading the shapefile back into Oracle.
Instead of using the Oracle Spatial supplied tool, we decided to purchase
a utility called the "Spatial Loader" from a company called Geometry Pty Ltd
(http://www.geometryit.com). There are a number of reasons why we decided to
go that way which might become evident from the command line parameters of
this utility:
Usage: Shp2Spt [Arguments] [Options]
OR
Usage: Java com.geometryit.spatialloader.oracle.AdvancedJavaSpatialTranslator [Arguments] [Options]
[Arguments] must specify these values:
-o create
type of operation to perform
create creates a new table, must not exist already
recreate creates a new table, may exist already
init drops existing table, creates a new one
append appends data onto existing table
-f <shape_file>
the shape file or project to translate
-l <table,column>
target table and column for the geometry data
-D <database>
target database name
-u <username>
username for RDBMS
-p <password>
password for RDBMS
[Options] values are not necessarily required:
-s <server_name>
name of server with database
-port <port_number>
the port to connect to on the server
-ufi <column_name>
specify the name of the UFI field (unique ID)
-seq <sequence_name>
specify the sequence to use for the spatial data unique IDs
-a none
attributes mode
none no attributes will be transferred
all all attribtues will be transfered as found
file= file containing lines of the form:
<shape_attribute><space/tab><rdbms_column>
where
<shape_attribute> selects the column to be output
<rdbms_column> name of the column in RDBMS
-srid <id>
specify the Spatial Reference ID for the spatial data
(this must be set to use Spatial Reference Transformations)
-i [<level>] or -i rtree
create an index for the generated table
the <level> parameter is an optional integer
representing the depth of the quadtree created
if rtree is specified, the index created will be
an rtree
-c <commit_interval>
number of rows to commit after
-t <tolerance>
tolerance value for metadata
-r none
used to determine number of decimal places to round vertices to
if you use the tolerance-parameter option, specify the -t parameter before -r
-igc
ignore geometry collections
-sgc
split geometry collections
-sgd f
split geometry direction [forward | reverse]
-update-metadata <true/false>
update the Oracle Spatial Metadata table after loading data
-validate <true/false>
perform Oracle Spatial validation after loading data
-v
verbose mode on
-h or -?
display this help message
The main things I like about this tool are:
1. One step (no conversion to sqlloader form followed by a call to the sqlloader).
2. The ability to round the coordinates of the shapes in the shapefile by applying
the XY tolerance values held in the SDO_GEOM_METADATA table.
This is quite important because our editing package - due to double/single precision
issues - can actually move coordinates but those movements are sub the precision of
the actual data. By rounding to the nominate precision we can detect situations where
no actual change to the shape (and its attributes) was made and thus not create superfluous
revisions within the database.
3. It will correctly re-wind the coordinates of the outer/inner shells of polygons. This is
important as ESRI shapefiles are agnostic on the winding order: an outer shell coordinates
can be listed in either clockwise or anti-clockwise order.
4. You can specify the primary key (UFI) column (numeric) and an Oracle Sequence number such
that each new shape loaded can have its UFI assigned from that sequence.
Because of this flexibility, and the excellent support (it is a purchasable product) from the
developers, I can heartily recommend this loader to fellow Spatiallers. It is worth every
penny I spent on it. Try the free version on their website and if, like me, you like it,
purchase it!
regards
SimonHi Shuan,
As part of the zip file created for the next training course to be posted for Oracle Spatial on OTN (within the next few weeks) there is a free (unsupported, undocumented) version of a shape to sdo converter. This should work, but it is unsupported. It will create a layer that then needs to be migrated into 8.1.6 format.
If you need it quite soon send email to [email protected] and I can get it to you.
Hope this helps,
dan -
I want to load data into Oracle using XML & Java - hints??
I have a XML files that are created on a timed basis....they describe a photo and point to a dir where the photo is stored...like...
<image>
<user>bill</user>
<img>photo.jpg</img>
<img_dir>'/tmp/photos'</img_dir>
</image>
I'd like to write a Java program that parses the XML and loads the images, data into Oracle.
Suggestions on Oracle tools, downloads that will help me accomplish this???
Thanks!Depending on whether you want assistance in doing the insert into the database or whether you don't mind writing the JDBC code to perform the insert, you can get by with only our XML Parser for Java v2, which implements SAX, DOM, XPath, and XSLT standards. The latest beta release (2.1.0) supports SAX2 and DOM2.
If you want help inserting the XML into tables, then in addition to this, you might want our XML SQL Utility as well.
http://technet.oracle.com/tech/xml
Steve Muench
Lead Product Manager for BC4J and Lead XML Evangelist
Author, Building Oracle XML Applications
null -
Is there a simple script or series of SQL statements to import a CSV into either a new table or an existing table rather than using a utility? There must be some way to do it in SQL or PL/SQL.
That's the problem with using tools, like TOAD etc. to help you do stuff, as it doesn't help you to learn the basics.
Once you know how to do stuff from SQL*Plus then, fine, use a tool to do nitty gritty for you. The key to learning such a vaste area of expertise is to have a really good understanding of the basics first. So many people just use tools and struggle to do things because they just don't understand the underlying basics.
External tables are almost as simple as creating a basic table but you specify where the data is coming from and what the layout of that flat file is. After that you can just query it.
;) -
Fastest way to load a BufferedImage on a JPanel
I am looking for the fastest way to display a BufferedImage on a JPanel.
I am using JAI to take in photo files (JPG, BMP, GIF, TIFF, PNG) and create thumbnails (BufferedImage).
I was reading through the forums and saw you can either
1)overwrite the Graphics method or
2)imageicon->JLabel->JPanel
Currently, I am doing number 2, but I was wondering what the best way truly is.as you arn't doing any animation or that kind of thing, using Swing Components will work just fine.
-
Option 1:
Insert statement with:
table mode: NOLOGGING
insert mode: APPEND
archivelog mode: noarchive log mode
Option 2:
CTAS with NOLOGGING mode
Both options above would generate no redo log. Which one is better for performance? I'm loading large volume or rows (a few million) on a daily basis and this is a staging table so there is no problem to reprocess in case of failure.Jonathan,
> Insert /*+ append */ can optimise for indexes by capturing the necessary column values as the data is loaded and then creating the indexes without needing to re-read the table
How did you do to came to this conclusion?
I did a simple test (t2 has a single column index) and got the following trace files
1- Direct path load
insert /*+ append */ into t2
select * from t1
call count cpu elapsed disk query current rows
Parse 1 0.00 0.01 0 1 0 0
Execute 1 0.05 0.08 3 140 87 1000
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.05 0.09 3 141 87 1000
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 39
Rows Row Source Operation
1 LOAD AS SELECT (cr=140 pr=3 pw=3 time=84813 us)
1000 TABLE ACCESS FULL T1 (cr=5 pr=0 pw=0 time=92 us)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
control file sequential read 8 0.00 0.00
db file sequential read 2 0.00 0.00
direct path write 1 0.02 0.02
SQL*Net message to client 1 0.00 0.00
SQL*Net message from client 1 3.49 3.49
2- Conventional load
insert
into t2
select * from t1
call count cpu elapsed disk query current rows
Parse 1 0.01 0.00 0 1 0 0
Execute 1 0.02 0.00 1 22 275 1000
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.03 0.01 1 23 275 1000
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 39
Rows Row Source Operation
1000 TABLE ACCESS FULL T1 (cr=5 pr=0 pw=0 time=31 us)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 1 0.00 0.00
SQL*Net message to client 1 0.00 0.00
SQL*Net message from client 1 1.21 1.21
The trace file of the append hint contains a direct path write and a control file sequential read wait events confirming the direct path insert. But I still have not found in the trace file an indication on how the index is maintained separately from the table during a direct path load. Additionally I see that in both trace files there are two TABLE ACCESS FULL T1.
What I used to know is that during a direct path insert indexes are maintained differently from their table. Mini indexes are built on the incoming data and are finally merged with the physical index. But I don't see this also in the trace file.
However, In the append trace file there is the following select (occurring before the insert statement) that does not exist in the normal insert
select pos#,intcol#,col#,spare1,bo#,spare2
from
icol$ where obj#=:1
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 2 0.00 0.01 0 0 0 0
Fetch 4 0.00 0.00 0 7 0 2
total 8 0.00 0.01 0 7 0 2
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
1 TABLE ACCESS BY INDEX ROWID ICOL$ (cr=3 pr=0 pw=0 time=25 us)
1 INDEX RANGE SCAN I_ICOL1 (cr=2 pr=0 pw=0 time=21 us)(object id 40)
I am not sure if this has a relation with the mini-index pre-built data to be merged with the physical index.
That is my question : where to see this in the trace file?
Thanks
Mohamed Houri -
On our Oracle Server there are multipe XML files that I have to read and put the data into an ORACLE 10 table.
I have to threath these XML files one by one.
In the XML there is also een base64-stream (alwasys a WORD-document) . This base64-stream exists of 1.000.000 characters.
How can I read this base64-stream from the XML-file into a BLOB-column of my ORACLE 10 table
ORACLE 10
1 XML = +/- 1 MB
PL/SQL
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<slo xmlns="http://www.myschema.com/gasdedectie">
<LekKey>1999_036371_509627</LekKey>
<HuiNum>46</HuiNum>
<Res></Res>
<InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
<XWGS>3.637028</XWGS>
<YWGS>50.962667</YWGS>
<Pei>KESTENS</Pei>
<DatPei>1999-11-30T10:17:36.000+01:00</DatPei>
<Kan> </Kan>
<Doc>UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA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uc6KeCNLDi2GXQvUWPwV1U
9rG74F3Er+MrGqpL0TuPuXt1eymKgmxpaSaMy4Lp51QwdHpWDd11wprjuoh76PgqurE8HY3RqGnCvMaA
6VgCeiuMHD9B3ajdxJGhQrcWx0lkJcYSXbaByvE6Bg+dbuRF3pWCKhCDqrzSs25gAmFtmwTAbe1mZ0ce
+gtG+cFg125gAL00eqC809thFCd1K/Cu0AE0AiqaU9fSToyqDI+eHkGF+QFqfN4U17/KvlxzNEnnL9y7
4zmJFV25DiiXCo5+BR8Qn0Fz5y8nmuMWx1CA60M5p4YeD+E0L/w42JCE3j+H41t1jI5vbrU0HIPEwD+g
1x+aMnQ9+TocDQZSry13B8MrnlfFOj9AFJKcDryLbBN68o3GsEywVJU6mUkFVA5+vJQTKYwS6HSoj2vZ
wGOSZEn0uO0Ayz
pQQAALNCCQAAAA==</Doc>
</slo>If I understand your question correctly, the discussion in this thread
ORA-31167: 64k size limit for XML node
shows you do not have a lot of options.
As you are needing to extract the contents of a node from an XML document, and that node is > 64K, you are going to need to treat the entire XML as a CLOB and use CLOB functionality (aka INSTR, SUBSTR) to find and extract what you need.
Once your DB version is 11.1 or greater, then you can use the built-in that Billy mentions.
Note: mdrake is Mark Drake from Oracle. -
Load file into Oracle without staging area
Is it possible to change LKM to do this?
ThanksYes it is.
You can set the 'Work Schema' (staging) of your topology object to the same as your target (Data Schema), then all objects will be created in the target (C$ I$ etc), therefore no staging area is required - although this is not best practice.
If you want to remove the staging tables altogether, then you can alter the knowledge module to load directly into the target in your LKM. It depends on the method you are using (external tables, sqlloader for example). You IKM will also need amending to basically do nothing, but has to be present for the interface to work.
Cheers
Bos
Edited by: Bos on Apr 7, 2011 8:54 AM -
Sql* Loader syntax to load data into a partitioned table
Hi All,
I was trying to load data from a csv file to a partitioned table.
The table name is countries_info
columns :
country_code ,
country_name,
country_language
The column country_code is list partitioned with partition p1 for values 'EN','DE','IN' etc
and partition p2 for 'KR','AR','IT' etc.
I tried to load data into this table, but I was getting some error Message (not mapping to partitioned key).
I tried syntax
load data
infile 'countries.csv'
append
into table countries_info
partition(p1) ,
partition(p2)
fields terminated by ','
country_code ,
country_name,
country_language
What is the correct syntax- I searched a lot but have not been able to find out.Peeush_Rediff wrote:
Hi All,
I tried to load data into this table, but I was getting some error Message (not mapping to partitioned key).It's not some error message, it's relevant information for resolving problems you encounter while using Oracle.
In your case, although you didn't specifiy the exact ORA you recived, it sounds like [ORA-14400|http://forums.oracle.com/forums/search.jspa?threadID=&q=ORA-14400&objID=f61&dateRange=all&userID=&numResults=15&rankBy=10001]
What is the correct syntax- I searched a lot but have not been able to find out.It's not about correct syntax , it's about understanding message that was trying to tell you that something went wrong.
That message was (i guess) ORA-14400.
So, refering to that ORA message , you will need to add new partition ,
where the data from your csv file that currently don't map to any of the specified partition would fit ,
or add partition that would be able to accept data range in which value/s for which you received that ORA message could fit into.
Maybe you are looking for
-
I am giving the input below shows <to> <email>[email protected]</email> <email>[email protected]</email> </to> i will put the while loop and i count the index values. in while loop,it takes only one email id. my coding is <while condilition=('varinde
-
Duplex Printing in Crystal Reports
Post Author: Razzle00 CA Forum: General Where can I get some information or sample code on how to duplex print with crystal reports? Thanks, Razzle
-
My requirement is to update Pick quantity in the Delivery, which can be acheived via a BDC to VL02N transaction. But for obvious reason I am looking for some suitable FM or BAPI. I was looking at BAPI_OUTB_DELIVERY_CHANGE function module to change ou
-
Anyone figure out how to solve the 1015 error
anyone figure out how to solve the 1015 error
-
Just lost iphone 4 - how can I track it?
I just lost my iphone 4 - I tried calling it but goes straight to voice mail. I need to know if I can track it - I think I enable a setting that would allow me to do so, but I don't know where to start - I would appreciate any help you could give.