Server Utilities :: CSV File As Datafile In SQL Loader

Sep 5, 2010

1) can we use a CSV file as a Data file in any format (fixed, delimited...) of Sql loader. I tried, but not succeeded.

2) if not then tell me the reason for it....

3) Also tell me is there any restriction on using the file format for a datafile?

View 18 Replies


ADVERTISEMENT

Server Utilities :: Terminators And Datafile Of Sql Loader?

Jan 28, 2011

below query:

1) What are the terminators we can use and cant be used, except ','. eg - '|' - this shows error.

2) What are the file format can be used in DATAFILE other than txt file. Eg - excel, word... And how to terminate the values in that files...

View 3 Replies View Related

Server Utilities :: How To Load If Data Is In Control File As Well As In Datafile

Apr 8, 2010

I am using perl script to dynamically generate the control file.If I have data in the control file as well as in the datafile, how would i write the control file in that case. Is the below one correct?

load data
INFILE '*'
INFILE '/export/home/test/test.csv'
INSERT INTO TABLE EMP fields
terminated by "," optionally enclosed by '"'
trailing nullcols
( empno, empname, sal, deptno )
[code]....

Is there any way that if my control file contains half of the data and my data file contains the other half of the data can i club this data into a logical record in the control file to populate the DB?

My exact 2nd requirement is, my DB contains 5 cols and for 1 col the data is common(countryName) which i have to pass to the control file dynamically and the .csv file contains the data for the other four cols. How could i combine these in the ctrl file and populate the DB?

so if the DB contains CountryName, empid, ename, sal and dept..I will get the CountryName to the ctrl file and csv contains the data for empid, ename, sal and dept. How would i combine these data into a logical record and populate the DB?

View 12 Replies View Related

Server Utilities :: SQL Loader Not Creating Bad File?

Nov 11, 2011

My sql loader is returning a code 2 but not creating a bad file for the rejected records. also logs look good.

View 14 Replies View Related

Server Utilities :: SQL Loader And Control File

Mar 19, 2010

I'm having a problem with SQL loader and the control file. I want to load a delimited file. The script will eventually be automated where the file name is passed in to the script, it's not a static name.

It's a simple SQL loader Unix script that I have created as follows

Unix file called test_load

# Auto Load
#
#
export data_file=/dev/test_$1$2.csv;
export ORACLE_HOME=/u01/oracle/product/10.2.0;
export ORACLE_SID=XXX;
export PATH=$PATH:$ORACLE_HOME/bin;

sqlldr userid=XXX/XXX data=$data_file
control=/dev/cntrl/test.ctl
errors=99999
bad=/dev/bad/test_$1$2_$$.bad
log=/dev/logs/test_$1$2_$$.log

the top of my control file is as follows

