sql loader and plsql

greenspun.com : LUSENET : DBAzine : One Thread

Hello,

please i want to learn about sql loader import datafile to an oracle

table for oracle8 windows nt.

-- hakima (hizia_bam@yahoo.fr), July 16, 2001

Answers

I understand you want to load a data to ORCALE database a simple solution is here create a .bat file with the following comman sqlldr user/password@database file.ctl (file=you name it)

CREATE A .CTL FILE WITH FOLLOWING COMMAND (NAME THE FILE AS FILE.CTL IN ABOVE .BAT FILE) load data INFILE 'sourcedata.dat' (sourcedata.dat = flat file any name) INTO TABLE oracle_table (oracle_table=destination in oracle) APPEND (f1 position(01:01) char, f2 position(02:07) char, f3 position(08:08) integer external, f4 position(09:11) integer external, f5 position(12:21) char, f6 position(22:22) char, f7 position(23:28) char, f8 position(29:34) integer external, f9 position(35:44) integer external, f10 position(45:54) integer external, f11 position(55:55) char, f12 position(56:65) integer external, f13 position(66:75) integer external , f14 position(76:76) char, f15 position(77:80) char)

f1 to f15 are name of fields in your .ctl file

SOURCEDATA THIS IS THE 'sourcedata.dat' IN ABOVE MENTIONED .CTL FILE IT IS A FIXED FORMAT 80 COLUMN RECORD FILE EACH FILED HAVING FIXED LENGTH (DATA CONTENT ARE MENTIONED AS POSITION(00:00) IN ABOVE .CTL FILE

T002798007007425120 44289230040200007726000000774410 00000018100000018100 2101 R032020007007423635 44003230040200000025760000002576 00000000000000000000 0099 E0420670070000325795 44289530040200002232430000223243 00000000000000000000 2101 Q042588007000214366 44294730040200001387310000138731 00000000000000000000 2125

-- m arshad ansari (arshadansari@hotmail.com), June 30, 2002.


Moderation questions? read the FAQ