473,804 Members | 3,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,o range
fruits,banana,y ellow
fruits,pear,gre en
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 5765
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.go ogle.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,o range
fruits,banana,y ellow
fruits,pear,gre en
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.go ogle.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,o range
fruits,banana,y ellow
fruits,pear,gre en
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*********@spa mgourmet.com (Ralf) wrote in message news:<51******* *************** ****@posting.go ogle.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.go ogle.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
4921
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 be served up by the web server. So far, so good. The customer wants all of our passwords encrypted. So, how do I go about securely encrypting that password? If I use mcrypt, I have to store a key and an IV somewhere...and if those are in...
5
9441
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 the dat files are in. Here is the first few lines of the dat file. If anyone could help me figure out which type this is it would be greatly appreciated. ÿÿÿÿ ®   öf¨"ó Mr John Smithh Parkside Jewelers 1776...
27
1976
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 layer containing standard SQL compliant queries 4. any database I'm looking for the most efficient way to design tier 3. I can't use stored
2
2439
by: Netkiller | last post by:
#!/usr/bin/python # -*- coding: utf-8 -*- """ Project: Network News Transport Protocol Server Program Description: 基于数æ®åº“的新闻组,实现BBSå‰ç«¯ä½¿ç”¨NNTPåè®®æ¥è®¿é—®è´´å­ Reference: NNTPå议: http://www.mibsoftware.com/userkt/0099.htm 正则表达å¼ï¼š http://wiki.woodpecker.org.cn/moin/RegExpInPython#head-2358765384844ed72f01658cbcde24613d941e9d
5
2331
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 the file, I store it in a database. When a user requests to download a file, the file is retrieved from the database and then sent to them. The files go in there ok. This is how I store them:
1
2673
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 indexes are again created. But insertion of these records take around 5- 6 hours. As far as i know, sqlloader should not take this much time. Can anybody tell me what may be the cause of this problem? Is it related to autocommit in sqlloader? Do we need...
221
367773
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 wouldn’t. In situations where your PHP application needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in your database. This is generally considered to be the easiest and fastest way to store files. ...
1
8553
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" ;; 1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;; 2) echo "SQL*Loader exectuion exited with EX_WARN, see logfile" ;; 3) echo "SQL*Loader execution encountered a fatal error" ;;
4
251
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 something like fruits,orange,orange fruits,banana,yellow fruits,pear,green users,John Doe,25,34,26th upper street,0, 12-2-2003
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9582
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10580
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10335
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9157
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2993
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.