load data
truncate
into table test
fields terminated by "|"
when record_type = 'AA'
(

running at the prompt ./test_load myload 20100319

The following error occurs

SQL*Loader-350: Syntax error at line 5.
Expecting "(", found keyword when.
when record_type = 'AA'
^

I believe the format of my control file is correct but for some reason it won't load.

View 10 Replies View Related

Server Utilities :: SQL Loader Control File Is Not Working

Jan 28, 2011

The reason "why sql loader's CONTROL FILE is not working, if that location has space in between"

E.g. - C:practice for sqlloadercontrol1.ctl

But it works if we remove the space in between the path as below:

E.g. - C:practice_for_sqlloadercontrol1.ctl

View 3 Replies View Related

Server Utilities :: Creating SQL Loader Ctl File With Over 1000 Columns?

Dec 3, 2010

Next week I will be getting an input file which will contain over 1000 data columns to be loaded into ORACLE. It's about 6,400 characters in length.

My question is...has ever created a huge ctl file like this to be used for SQLLoader, using so many columns? I will be sending certain columns(data) to certain tables, so it's not just going into 1. It will be about 6 tables.

View 39 Replies View Related

Server Utilities :: SQL Loader Unable To Open File Error?

Mar 9, 2012

I am recieving errors when trying to load the control file. The errors are as follows:

SQL*Loader-500 Unable to open file (homework.ctl)
SQL*Loader-553 file not found
SQL*Loader-559 SYstem error: The system cannot find the file specified.

My control file is located directly in the C drive (C:homework.ctl). The control file contains the following

LOAD DATA
INFILE 'c:country.dat'
APPEND INTO TABLE homework
fields terminated by ',' optionally encloded by '"'
(country, month, day)
WHEN (month='April')

The command I am entering is:

sqlldr system/password control=homework.ctl

I've tried c:homework.ctl, 'c:homework.ctl', and placing the file in the BIN folder of Oracle.

View 7 Replies View Related

Server Utilities :: SQL Loader Handling Different Date Formats In Same CSV File?

Jul 11, 2011

I have another interesting SQL Loader issue. I have created 2 prior topics RE: "Trapping SQL Loader summary counts" and "Using Sql Loader issue". This new issue is along the same lines, but unfortunately the same input csv file has a date field that is has a different input format..

The 10G Oracle Table looks like...
---------------------------
CREATE TABLE PTLIVE.MODULE_CSV_LOADS
( MODULE_ID NUMBER (20),
MODULE_TAGNUMBER VARCHAR2(100),
MODULE_SERIAL_NUMBER NUMBER (20,0),

[code]...

My initial control file looks like...
-----------------
OPTIONS (SKIP=1)
load data
infile 'J:GrowerRound_ModulesCrop2011ProcessedBatch_2011Jul12_081326_746563.csv'
BADFILE 'J:GrowerRound_ModulesCrop2011LogsBatch_2011Jul12_081326_746563.bad'

[code]...

The input csv data file (for this example) contains 3 records. The first is a heading record that is skipped. The 2nd record
is correct and the field entitled "GMT Date" contains a value of
"16/05/2011". The 3rd record, however, has a date of "2011/5/18", which get rejected by the above control file, as the output SQL Loader log indicates...

Record 2: Rejected - Error on table PTLIVE.MODULE_CSV_LOADS, column DATEPICKED.
ORA-01861: literal does not match format string

Now we will be receiving literally hundreds of these csv files and in testing I have found that when I open the csv file (the default is Excel), and Excel must alter its display, as all date appear 100% okay. However, upon opening the csv file with Wordpad, I discovered the dates in the same file had these 2 different formats. So the control file was attempting to concat the input csv file "GMT Date" in one format with the input "GMT_TIME" to load the output value into the Oracle table column
"DATEPICKED" ... but different date formats cause some records to be rejected.

It would be super if SQl Loader could use a IF clause or an OR clause to execute loading the date in one or more input formats. We only expect the 2 foramts DD/MM/YYYY or YYYY/MM/DD....however, there could be 6 different combinations in theory.

I thought about writing a Function or Procedure to analyst the input date and output a standard one to load into the Oracle column

View 11 Replies View Related

Server Utilities :: Sql Loader - Load Whole File In Oracle Table?

Oct 26, 2012

I am having query regarding sql loader. my data file is comm(,) seperated and I want to load the whole file in oracle table 'bill_temp' except 1st column data of data file.

e.g.
File name: bill_file.dat
fields seperated by comma ','
values are like
emp_id,emp_name,emp_sal,join_date
oracle table bill_temp having the below column:
emp_name,emp_sal,join_date

Here I want load the emp_name,emp_sal and join_date into oracle table bill_temp.
emp_id should not get loaded into table.

Is there any way to skip the loading of particular column data from data file into table?

View 12 Replies View Related

Server Utilities :: SQL Loader - Excel File Different Column Order Format?

May 8, 2011

I have an Excel spreadsheet that just had a format change. The fourth column is new. Order of columns in Excel is:

oldcol1
oldcol2
oldcol3
oldcol4
newcol
oldcol5

Sqlldr script is in order of the .csv file just listed. Oracle table is in order

oldcol1
oldcol2
oldcol3
oldcol4
oldcol5
newcol

When I run the sqlldr script, the information is loaded:

oldcol1
oldcol2
oldcol3
oldcol4
newcol in oldcol5

so that all the information is loaded incorrectly. Out side of having to change the table, is there anything I can do to make it load correctly?

View 8 Replies View Related

Server Utilities :: Flat File Tab Delimiter Import Messed Up With SQL Loader

Jan 4, 2012

I am trying to import data from below content.

Flat File

PARENTCHILDALIAS
PLAN_PCOTDefaultPlanning Customer
1001_BTPCOTDefaultGeneral Planning Customer
2000_BTPCOTDefaultNational Account Planning Customer
3000_BTPCOTDefaultDistributor Planning Customer
3010_BTPCOTDefaultEducation Planning Customer
3020_BTPCOTDefaultResearch Planning Customer
OPT1_PCOTDefaultOption 1 Planning customer
OPT2_PCOTDefaultOption 2 Planning customer
OPT3_PCOTDefaultOption 3 Planning customer

The problem here is , When you try to import to a table which has same columns . I skipped the first line when loading . The issue here is the second field is getting split in to the two columns . for e.g. :- Default goes to Child and Remaining goes to the Alias.

infarct there is a tab at the end of the each line. How to set the Sql loader settings correctly so that I can populated the end column in CHILD column only.!!!!

OPTIONS ( SKIP=1)
LOAD DATA
INFILE 'FlatFile.txt'
BADFILE ''FlatFile.bad'
DISCARDFILE ''FlatFile.dsc'

INTO TABLE "table"
FIELDS TERMINATED BY X'9'
OPTIONALLY ENCLOSED BY "''" TRAILING NULLCOLS
(PARENT,
CHILD,
ALIAS CONSTANT '')

View 5 Replies View Related

Server Utilities :: Load Selected Records From Flat File Using SQL Loader

Nov 24, 2011

Load the selected records from the flat file using SQL*Loader.

I have a flat file it's having 100 records, I want to load first 10 records from the file using SQL*LOADER.

View 8 Replies View Related

Server Utilities :: How To Load Date And Time From Text File To Oracle Table Through Sql Loader

May 31, 2010

what i miss to load date and time from text file to oracle table through sqlloader

this is my data in this path (c:externalmy_data.txt)

7369,SMITH,17-NOV-81,09:14:04,CLERK,20
7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
7566,JONES,02-APR-81,09:24:10,MANAGER,20
7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30

my table in database emp2

create table emp2 (empno number,
ename varchar2(20),
hiredate date,
etime date,
ejob varchar2(20),
deptno number);

the control file code in this path (c:externalctrl.ctl)

load data
infile 'C:externalmy_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)

this is the error :

C:>sqlldr scott/tiger control=C:externalctrl.ctl

SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:>

View 21 Replies View Related

Server Utilities :: Imp / Exp - Max Size Assigned To Datafile?

Jul 22, 2010

i have exp dump of size 1gb but when i tried to imp ,it showing error of space , it asking for space of 4gb. But i have 1gb on c: drive and 32gb on d: ,can i add datafile on d: locaion and what is max size i can assign to that datafile .

View 4 Replies View Related

Server Utilities :: Added A Datafile In Undo Tablespace

Apr 28, 2011

When I am importing, I get these errors

IMP-00019: row rejected due to ORACLE error 1
IMP-00003: ORACLE error 1 encountered
ORA-00001: unique constraint (XXXXXXXXXXXXXXXX) violated
Column 1 2
Column 2 OFFLINE
[code]....

I added a datafile in undo tablespace (its an ASM database). I doubt that since I added the datafile to undo tablespace, I am getting this error.

View -1 Replies View Related

Server Utilities :: Sql-524 / Partial Record Found At End Of Datafile

Aug 1, 2010

I have an excel table whose data i have to transfer in oracle.

I did the following steps:

1) converted excel data in CSV format.

2) Created a control file test.ctl

