sql * loder [message #73832] |
Tue, 20 July 2004 22:25 |
nitin verma
Messages: 1 Registered: July 2004
|
Junior Member |
|
|
Hi!
I am nitin
Pl let me know How to convert data from foxpro to oracle using sol*loder utility
pl write in detail
waiting for your reply
Thanks
|
|
|
Re: sql * loder [message #73835 is a reply to message #73832] |
Wed, 21 July 2004 02:23 |
|
Barbara Boehmer
Messages: 9097 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
Use the FoxPro copy or list commands to export your FoxPro data to a delimited or fixed position file. Then create an Oracle table of the same structure. Then create a SQL*Loader control file to load the data (see the section on SQL*Loader in the Utilities Guide of the Oracle on-line documentation for details and options). Then run SQL*Loader, using the control file that you created.
Here is an example, using comma-delimited data:
-- contents of dept.csv:
10,ACCOUNTING,NEW YORK
20,RESEARCH,DALLAS
30,SALES,CHICAGO
40,OPERATIONS,BOSTON
--
-- create Oracle table to load data into:
scott@ORA92> create table dept2
2 (deptno number,
3 dname varchar2(14),
4 loc varchar2(13))
5 /
Table created.
--
-- contents of SQL*Loader control file dept_csv.ctl:
load data
infile 'dept.csv'
into table dept2
fields terminated by ','
trailing nullcols
(deptno, dname, loc)
--
-- load data:
-- (can be run from operating system
-- or from sql*plus using host command, as below)
scott@ORA92> host sqlldr scott/tiger control=dept_csv.ctl log=dept.log
--
-- results:
scott@ORA92> select * from dept2
2 /
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
4 rows selected.
Here is another example, using a fixed format file:
-- contents of dept.sdf:
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
--
-- create Oracle table to load data into:
scott@ORA92> create table dept2
2 (deptno number,
3 dname varchar2(14),
4 loc varchar2(13))
5 /
Table created.
--
-- contents of SQL*Loader control file dept_sdf.ctl:
load data
infile 'dept.sdf'
into table dept2
trailing nullcols
(deptno position (9:10),
dname position (12:25),
loc position (27:35))
--
-- load data:
-- (can be run from operating system
-- or from sql*plus using host command, as below)
scott@ORA92> host sqlldr scott/tiger control=dept_sdf.ctl log=dept.log
--
-- results:
scott@ORA92> select * from dept2
2 /
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
4 rows selected.
If you have any problems, you can check the log file that is generated.
|
|
|
Re: sql * loder [message #74477 is a reply to message #73835] |
Fri, 17 December 2004 21:44 |
raghuram
Messages: 4 Registered: June 2002
|
Junior Member |
|
|
sir
i have one .xls file. i have create table using sql.
then how load import the data from excel file .
regards
raghu
|
|
|
|
|
Re: sql * loder [message #74496 is a reply to message #74487] |
Mon, 20 December 2004 14:42 |
|
Barbara Boehmer
Messages: 9097 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
I don't have Excel, but I know there is an option to save the file as a comma delimited file. It may be called csv or txt or some such thing and it may be in a menu under save options or export options or some such thing, but it is there. I gave two complete examples of using SQL*Loader earlier in this thread, where you posted your question. There are also multiple examples in the Oracle online documentation. There is a large section on SQL*Loader in the Utilities Guide that is filled with explanations and examples. You can click on the link below to view that section. You may have to register with OTN (Oracle Technology Network), but it is free.
|
|
|