Home » RDBMS Server » Server Utilities » Load Flat file to SQL table using SQL Loader - Very urgent
Load Flat file to SQL table using SQL Loader - Very urgent [message #73452] Tue, 04 May 2004 04:55 Go to next message
M.V.GOPAL REDDY
Messages: 12
Registered: February 2004
Junior Member
Dear Experts/Friends

help me to load flat file into SQL table using Sql Loader, I have foll Flat file, I want load to a
SQL table with all details with their headers for every row.

Flat file looks like

Module : System
Identifier : 1 RSB SLI 28/2
Operator : VSK
------------------------------------------------
Sub ID SL25 SL50 UR Str
------------------------------------------------
28K 1.098 0.553 50.4 24.3
28C 1.169 0.649 55.5 23.3
38K 1.178 0.593 50.4 23.1
------------------------------------------------
Module : System
Identifier : 2 RSB SLI 28/2
Operator : VSK
------------------------------------------------
Sub ID SL25 SL50 UR Str
------------------------------------------------
28K 1.141 0.608 53.3 24.3
44K 1.200 0.666 55.5 24.4
44C 1.189 0.649 54.6 25.4
------------------------------------------------

Above flat file I want load into SQL table, Sql table

I have created sql table like

CREATE TABLE CONV_DATA (
MODULE VARCHAR2(7),
IDENTIFIER VARCHAR2(15),
OPERATOR VARCHAR2(4),
SUBID VARCHAR2(5),
SL25 NUMBER,
SL50 NUMBER,
UR NUMBER,
STR NUMBER)

I want load flat file to above table, then table should
look like

Module Identifier Operator SubID SL25 SL50 UR STR
------------------------------------------------------
XXXX XXXX XXXX XX XX XX X XX
XXXX XXXX XXXX XX XX XX X XX
XXXX XXXX XXXX XX XX XX X XX
------------------------------------------------------
Re: Load Flat file to SQL table using SQL Loader - Very urgent [message #73473 is a reply to message #73452] Wed, 05 May 2004 21:44 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
It would be best if you could get a flat file in a standard columnar format. However, if you are stuck with this one there are some possibilities. If there are always the same number of physical rows for each logical record you can use CONCATENATE in your control file, followed by the number of physical rows to convert to one logical record. If not, then you may be able to use CONTINUEIF in your control file, to check, for example, whether to CONTINUEIF NEXT (1:6) <> 'Module'. Another option might be to load the data into a staging table and parse it out from there. You can find information and examples of CONCATENATE and CONTINUEIF in the Oracle on-line documentation.
Re: Load Flat file to SQL table using SQL Loader - Very urgent [message #73479 is a reply to message #73473] Sat, 08 May 2004 04:17 Go to previous messageGo to next message
M.V.GOPAL REDDY
Messages: 12
Registered: February 2004
Junior Member
ThanQ for the prompt resp. Mr.Barbara boehmer, I uploaded my flat file sucessfully to sql table with u r sugg's. Please let me know how to do this programmatically, this means If I am working in Forms, during runtime I want to upload the flat file into table like if i create a batch file to my code, how to call it in PLSQL OR FORMS.

Adv thanks
Vijay

T
Re: Load Flat file to SQL table using SQL Loader - Very urgent [message #73481 is a reply to message #73479] Sun, 09 May 2004 12:57 Go to previous message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
Please click on the link below for some java code by Tom Kyte that can be used to execute an operating system file from pl/sql.

Previous Topic: ora-2710
Next Topic: calling sqlldr from my oracle forms
Goto Forum:
  


Current Time: Mon Jul 01 16:41:21 CDT 2024