LOAD DATA
INFILE 'C:IDB Price List.csv'
BADFILE 'C:IDB Price List.bad'
DISCARDFILE 'C:IDB Price List.dsc'
INSERT INTO TABLE idb_price_list
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(group_no,type,description,amt,flag)

3) when i run the sql loader utility, i get an error "sql-524: partial record found at end of datafile"

View 5 Replies View Related

Server Administration :: Move File System Datafile To ASM

Oct 23, 2012

I mistakenly added a datafile to a tablespace which is asm, however the datafile was created in a default location and not the asm location:

alter tablespace pdaiidata1 add datafile '<filename>' size 2048M;

What I should have done:

alter tablepsace <tablespace_name> add datafile '+DATA1' size 2048M;

Is there any way to move this filesystem datafile into the asm tablespace? In previous Oracle versions, I've taken a tablespace offline, moved a datafile, renamed it, then brought the tablespace back online. Can I do something similar here in this situation?

View 4 Replies View Related

Server Utilities :: SQL Loader Is Missing

Feb 4, 2011

I installed oracle 10G complete so I can have everything. But now I cannot run sql loader. I check my oracle devsuitehome directory and I cannot find sqlldr.exe

I need to install sql loader separately? I can't find sql loader installer on web.

View 3 Replies View Related

Server Utilities :: SQL Loader - How To Implement

Jul 7, 2010

