473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Sqlloader: All database in one single plain text file

Hi all,

I'm trying to use sqlloader to import a database with multiple
different tables which has been exported to one single plain text
file. No fixed lenght. Let's say database.txt is something like

fruits,orange,orange
fruits,banana,yellow
fruits,pear,green
users,John Doe,25,34,26th upper street,0, 12-2-2003
users,Fred Flinstone, 24,5,14th Downing Lane,1,1-7-2002

Is it possible to try an approach based on WHEN statements? I mean:

LOAD DATA
INFILE database.txt
FIELDS TERMINATED BY ','
WHEN (first field is 'fruits')
(name, color)
WHEN (first field is 'users')
(name, age, visits, address, active, since)

I only whant to know if it is possible or not, but will wellcome
advice in ctl file sintax.

Thanks in advance and best regards
Jul 19 '05 #1
4 5724
Hallo, BadMan,

look there to find the answer:

http://asktom.oracle.com/pls/ask/f?p...:3516903603571

best regards

Ralf
--
lo****@engineer.com (BadMan!) wrote in message news:<8e**************************@posting.google. com>...
Hi all,

I'm trying to use sqlloader to import a database with multiple
different tables which has been exported to one single plain text
file. No fixed lenght. Let's say database.txt is something like

fruits,orange,orange
fruits,banana,yellow
fruits,pear,green
users,John Doe,25,34,26th upper street,0, 12-2-2003
users,Fred Flinstone, 24,5,14th Downing Lane,1,1-7-2002

Is it possible to try an approach based on WHEN statements? I mean:

LOAD DATA
INFILE database.txt
FIELDS TERMINATED BY ','
WHEN (first field is 'fruits')
(name, color)
WHEN (first field is 'users')
(name, age, visits, address, active, since)

I only whant to know if it is possible or not, but will wellcome
advice in ctl file sintax.

Thanks in advance and best regards

Jul 19 '05 #2
lo****@engineer.com (BadMan!) wrote in message news:<8e**************************@posting.google. com>...
Hi all,

I'm trying to use sqlloader to import a database with multiple
different tables which has been exported to one single plain text
file. No fixed lenght. Let's say database.txt is something like

fruits,orange,orange
fruits,banana,yellow
fruits,pear,green
users,John Doe,25,34,26th upper street,0, 12-2-2003
users,Fred Flinstone, 24,5,14th Downing Lane,1,1-7-2002

Is it possible to try an approach based on WHEN statements? I mean:

LOAD DATA
INFILE database.txt
FIELDS TERMINATED BY ','
WHEN (first field is 'fruits')
(name, color)
WHEN (first field is 'users')
(name, age, visits, address, active, since)

I only whant to know if it is possible or not, but will wellcome
advice in ctl file sintax.

Thanks in advance and best regards


From looking at the notes and example in the 9.2 Utilities manual it
does not appear that sqlldr is really designed to load different sets
of data into multiple tables. The only expample takes portions of the
same input and places it into different tables, but the input data
format does not change.

It should however be easy to write a C program or Shell script to
split the input file into one file per table based on the first
delimited parameter being the table name: fruits.dat, users.dat,
etc.....

Perhaps a true sqlldr expert will see your post and have time to
respond if there is any practical way to feed multiple layouts to
multiple tables in a single job.

HTH -- Mark D Powell --
Jul 19 '05 #3
db*********@spamgourmet.com (Ralf) wrote in message news:<51**************************@posting.google. com>...
Hallo, BadMan,

look there to find the answer:

http://asktom.oracle.com/pls/ask/f?p...:3516903603571


Darn close to what I'm trying! Thank you very much endeed!

As I suspected, sqlloader doesn't seem designed for such task.

Best regards.
Jul 19 '05 #4
Ma*********@eds.com (Mark D Powell) wrote in message news:<26**************************@posting.google. com>...
From looking at the notes and example in the 9.2 Utilities manual it
does not appear that sqlldr is really designed to load different sets
of data into multiple tables. The only expample takes portions of the
same input and places it into different tables, but the input data
format does not change.
Yap.
It should however be easy to write a C program or Shell script to
split the input file into one file per table based on the first
delimited parameter being the table name: fruits.dat, users.dat,
etc.....
awk is the tool.

But I wanted to know if there was a way to use Oracle-native
platform-independent tools...

Perhaps a true sqlldr expert will see your post and have time to
respond if there is any practical way to feed multiple layouts to
multiple tables in a single job.


Thank you anyway!

Best regards from spain.
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Pat A | last post by:
We have a dilemma. We are storing our database password in an include file that resides outside of the web root. The password is in plain text. So, no one can get that password because it can't...
5
by: B-Dog | last post by:
I have an old dos program that uses dat files to store the data and I'm trying to convert to dotnet. I'd like to be able to import the data into an access database but I don't know which format...
27
by: Brett | last post by:
If I want to easily swap the database I'm using, what is the best method for developing that tier in my application? I'll have basically a 4 tier app: 1. presentation 2. business logic 3. data...
2
by: Netkiller | last post by:
#!/usr/bin/python # -*- coding: utf-8 -*- """ Project: Network News Transport Protocol Server Program Description: 基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子...
5
by: djhexx | last post by:
Hello. I have an ASP.NET application (C#) that I allow users to upload files. Files get stored in a SQL2005 database. The file data is stored in a varbinary(max) column. When the user uploads...
1
by: sainiamit25 | last post by:
Hi, I want to insert 8 lakh records into one table. Table has got around 25 columns. The table has got indexes but before insertion, the indexes are dropped and after the reocrds are run, the...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files into the database, rather than just onto the file-system. Well, most of the time, you wouldnt. In situations where your PHP application...
1
by: orajit | last post by:
Hi am calling sqlloader inlow shell script #!/bin/sh sqlldr scott/tiger control=ulcase1.ctl log=ulcase1.log retcode=`echo $?` case "$retcode" in 0) echo "SQL*Loader execution successful"...
4
by: BadMan! | last post by:
Hi all, I'm trying to use sqlloader to import a database with multiple different tables which has been exported to one single plain text file. No fixed lenght. Let's say database.txt is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.