Doubts about SQL*LOADER
Hi,
First doubt:
When I execute the SQL*LOADER the following error occurs:
SQL*LOADER-350: Erro de sintaxe na linha 6.
Esperando especificagco de coluna valida, ", ou ")"; localizado "VARCHAR2".
(NAME POSITION(01:64) VARCHAR2,
^
The control file is like this:
ARQUIVO1.CTL
LOAD DATA
INFILE 'C:\testes\ARQUIVO1.TXT'
BADFILE 'C:\testes\ARQ1_ERRO.TXT'
TRUNCATE
INTO TABLE CARLA.TEMP_TESTE
(NAME POSITION(01:64) VARCHAR2,
ENDERECO POSITION(65:81) VARCHAR2,
TELEFONE POSITION(82:95) VARCHAR2)
Somebody, knows what happens?
Second doubt: How can I execute sqlldr in a procedure? Is there any command that simulates the DOS line command? Is there any example?
Thanks
Carla
Here are a couple of links to pages on Tom Kyte's site. The first one shows how to use java to enable execution of an operating system file from pl/sql. Just store your SQL*Loader commands in a .bat file and use Tom's code to enable execution of the .bat file from pl/sql. The second one uses utl_file that acts like a "mini sqlloader" in pl/sql and includes an example that demonstrates some data validation, checking for numeric values. I have used both methods succesfully. For large files, SQL*Loader is much faster than utl_file.
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:952229840241
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:464420312302
Similar Messages
-
how load LOB Data into database?
I already saw oracle8i documents about sql*load. in general, lob fields in samples are less than 4000
How load data >4000 into lob ?
nullI already knew the solution of the problem,but I met another problem.
I checked my sql 7 database again, I found large columns are ntext datatype. I changed the ntext to text and migrated data again. In SQL*PLUS ,I found the data of clob columns change to '????.?-?'. I know this is caused by NLS_LANG, my NLS_LANG=simplified chinese_china.zhs16gbk. How do i set my nls_lang to get the right data?
null -
Pls any one can tell about sql loader in linux?
Pls any one can tell about sql loader in linux
Hi,
I don't think it matters which OS, sqlloader works the same for all OS. If you want more information, read first the manual: http://download.oracle.com/docs/cd/E11882_01/server.112/e16536/ldr_concepts.htm#i1005437
Herald ten Dam
http://htendam.wordpress.com -
Doubt in sql loader regarding TOM's reply
Hi,
My question is at the last line. But u need to go through this to understand my problem.
Hi Tom,
I want to load some input files delimited by Text into Oracle database. Can you
please help me out in this.
I know one way of doing it is using SQLLOADER writing the control files and give
the control file as input to SQLLOADER.
After loading into the table I take data from the table and
process the data as per the requirements, load into different table.
Here my qwestion is these alli the input files will be placed in a public
folders. All the users will place these files into
this common folder. My job is, I need to load this data into
different table as per the requirements. If I use SQLLOADER
I need to create the control files for each input file I load.
I want to load all the files at a time say in the night by running a Job at a
specified time.
All the input files will be in the same format means corresponds to one table.
What are all the possible ways and can you give some example solutions for this.
Thanks in advance..Thanks a lot
Arun Tummala
and we said...
If they are all going into the same table and they all have the same format
(columns in the same order) you only need 1 control file.
Since you use the term "folder" I'll assume you are on Windows. Here is an
example command that will use a single ctl file to load all of the .dat files in
a directory:
C:\oracle\RDBMS\demo\test>for %f in ( *.dat ) do sqlldr tkyte/tkyte data.ctl
data=%f
you'll see the following on your screen if there where 2 dat files to be loaded,
data1.dat and data2.dat:
C:\oracle\RDBMS\demo\test>sqlldr tkyte/tkyte data.ctl data=data1.dat
SQL*Loader: Release 8.1.6.0.0 - Production on Sun Nov 19 09:25:11 2000
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Commit point reached - logical record count 7
C:\oracle\RDBMS\demo\test>sqlldr tkyte/tkyte data.ctl data=data2.dat
SQL*Loader: Release 8.1.6.0.0 - Production on Sun Nov 19 09:25:11 2000
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Commit point reached - logical record count 7
C:\oracle\RDBMS\demo\test>
You do not need to put the filename into the ctl file -- you can pass it in on
the command line.
My Question
C:\oracle\RDBMS\demo\test>for %f in ( *.dat ) do sqlldr tkyte/tkyte data.ctl data=%f
When i use the above command "for %f in ........ " from my unix prompt i am not able to work it out. It works fine for windows
Can anyone help me how to use the above mentioned command on the unix prompt.
Thanks,Hi Laurent,
I am using k-shell prompt.
I have used what u have said but its not working....
for f in *.dat
do sqlldr data.ctl data=$f
done
I need to use this command at the ksh prompt. But i am getting an error.
syntax error: "done unexpected"
Thanks in advance.......... -
Doubt with SQL loader file wih spaces
I have a doubt, i am using following file where delimiter are spaces like
919879086475 11-17-2004 11-20-2004
919879698625 11-17-2004 11-17-2004
919879698628 11-17-2004 11-17-2004
the control file, i am using is like:-
load data
infile 'c:\ran\temp\pps_fc.txt'
into table bm_05oct06
fields terminated by ","
(mobile_no, fcal, frdate )
which would probably not work. What should the control file be like where delimiter are spaces or tab.
I hope, my question is clear. Please help, in solving the doubt.
regards.Replace the "," with single white space
load data
infile 'c:\ran\temp\pps_fc.txt'
into table bm_05oct06
fields terminated by " "
(mobile_no, fcal, frdate ) -
hi i don't know is it a baseless question as i never tried it asking this question---
i have a .ctl file to load data as--
load data
infile 'c:\data\mydata.csv'
into table emp
fields terminated by "," optionally enclosed by '"'
( empno, empname, sal, deptno )
now i want to use the column say empno where i want to pass value when i use it as
sqlldr userid=' ' control=.ctl csv=.csvI would suggest u to use external table concept to solve the problem.
An external table can always be used like any normal Data Base table.
For example :-
Data is to be loaded in table countries having columns as
country_code VARCHAR2(5)
country_name VARCHAR2(50)
country_language VARCHAR2(50)
Create a directory object as belows
CREATE OR REPLACE DIRECTORY EXT_TABLES AS 'C:\temp\';
Now create external table with the same structure as the file present in the directory C:\temp & it needs to be loaded to Data Base table.
CREATE TABLE countries_ext (
country_code VARCHAR2(5),
country_name VARCHAR2(50),
country_language VARCHAR2(50)
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY ext_tables
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
MISSING FIELD VALUES ARE NULL
country_code CHAR(5),
country_name CHAR(50),
country_language CHAR(50)
LOCATION ('Countries1.txt','Countries2.txt')
PARALLEL 5
REJECT LIMIT UNLIMITED;
Now use the below mentioned query to load the Data in table countries like
Insert into countries
select country_code ,
country_name ,
country_language
from countries_ext
where (country_code ,
country_name ,
country_language)
not in
(select country_code ,
country_name ,
country_language
from countries); -
Good day,
I am new in data moving and I need help from you guys.
Here are Queries:
1. Is it possible to use more than one delimiters when terminating fields?
Eg. .....
FIELDS TERMINATED BY ',' OR ';' OR ':'
2. If possible, how can I solve this problem?
Say we have text file with the data like this>
251, John , Key ; 58 ; 96544
where COL1=251, and COl2=John,COL3=Key,COL4=58 and COL5=9654
That's all I wanna know. Thanks a lot
Regards
TalifhaniYou can specify the delimiter for each column separately
http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96652/ch12.htm#1002860 -
Check data before loading through SQL *Loader
Hi all,
I have a temp table which is loaded through SQL*Loader.This table is used by a procedure for inserting data into another table.
I get error of 0RA-01722 frequently during procdures execution.
I have decided to check for the error data through the control file itself.
I have few doubts about SQL Loader.
Will a record containing character data for column declared as INTEGER EXTERNAL in ctrl file get discarded?
Does declaring column as INTERGER EXTERNAL take care of NULL values?
Does a whole record gets discarded if one of the column data is misplaced in the record in input file?
Control File is of following format:
LOAD DATA
APPEND INTO TABLE Temp
FIELDS TERMINATED BY "|" optionally enclosed by "'"
trailing nullcols
FILEDATE DATE 'DD/MM/YYYY',
ACC_NUM INTEGER EXTERNAL,
REC_TYPE ,
LOGO , (Data:Numeric Declared:VARCHAR)
CARD_NUM INTEGER EXTERNAL,
ACTION_DATE DATE 'DD/MM/YYYY',
EFFECTIVE_DATE DATE 'DD/MM/YYYY',
ACTION_AMOUNT , (Data:Numeric Declared:NUMBER)
ACTION_STORE , (Data:Numeric Declared:VARCHAR)
ACTION_AUTH_NUM ,
ACTION_SKU_NUM ,
ACTION_CASE_NUM )
What changes do I need to make in this file regarding above questions?Is there any online document for this?<br>
Here it is -
How do I skip footer records in Data file through control file of sql*loade
hi,
I am using sql*loader to load data from data file and i have written control file for it. How do i skip last '5' records of data file or the footer records to be skiped to read.
For first '5' records to be skiped we can use "skip" to achieve it but how do i acheive for last '5' records.
2)
Can I mention two data files in one control file if so what is the syntax(like we give INFILE Where we mention the path of data file can i mention two data file in same control file)
3)
If i have datafile with variable length (ie 1st record with 200 charcter, 2nd with 150 character and 3rd with 180 character) then how do i load data into table, i mean what will be the syntax for it in control file.
4)if i want to insert sysdate into table through control file how do i do it.
5) If i have variable length records in data file and i have first name then white space between then and then last name, how do i insert this value which includes first name and last name into single column of the table.( i mean how do you handle the white space in between first name and last name in data file)
Thanks in advance
ramYou should read the documentation about SQL*Loader.
-
Problem with loading file with SQL loader
i am getting a problem with loading a file with SQL loader. The loading is getting
terminated after around 2000 rows whereas there are around 2700000 rows in the file.
The file is like
919879086475,11/17/2004,11/20/2004
919879698625,11/17/2004,11/17/2004
919879698628,11/17/2004,11/17/2004
the control file, i am using is like:-
load data
infile 'c:\ran\temp\pps_fc.txt'
into table bm_05oct06
fields terminated by ","
(mobile_no, fcal, frdate )
I hope, my question is clear. Please help, in solving the doubt.
regards.So which thread is telling the truth?
Doubt with SQL loader file wih spaces
Are the fields delimited with spaces or with commas?
Perhaps they are a mixture of delimiters and that is where the error is coming in? -
Hi
i have some question about SQL Loader. i have to find answers but did not get from Google or Documentation. i want to know that is there any way to check whether Sql loader inserting records with Direct path or Conventional path. As we know there are restriction in Direct load. Direct-path inserts do not support all objects that conventional inserts do. Their functionality
is restricted. If the database engine is not able to execute a direct-path insert, the operation is silently converted into a conventional insert. i have instruct Sql loader to insert using Direct=true and parallel as well. but it take 15 mint to loader 4 million record in table. i have observed its transfer rate is bit slow. i have oracle 11R2 on windows 2008 with 40GB RAM and SAN. how can i verify during execution either Sql loader load user Direct path or silently converted it conventional path. here is my sample control file. function used in control file will convert direct path to conventional?
/c sqlldr userid='MSNV5Star/Aa123456@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=srv01)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl)))' control='C:\ControlFile.txt' log='C:\ Final Data.log' bad= 'C:\ Final Data.bad' direct=true PARALLEL=TRUE skip=1 Errors=5000000
LOAD DATA
INFILE 'C:\adeel loading\in\A06052010.txt'APPEND
INTO TABLE GN_FILE_DATA_TABLE
FIELDS TERMINATED BY " " TRAILING NULLCOLS
Operational_Date "to_date(:Operational_Date, 'YYYYMMDD')" ,
Store_Code "TRIM(:Store_Code)" ,
Txn_Void_Flag "TRIM(:Txn_Void_Flag)" ,
Txn_Staff_Flag "TRIM(:Txn_Staff_Flag)" ,
Txn_Aborted_Flag "TRIM(:Txn_Aborted_Flag)" Edited by: Oracle Studnet on May 30, 2011 7:18 AMPl do not post duplicates - sql Loader Performance
Srini -
Import and process larger data with SQL*Loader and Java resource
Hello,
I have a project to import data from a text file in a schedule. A lager data, with nearly 20,000 record/1 hours.
After that, we have to analysis the data, and export the results into a another database.
I research about SQL*Loader and Java resource to do these task. But I have no experiment about that.
I'm afraid of the huge data, Oracle could be slowdown or the session in Java Resource application could be timeout.
Please tell me some advice about the solution.
Thank you very much.With '?' mark i mean " How i can link this COL1 with column in csv file ? "
Attilio -
Sql loader function attachment....
Hello all,
I have a doubt on sql loader....
Now i'm having like below tables..
TableA
empno|ename
1|A
2|B
3|C
Table B
salary|empno
10|1
12|2
14|3
My requirement is, in my data file instead of empno i'm having ename. Now, I need to right a function where if in datafile ename is A its should update 1 in that empno field.
Please guide me to achieve this...
I am new to technical... So i'm not confortable in writing...
I come to know that we can attach the function in to sql loader..
select statement in sql loader
Thanks and Regards,
MuthuBy using last update function, I modified the control file like below.
load data
infile *
into TABLE AP_SUPPLIER_SITES_INT
REPLACE
fields terminated by ","
OPTIONALLY ENCLOSED BY '"'
VENDOR_INTERFACE_ID "VDR_INF_F(':CUSTOMER_NUM','9999')",
VENDOR_SITE_INTERFACE_ID "(ap_supplier_sites_int_s.NEXTVAL)",
LAST_UPDATE_DATE "SYSDATE",
LAST_UPDATED_BY,
VENDOR_SITE_CODE,
CREATION_DATE "SYSDATE",
CREATED_BY,
PURCHASING_SITE_FLAG,
PAY_SITE_FLAG,
ADDRESS_LINE1,
ADDRESS_LINE2,
ADDRESS_LINE3,
CITY,
STATE,
ZIP,
COUNTRY,
PHONE,
FAX,
PAYMENT_METHOD_LOOKUP_CODE,
TERMS_ID,
CREATE_DEBIT_MEMO_FLAG,
HOLD_UNMATCHED_INVOICES_FLAG,
EMAIL_ADDRESS,
MATCH_OPTION,
EXCLUDE_FREIGHT_FROM_DISCOUNT,
INVOICE_CURRENCY_CODE,
PAYMENT_CURRENCY_CODE,
COUNTRY_OF_ORIGIN_CODE,
FREIGHT_TERMS_LOOKUP_CODE,
PAY_GROUP_LOOKUP_CODE,
PAY_DATE_BASIS_LOOKUP_CODE,
ALWAYS_TAKE_DISC_FLAG,
ORG_ID
begindata
1005,,SYSDATE,1132,Test MA Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1005,,SYSDATE,1132,Test MA Site_2,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1005,,SYSDATE,1132,Test MA Site_3,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1006,,SYSDATE,1132,Test1 M Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
1007,,SYSDATE,1132,Test1 B Site_1,SYSDATE,1132,Y,Y,No#907 62nd Street ,10th Sector,KK Nagar,Chennai,TamilNadu,600078,IN,+91 44 33333333,044 40404040,CHECK,10000,Y,N,[email protected],R,Y,INR,INR,IN,TBD,STANDARD,DISCOUNT,Y,120
*Now I am getting different error like below. Please look that error and give me your suggestion...*
Table "AP"."AP_SUPPLIER_SITES_INT", loaded from every logical record.
Insert option in effect for this table: REPLACE
Column Name Position Len Term Encl Datatype
VENDOR_INTERFACE_ID FIRST * , O(") CHARACTER
SQL string for column : "VDR_INF_F(':CUSTOMER_NUM','9999')"
VENDOR_SITE_INTERFACE_ID NEXT * , O(") CHARACTER
SQL string for column : "(ap_supplier_sites_int_s.NEXTVAL)"
LAST_UPDATE_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
LAST_UPDATED_BY NEXT * , O(") CHARACTER
VENDOR_SITE_CODE NEXT * , O(") CHARACTER
CREATION_DATE NEXT * , O(") CHARACTER
SQL string for column : "SYSDATE"
CREATED_BY NEXT * , O(") CHARACTER
PURCHASING_SITE_FLAG NEXT * , O(") CHARACTER
PAY_SITE_FLAG NEXT * , O(") CHARACTER
ADDRESS_LINE1 NEXT * , O(") CHARACTER
ADDRESS_LINE2 NEXT * , O(") CHARACTER
ADDRESS_LINE3 NEXT * , O(") CHARACTER
CITY NEXT * , O(") CHARACTER
STATE NEXT * , O(") CHARACTER
ZIP NEXT * , O(") CHARACTER
COUNTRY NEXT * , O(") CHARACTER
PHONE NEXT * , O(") CHARACTER
FAX NEXT * , O(") CHARACTER
PAYMENT_METHOD_LOOKUP_CODE NEXT * , O(") CHARACTER
TERMS_ID NEXT * , O(") CHARACTER
CREATE_DEBIT_MEMO_FLAG NEXT * , O(") CHARACTER
HOLD_UNMATCHED_INVOICES_FLAG NEXT * , O(") CHARACTER
EMAIL_ADDRESS NEXT * , O(") CHARACTER
MATCH_OPTION NEXT * , O(") CHARACTER
EXCLUDE_FREIGHT_FROM_DISCOUNT NEXT * , O(") CHARACTER
INVOICE_CURRENCY_CODE NEXT * , O(") CHARACTER
PAYMENT_CURRENCY_CODE NEXT * , O(") CHARACTER
COUNTRY_OF_ORIGIN_CODE NEXT * , O(") CHARACTER
FREIGHT_TERMS_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_GROUP_LOOKUP_CODE NEXT * , O(") CHARACTER
PAY_DATE_BASIS_LOOKUP_CODE NEXT * , O(") CHARACTER
ALWAYS_TAKE_DISC_FLAG NEXT * , O(") CHARACTER
ORG_ID NEXT * , O(") CHARACTER
value used for ROWS parameter changed from 64 to 30
Record 1: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 2: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 3: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 4: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Record 5: Rejected - Error on table "AP"."AP_SUPPLIER_SITES_INT", column VENDOR_INTERFACE_ID.
ORA-06553: PLS-306: wrong number or types of arguments in call to 'VDR_INF_F'
Thanks and Regards,
Muthu -
What would be the maximum datafile size that can support sql*loader
Hi,
I would like to load datafile from xls file which nearly 5 gb into oracle table by using sql*loader. Could you please tell me how much is max datafile size we can load by using sql*loader?
Thanks
VAMSHIHello,
The Size limit is mainly given by the OS. So you should care about what the OS could support as SQL*Loader files are unlimited on *64 Bit* but limited to *2GB* in *32 Bit* OS:
http://download.oracle.com/docs/cd/E11882_01/server.112/e10839/appg_db_lmts.htm#UNXAR382
Else, you should be able to load these data into the Table. So you must check that you have enough place inside the Tablespace and/or the Disk (if the Tablespace has to be extended).
Please find enclosed a link about SQL*Loader and scroll down to Limits / Defaults:
http://www.ordba.net/Tutorials/OracleUtilities~SQLLoader.htm
Hope this help.
Best regards,
Jean-Valentin -
is there anyone who can tell me if SQL*Loader has a filesize restriction on the datafiles loaded?
Thx!Hello,
The Size limit is mainly given by the OS. So you should care about what the OS could support as SQL*Loader files are unlimited on *64 Bit* but limited to *2GB* in *32 Bit* OS:
http://download.oracle.com/docs/cd/E11882_01/server.112/e10839/appg_db_lmts.htm#UNXAR382
Else, you should be able to load these data into the Table. So you must check that you have enough place inside the Tablespace and/or the Disk (if the Tablespace has to be extended).
Please find enclosed a link about SQL*Loader and scroll down to Limits / Defaults:
http://www.ordba.net/Tutorials/OracleUtilities~SQLLoader.htm
Hope this help.
Best regards,
Jean-Valentin
Maybe you are looking for
-
Read this gem of customer service! Haha not!
My first email.... To whom it may concern, Last year I bought a PS3 Wireless headset model PS398085 on sale for 50 dollars when it was originally 99.99. (Attached is the receipt). I was very happy with this price from a coupon(@gamer magazine) and am
-
FI posting on basis of travel expenses
Hi, We have an external system where relevant employees can enter their travel expenses. What we need now is to upload these data into SAP and most importantly, we need to generate the FI postings (2) for each of these travel expense lines from the e
-
REQ: LABVIEW
-
Mail program converts my csv attachment into a zip file that i am unable to open
when i receive email thecsv attachment is being converted in zip files that i am unable to open does anyone know why this is is happening is this a apple iisue or something to do with my exchange server?
-
Dynamic field selection by variable input in bex report
Hi Frineds, I have created variable on characteristic ( 0CURTYPE ) which mainly have two values 'A' and ' B' .Based on my variable input in Bex I have to dynamical select key figuers Example . 0CURTYPE KeyfigA KeyFigB A