SQL Loader - How to implement/Best solution.

I have 3 tables with their columns:
- MASTER_TABLE - MASTER_ID, DATA;
- PARENT_TABLE_A - MASTER_ID, DATA;
- PARENT_TABLE_B - MASTER_ID, DATA.

And the file I need to import has lines like the ones below:

MMMASTER_TABLE1
PAPARENT_TABLE_A1
PBPARENT_TABLE_B1
MMMASTER_TABLE2
PAPARENT_TABLE_A2
PBPARENT_TABLE_B2
MMMASTER_TABLE3
PAPARENT_TABLE_A3
PBPARENT_TABLE_B3

The line means:

- 1 - M or P: indicates which table to insert: MASTER or PARENT;
- 2 - M or A or B: indicates MASTER, PARENT_A, PARENT_B;
- 3:18 - DATA.

Based on the values above, what I need to do is:

1. Load a line to MASTER_TABLE;
2. Load a line to PARENT_TABLE_A pointing to its relative line in MASTER_TABLE;
3. Load a line to PARENT_TABLE_B pointing to its relative line in MASTER_TABLE;
4. In the original file line, there is nothing I can use to join a MASTER line with a PARENT line.

The result would be:
MASTER_ID PARENT_DATA
1 PARENT_TABLE_A1
1 PARENT_TABLE_B1
2 PARENT_TABLE_A2
2 PARENT_TABLE_B2

I tried to use both: SEQUENCE and Sequence.NextVall (CurrVal) but they only work when using ROWS=1 and the file I need to load has millions of rows, so I need direct path loading.Also, I read about External Table, but it does not suit my needs because the Application server is not the same as Database server, which is needed by external tables.

in this case is better load the data to a temporary table and then insert to the other tables, I found almost the same question in the topic pointed by the link below: URL....

View 7 Replies View Related

Server Utilities :: Load WKT Using Sql*loader

Mar 10, 2010

I want to load geometry into a table using sql*loader. My datafile contains geometry defined as WKT URL...., a standard for geometry and also Oracle has a function called sdo_util.from_wktgeometry.If I'm using a separate 'insert into' statement using this function in sql*plus, there's no problem. But if I'm using the same function in my control-file for sql*loader import, I get a sql*loader-418 error: "bad datafile for column geometrie".

Why and how I can import WKT using sql*loader?

-- data file
id;geometrie
1;POINT(120123.123 485345.789)
2;LINESTRING(123456.01 482543.21, 125764.76 483444.11)
3;POLYGON((121121.22 484394.22, 122887.444 484721.48, 122911.098 486382.45, 121005.21 486592.01, 121121.22 484394.22),(121922.56 485333.23, 122010.22 485854.83, 121922.56 485333.23))
4;MULTIPOINT((120586 483958.33),(120635 483726.11))
5;MULTILINESTRING((117948 480284, 118215 481236),(118475 481604, 120462 482822))
6;MULTIPOLYGON(((123678 481948, 124654 485215, 123678 481948),(127321 488321, 124907 483921, 127321 488321)))
[code]....

View 15 Replies View Related

Server Utilities :: To Use SQL Loader In A Procedure

Nov 10, 2011

I want to use SQL loader in a procedure..will it be possible to use it in procedure and if yes then how..?

View 4 Replies View Related

Server Utilities :: SQL Loader With WHEN And DISCARD?

Sep 25, 2012

My data file contains records with RECORD_TYPE '01', '02', '03' and '04' in position (30:31) I use sql loader to load this data into a table. I need to load ONLY rows with RECORD_TYPE ='04'. I have to output all the other rows into a file, so I decided to use DISCARD file. Now, those with RECORD_TYPE ='4' have to be loaded into different columns depending on the value in position (267:268).

So, my ctl file should look something like:

WHEN (30:31) = '04'
into table MYDATA
WHEN (267:268) != 'O '
into table MYDATA
WHEN (267:268) = 'O '

and whatever is not '04' goes to discard file.

I tried to use

into table MYDATA
WHEN (30:31) = '04' and (267:268) != 'O '
into table MYDATA
WHEN (30:31) = '04' and (267:268) = 'O '

but I don't get the right result in terms of the discard file.

Is there any way to put together all these conditions?

View 3 Replies View Related

Server Utilities :: SQL Loader Loads Only 1 Record

Sep 21, 2011

The SQL loader somehow is loading only first record. The data file is a csv and the end of line character is a new line. Some text fields have multiple new lines.

Here is my control file

load data
infile '/home/devo/c0397105/RuleImport/testLoad/dummyLoad.csv'
Truncate
into table DUMMY_LOAD_TABLE
fields terminated by "," optionally enclosed by '"'
( ID "to_number(:ID)",REQUESTED_GROUP,PURPOSE,COMMENTS)
[code]........

We don't have Retail resource type as Dependent System now; the rule will be changed later when Dependent Systems can accept resource types other than application"

View 1 Replies View Related

Server Utilities :: SQL Loader Comma Delimiter

Dec 22, 2011

I am using sqlloader for loading the data into database by using csv file.My csv file is delimited by comma in that i am having a column which is having the , and line feeds targeted to load into a long data type.for example as below

descri,dfdfdfd,dfdfdf,
sdfsdf,
dfsdfd,

i want to move this column data into a single table column.But due to because of delimited "," it is splitting into number of columns

View 6 Replies View Related

Server Utilities :: DECODE Not Working While Using With SQL Loader?

Sep 18, 2010

I had a requirement of loading flatfile into staging table using SQL Loader, One of the columns in the the Flat file is having values FALSE or TRUE and my requirement is that I load 0 for FALSE and 1 for TRUE which can be achieved by simple DECODE function...I did use decode and tried to load several times but did not work.

INFILE 'sql_4ODS.txt'
BADFILE 'SQL_4ODS.badtxt'
APPEND
INTO TABLE members
FIELDS TERMINATED BY "|"

[code]...

I did try putting a trim as well as SUBSTR but did not work....the cloumn just doent get any values in the output (just null or say free space)

View 5 Replies View Related

Server Utilities :: SQL Loader Number Format

Aug 25, 2011

I have a small problem when I am trying to load data into a table using SQL Loader. The data I am trying to load should be a number, but it is in the format '999,999,999 USD'. When I try to load the data, I am getting an invalid number error, due to the USD (I have already accounted for the thousands seperators). My question is, how can I load the data as a number with USD in the format?

Sample Data(testfile.dat):

sample1, "342,2343,543 USD"
sample2, "564,324,465 USD"
sample3, "534,753,213 USD"
[code]....

View 4 Replies View Related

Server Utilities :: SQL Loader TRIM In WHEN Clause?

Apr 9, 2012

My control file is :

LOAD DATA
APPEND
INTO TABLE IPGITLREDATA WHEN ITL_REC_TYPE = 'D'
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
(

[code].....

The data file might have a value of " D " instead of "D" for ITL_REC_TYPE and ITL_REC_TYPE is in the WHEN clause. How can I check for the trimmed value of ITL_REC_TYPE in the WHEN clause ?

View 5 Replies View Related

Server Utilities :: Count Of Data In Sql Loader?

Aug 3, 2012

I want to populate totale number of record in the file. Usually i get 10000 records per file and i load them using sql loader.I want to also insert the number of records in file while loading the data in table.

How can i achive it.

structure of control file is

load data
BADFILE '/backup/temp/rajesh/RIO/BadFiles/FILENAME'
append into table ERS_RIO_SRC
TRAILING NULLCOLS
(
INSTALLATION_ID CHAR

[code]...

data

V5_RIO_5K7C|78967|172.16.43.153|RioLoginSrc.asp|0.375|01/08/2012 07:44:44.623|01/08/2012 07:44:45.000|V5_RIO_5K7C||||||||||
V5_RIO_5K7C|78968|172.16.43.150|RioLoginSrc.asp|0.187|01/08/2012 08:22:32.813|01/08/2012 08:22:33.000|V5_RIO_5K7C||||||||||

[code]...

table structure

CREATE TABLE ERS_RIO_SRC
(
INSTALLATION_ID VARCHAR2(50 BYTE) NULL,
TRANSACTION_ID VARCHAR2(50 BYTE) NULL,
SERVER_ID VARCHAR2(50 BYTE) NULL,
CLINICAL_TRANSACTION_ID VARCHAR2(255 BYTE) NULL,

[code]...

View 4 Replies View Related

Server Utilities :: Tuning SQL Loader Process

Jun 17, 2010

I have loaded 14324590 rows into target tables using sql*loader.I used below consideration during the load process.

1) direct=true,parllel=true
2) unrecoverable
3) disable all indexes and triggers.

But, sql loader takes 21 minutes to load 14324590 rows in database? tuning sql loader process? we cannot change data file because it has given by client.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved