Problem with loading sdo_geometry with sql loader
Hi All,
I i'm trying to load some geometries, and i'm using sql loader for that.
example entry of my data file looks like this:
1,01030000000100000011000000af8916eafaf7284014c8917307f54540645ddc4603f82840d7b7dd150bf5454084ab4dad08f828401cfc0e8f0ef54540c987eaf70ef828404469143713f54540c987eaf70ef828404469143713f54540d13131a715f82840d44c52f41bf54540e148fb7a19f82840e2e1e24d23f54540e148fb7a19f82840e2e1e24d23f545403abcd6941af828400b13a16c25f5454091c71d801ef82840b8efac3830f54540c58cf0f620f8284039cbd1883ef54540c58cf0f620f8284039cbd1883ef545406659e6632df82840eb80351834f545403bf9991f24f828404bf37d271cf54540e3c281902cf8284012633ec516f54540b66a323e27f82840181d35cb0af54540af8916eafaf7284014c8917307f54540
Geometry is stored in wkb format. To be able to add SRID information to geometry i created the function in database which looks like this:
create or replace function sdo_geom_form_wkb_text(wkb_text IN VARCHAR2) RETURN
sdo_geometry as
SRID_VALUE NUMBER := 8307;
BEGIN
return sdo_geometry(to_blob(HEXTORAW(wkb_text)), SRID_VALUE);
end sdo_geom_form_wkb_text;
and i would like to invoke this method during load. To do this i look in some forums where there were examples with using from_wkt function and i made my own ctl file:
OPTIONS (SKIP=0,BINDSIZE=20000000,ROWS=10000,ERRORS=500,DIRECT=true)
LOAD DATA
INFILE 'c:\geometry\face2.dat'
BADFILE 'c:\geometry\face2.bad'
TRUNCATE
CONTINUEIF NEXT(1:1) = '#'
INTO TABLE TEST_TABLE
FIELDS TERMINATED BY ','
TRAILING NULLCOLS (
ID INTEGER EXTERNAL,
string_geom BOUNDFILLER,
GEOMETRY EXPRESSION "sdo_geom_form_wkb_text(:string_geom)"
when i invoke sqlloader i'm getting:
SQL*Loader-951: Error calling once/load initialization
ORA-26052: Unsupported type 121 for SQL expression on column GEOMETRY.
Could anyone tell what i'm doing wrong?
Thanks,
864742,
. . . .Forget the function and use the SDO_GEOMETRY constructor.
-- "NOTE: here I'm assuming your SRID is 8307"
ID INTEGER EXTERNAL,
string_geom BOUNDFILLER,
GEOMETRY EXPRESSION "SDO_GEOMETRY(:string_geom, 8307)"
.... . . .Credit
Regards,
Noel
Similar Messages
-
Problem with field-length in sql-loader
Hello,
(sorry I see it's the wrong forum -> SQL-Developer, I searched for SQL-Loader, is there a possibility to change the forum ?)
I can't find an answer for my question at google, so I hope there is someone in this forum who can help me.
I have a dat-File that contains 12 500 000 records and want to laod it via sql-loader. The first field contains the ID and there were numbers from 1 to 12 500 000 stored.
When I run the sql-loader, the ID run up to 9 999 999 and then, for the last 2 500 001 records, ist starts at 1 again.
I noticed a few things :
1. Numbers < 10 000 000 don't make Problems
2. Numbers >= 10 000 000 make Problems, the first digit ( in this example "1") is cut, so the number "10 000 001" ist stored as "1". It comes to double entries (IDs 1 to 2 500 000).
3. The same field-definition, I have for the third field of the record -> there is no Problem. THERE I can store any number.
4. I tried to store a number > 100 000 000 -> the first digit was cut too, but ONLY the first digit.
5. I'm able to store any number manually in the Database.
So, I have a problem with the first field. If the number is greater then 10 000 000, the first Number is cut. It doesn't make any differance, if the number is 10 000 000 or 999 999 999, just the first digit, in the first field, is cut.
Any idea ??????????
Here some infos :
Database :
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
SQL-PLUS :
SQL*Plus: Release 10.2.0.4.0 - Production
Script sqlldr :
sqlplus ${schema}/$2 <<EOF >>LOAD.LOG
set timing on
set echo on
set heading off
set heading on
!sqlldr userid=${schema}/$2 control=surface_geometry.ctl log=surface_geometry.log
exit
EOF
ctl-File :
LOAD DATA
INFILE imp_surface_geometry_test2
TRUNCATE
CONTINUEIF NEXT(1:1) = '#'
INTO TABLE SURFACE_GEOMETRY
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS (
ID INTEGER EXTERNAL ,
GMLID,
GMLID_CODESPACE,
PARENT_ID NULLIF PARENT_ID = BLANKS,
ROOT_ID NULLIF ROOT_ID = BLANKS,
IS_SOLID,
IS_COMPOSITE,
IS_TRIANGULATED,
IS_XLINK,
IS_REVERSE,
GEB_ID,
GEOMETRY COLUMN OBJECT
SDO_GTYPE INTEGER EXTERNAL,
SDO_SRID CONSTANT 31468,
SDO_ELEM_INFO VARRAY TERMINATED BY '|/'
(X FLOAT EXTERNAL),
SDO_ORDINATES VARRAY TERMINATED BY '|/'
(X FLOAT EXTERNAL)
Table-Definition (sql-File) :
CREATE TABLE SURFACE_GEOMETRY (
ID NUMBER,
GMLID VARCHAR2(256),
GMLID_CODESPACE VARCHAR2(1000),
PARENT_ID NUMBER,
ROOT_ID NUMBER,
IS_SOLID NUMBER(1,0),
IS_COMPOSITE NUMBER(1,0),
IS_TRIANGULATED NUMBER(1,0),
IS_XLINK NUMBER(1,0),
IS_REVERSE NUMBER(1,0),
GEB_ID CHAR(7),
GEOMETRY MDSYS.SDO_GEOMETRY,
CONSTRAINT c_unique_id UNIQUE (ID))
storage (initial 1M next 1M maxextents 1024) ;
Some Entries in the dat-File :
12556067| |XXX|12556066|12556066|0|0|0|0|0| |
#3003|1|1003|1|/
#4479400.000000|5333360.000000| 526.870000|4479380.000000|5333360.000000| 526.720000|4479400.000000|5333340.000000| 526.980000|4479400.000000|5333360.000000| 526.870000|/
12556068| |XXX| |12556068|0|0|1|0|0| |
#||/
#|/
12556069| |XXX|12556068|12556068|0|0|0|0|0| |
#3003|1|1003|1|/
#4479380.000000|5333380.000000| 526.600000|4479380.000000|5333360.000000| 526.720000|4479400.000000|5333360.000000| 526.870000|4479380.000000|5333380.000000| 526.600000|/
log-File : (100 records for the test)
SQL*Loader: Release 10.2.0.4.0 - Production on Fr Mai 28 15:16:43 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Kontrolldatei: surface_geometry.ctl
Datendatei: imp_surface_geometry_test.dat
Fehlerdatei: imp_surface_geometry_test.bad
Datei für zurückgewiesene Sätze: nichts spezifiziert
(alle Discards zulassen)
Zu ladende Anzahl: ALL
Zu überspringende Anzahl: 0
Zulässige Fehler: 50
Bind-Array: 64 Zeilen, maximal 256000 Bytes
Fortsetzung: 1:1 = 0X23(Zeichen '#'), im nächsten physischen Satz
Benutzer Pfad: Konventionell
Tabelle SURFACE_GEOMETRY, geladen von jedem logischen Satz.
Insert-Option in Kraft für diese Tabelle: TRUNCATE
Option TRAILING NULLCOLS ist wirksam
Spaltenname Position Läng Term Eing Datentyp
ID FIRST * | CHARACTER
GMLID NEXT * | CHARACTER
GMLID_CODESPACE NEXT * | CHARACTER
PARENT_ID NEXT * | CHARACTER
NULL wenn PARENT_ID = BLANKS
ROOT_ID NEXT * | CHARACTER
NULL wenn ROOT_ID = BLANKS
IS_SOLID NEXT * | CHARACTER
IS_COMPOSITE NEXT * | CHARACTER
IS_TRIANGULATED NEXT * | CHARACTER
IS_XLINK NEXT * | CHARACTER
IS_REVERSE NEXT * | CHARACTER
GEB_ID NEXT * | CHARACTER
GEOMETRY DERIVED * COLUMN OBJECT
*** Felder in GEOMETRY
SDO_GTYPE NEXT * | CHARACTER
SDO_SRID CONSTANT
Wert ist '31468'
SDO_ELEM_INFO DERIVED * VARRAY
Abschlusszeichenfolge : '|/'
*** Felder in GEOMETRY.SDO_ELEM_INFO
X FIRST * | CHARACTER
*** Feldende in GEOMETRY.SDO_ELEM_INFO
SDO_ORDINATES DERIVED * VARRAY
Abschlusszeichenfolge : '|/'
*** Felder in GEOMETRY.SDO_ORDINATES
X FIRST * | CHARACTER
*** Feldende in GEOMETRY.SDO_ORDINATES
*** Feldende in GEOMETRY
Tabelle SURFACE_GEOMETRY:
100 Zeilen erfolgreich geladen.
0 Zeilen aufgrund von Datenfehlern nicht geladen.
0 Zeilen nicht geladen, da alle WHEN-Klauseln fehlerhaft waren.
0 Zeilen nicht geladen, da alle Felder NULL waren.
Zugewiesener Bereich für Bind-Array: 232576 Bytes (64 Zeilen)
Byte in Lese-Puffer: 1048576
Gesamtzahl der übersprungenen logischen Datensätze: 0
Gesamtzahl der gelesenen logischen Datensätze: 100
Gesamtzahl der abgelehnten logischen Datensätze: 0
Gesamtzahl der zurückgewiesenen logischen Datensätze: 0
Lauf begonnen am Fr Mai 28 15:16:43 2010
Lauf beendet am Fr Mai 28 15:16:43 2010
Abgelaufene Zeit: 00:00:00.19
CPU-Zeit: 00:00:00.01
Edited by: user9338988 on 28.05.2010 06:21sorry, wrong forum. I opened the thread in forum "Export/Import/SQL-Loader & External Tables"
-
Problem with loading data using SQL LOADER
I am having following files with me when i run following command at command prompt
sqlldr scott/tiger@genuat control =c:\emp.ctl
then giving error as
SQL Loader 500: unable to open file
SQL Loader 553: file not found
emp.dat file data
1111,sneha,CLERK 7902,17-Dec-80,800,20
2222,manoj,SALESMAN,7698,20-Feb-72 ,1600,6500,30
3333,sheela,MANAGER,7839,8-Apr-81,2975,20
emp.ctl file
LOAD DATA
INFILE 'c:\emp.dat'
APPEND
INTO TABLE emp
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(EMPNO,
ENAME ,
JOB,
MGR,
HIREDATE,
SAL ,
COMM,
DEPTNO)
can anyone tell me what is problem in above file why data is not loaded in table??I don't find any problem if you invoke the SQLLDR using the below command(and if you are certain that the control file resides in the C: drive).
sqlldr scott/tiger@genuat control =c:\emp.ctl
If this doesn't work then invoke the SQLLDR from the C: prompt itself.
sqlldr scott/tiger@genuat control=emp.ctl
It would locate the control file and check whether the sqlldr completes successfully? -
CSV FILES DOESN'T LOAD WITH RIGHT DATA USING SQL LOADER
Hi pals, I have the following information in csv file:
MEXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
MEXICO,Seretide_Q210,2010_SEE_02,Sales Line,OBJECTIVE,MEXICO,Q210,05/04/2010,25/06/2010,Activo,,,MEXICO
When I use SQLLOADER the data is loaded as follow:*
EXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
And for the next data in a csv file too:
MX_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
MX_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
the data is loaded as follow:
X_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
X_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
I mean the first character is truncated and this bug happens with all my data. Any suggestion? I really hope you can help me.
Edited by: user11260938 on 11/06/2009 02:17 PM
Edited by: Mariots on 12/06/2009 09:37 AM
Edited by: Mariots on 12/06/2009 09:37 AMYour table and view don't make sense so I created a "dummy" table to match your .ctl file.
SQL> create table CCI_SRC_MX
2 (ORG_BU varchar2(30)
3 ,name varchar2(30)
4 ,src_num varchar2(30)
5 ,src_cd varchar2(30)
6 ,sub_type varchar2(30)
7 ,period_bu varchar2(30)
8 ,period_name varchar2(30)
9 ,prog_start_dt date
10 ,prog_end_dt date
11 ,status_cd varchar2(30)
12 ,X_ACTUALS_CALC_DATE date
13 ,X_ACTUAL_UPDATE_SRC varchar2(30)
14 ,prod_bu varchar2(30)
15 ,ROW_ID NUMBER(15,0)
16 ,IF_ROW_STAT VARCHAR2(90)
17 ,JOB_ID NUMBER(15,0)
18 );
Table created.
SQL> create sequence GSK_GENERAL_SEQ;
Sequence created.I simplified your .ctl file and moved all the constant and sequence stuff to the end. I also changed the format masks to match the dates in your data.
LOAD DATA
INFILE 'SBSLSLT.txt'
BADFILE 'SBSLSLT.bad'
DISCARDFILE 'SBSLSLT.dis'
APPEND
INTO TABLE CCI_SRC_MX
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(ORG_BU
,NAME
,SRC_NUM
,SRC_CD
,SUB_TYPE
,PERIOD_BU
,PERIOD_NAME
,PROG_START_DT DATE 'dd/mm/yyyy'
,PROG_END_DT DATE 'dd/mm/yyyy'
,STATUS_CD
,X_ACTUALS_CALC_DATE DATE 'dd/mm/yyyy'
,X_ACTUAL_UPDATE_SRC
,PROD_BU
,row_id "GSK_GENERAL_SEQ.nextval"
,if_row_stat CONSTANT 'UPLOADED'
,job_id constant 36889106
{code}
When I run SQL Loader, I get this:
{code}
SQL> select * from CCI_SRC_MX;
ORG_BU NAME SRC_NUM SRC_CD SUB_TYPE PERIOD_BU PERIOD_NAME PROG_START_DT PROG_END_DT STATUS_CD PROD_BU ROW_ID IF_ROW_STAT JOB_ID
MEXICO Seretide_Q110 2010_SEE_01 Sales Line OBJECTIVE MEXICO Q110 11-JAN-2010 00:00:00 02-APR-2010 00:00:00 Activo MEXICO 1 UPLOADED 36889106
MEXICO Seretide_Q210 2010_SEE_02 Sales Line OBJECTIVE MEXICO Q210 05-APR-2010 00:00:00 25-JUN-2010 00:00:00 Activo MEXICO 2 UPLOADED 36889106
{code} -
How to load date with time zone using sql loader???
Hi All,
How to load following value in the table using SQL loader.
[11/Jan/2006:15:20:14 -0800]
What should be the datatype of the column in the table. I have tried with "timestamp with local time zone", but unable to load the record using sql loader. What should be the format string in the loader control file to load this type of record.
Any help in this regard is highly appreciated.
SameerTry something like this in your control file:
mycol char "TO_TIMESTAMP_TZ(mycol, 'DD/MON/YYYY:HH24:MI:SS TZH:TZM')"
[pre]
Message was edited by:
Jens Petersen -
Loading data by sql loader in oracle 10g on linux
I am trying to load data in Oracle 10g on linux by using sql loader, but getting error
Problem in log showing that field length of SURNAME field is more than table field size.
Following is the error in log file of sql loader
Record 21: Rejected - Error on table TABLE1, column
SURNAME.
ORA-12899: value too large for column SURNAME (actual: 65, maximum: 64)
and it is evident from following controlfile that i am using trim to discard any space then why it is giving an error.
LOAD DATA
TRUNCATE
INTO TABLE TABLE1
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ID INTEGER EXTERNAL,
OPTION1 CHAR,
REF1 CHAR,
OTHER_REF CHAR,
TITLE "TRIM(:TITLE)",
FORENAME "TRIM(:FORENAME)",
SURNAME "TRIM(:SURNAME)",
JOINT_TITLE "TRIM(:JOINT_TITLE)",
JOINT_FORENAME "TRIM(:JOINT_FORENAME)",
JOINT_SURNAME "TRIM(:JOINT_SURNAME)",
I checked the bad file and count number of characters, they are 64 characters.
When i am inserting individual record from bad file by sql loader, it is loadingProbably your database character set is multi-byte. That is %UTF8 or AL16UTF16%
Post your NLS Database Parameters value
select * from nls_database_parameters;
In General varchar2(65) by default means 65 BYTES unless
you have changed your Defalut NLS_LENGTH_SEMANTICS parameter from BYTE to CHAR.
With best regards
Shan -
Need suggestions for imporving data load performance via SQL Loader
Hi,
Our requirement is to load 512 (1 GB each) files in Oracle database.
We are using SQL loaders to load files into the DB (A partitioned table) and have tried almost all the possible options that come with sql loaders (Direct load path, parallel=true, multithreading=true, unrecoverable)
As the tables is growing bigger in size, each file load time is increasing (It started with 5 minutes per file and has reached 2 hours per 3 files now and is increasing with every batch- Note we are loading 3 files concurrently on the target table using the parallel = true oprion of sql loader)
Questions 1:
My problem is that somehow multithreading is not working for us (we have multi CPU server and have enabled multithreading=true). Could it be something to do with DB setting which might be hindering the data load to be done in multiple threads?
Question 2:
Would gathering stats on the target table and it's partitions help improve load performance ? I'm not sure if stats improve DML's, they would definitely improve sql queries. Any thoughts?
Question 3:
What would be the best strategy to gather stats on this table (which would end up having 512 GB data) ?
Question 4:
Do you think insertions in a partitioned table (with growing sizes) would have poor performance as compared to a non-partitioned table ?
Any other suggestions to improve performace are most welcome !!
Thanks,
Sachin
Edited by: Sachin Tiwari on Mar 13, 2013 6:29 AM2 hours to load just 3 GB of data seems unreasonable regardless of the SQL Loader settings. It seems likely to me that the problem is not with SQL Loader but somewhere else.
Have you generated a Statspack/ AWR/ ASH report to see where all that time is being spent? Are there triggers on the table? Are there bitmap indexes?
Is your table partitioned in a way that is designed to improve the efficiency of loads so that all the data from one file goes into one partition? Or is data from each file getting inserted into many different partitions.
Justin -
Error in loading data using SQL loader
I am getting a error like ‘SQL*Loader -350 syntax error of illegal combination of non-alphanumeric characters’ while loading a file using SQL loader in RHEL. The command used to run SQL*Loader is:
Sqlldr userid=<username>/<password> control =data.ctl
The control file, data.ctl is :
LOAD data
infile '/home/oraprod/data.txt'
append into table test
empid terminated by ',',
fname terminated by ',',
lname terminated by ',',
salary terminated by whitespace
The data.txt file is:
1,Kaushal,halani,5000
2,Chetan,halani,1000
I hope, my question is clear.
Please revert with the reply to my query.
RegardsReplace ''{" by "(" in your control file
LOAD data
infile 'c:\data.txt'
append into table emp_t
empid terminated by ',',
fname terminated by ',',
lname terminated by ',',
salary terminated by whitespace
C:\>sqlldr user/pwd@database control=c.ctl
SQL*Loader: Release 10.2.0.3.0 - Production on Wed Nov 13 10:10:24 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 1
Commit point reached - logical record count 2
SQL> select * from emp_t;
EMPID FNAME LNAME SALARY
1 Kaushal halani 5000
2 Chetan halani 1000
Best regards
Mohamed Houri -
Error while loading data using SQL*Loader
Hi All,
I am now in process of loading data from MS SQL to Oracle Database.
I am getting the data in excel format and i will convert them into csv.
Upto converting everything is working fine.
In MS SQL, table columns are case sensitive.
So i created those tables in oracle db as same.
There is one column "MaxNumber" which is of type float(49).
The column is case sensitive.
in the control file first i given as
"MaxNumber" "TO_NUMBER(:MaxNumber,'99,999.99')"
After executing the SQL*Loader i am getting the error
SQL*Loader-466: Column MAXNUMBER does not exist in table TABLEONE.
I changed the control file entry as
"MaxNumber" "TO_NUMBER(:"MaxNumber",'99,999.99')"
After the execution i got the error
SQL*Loader-350: Syntax error at line 13.
Expecting "," or ")", found "MaxDiscount".
"MaxNumber" "TO_NUMBER(:"MaxNumber",'99,999.99')"
Please Guide me in this issue.
Regards
Salih KMWhat I'm saying is, verify the column name. Dont post if not possible.
Example follows, with one table intentionally "hidden".
SQL> create table "tEsT" ("MaxNumber" float, "MaxnumbeR" number);
SQL> select table_name,column_name from user_tab_columns where table_name like 't%';
TABLE_NAME COLUMN_NAME
tEsT MaxNumber
tEsT MaxnumbeR
teST iD
teST MaxNumberHth,
Fredrik -
Want to use sequence object of oracle when loading data in sql loader
Hi,
I want to use sequence when loading data in sqll loader, but the problem is i could not use sequence object of oracle to load the data by sql loader, i can use sequence of sql loader.
I want to use sequence object because in later entries this sequence object will be used.If i use sequence of sql loader how can i use oracle sequence object
Is there any other optionI have a simillar problem, I also want to use a sequence when loading data by the SQL Loader.
My control file is:
load data
infile '0testdata.txt'
into table robertl.tbltest
fields terminated by X'09'
trailing nullcols
(redbrojunos,
broj,
dolazak,
odlazak nullif odlazak=blanks,
komentar nullif komentar=blanks)
And the datafile is:
robertl.brojilo.nextval 1368 17.06.2003 08:02:46 17.06.2003 16:17:18
robertl.brojilo.nextval 2363 17.06.2003 08:18:18 17.06.2003 16:21:52
robertl.brojilo.nextval 7821 17.06.2003 08:29:22 17.06.2003 16:21:59
robertl.brojilo.nextval 0408 17.06.2003 11:20:27 17.06.2003 18:33:00 ispit
robertl.brojilo.nextval 1111 17.06.2003 11:30:58 17.06.2003 16:09:34 Odlazak na ispit
robertl.brojilo.nextval 6129 17.06.2003 14:02:42 17.06.2003 16:23:23 seminar
But all records were rejected by the Loader, for every record I get the error:
Record 1: Rejected - Error on table ROBERTL.TBLTEST, column REDBROJUNOS.
ORA-01722: invalid number -
Loading datas through sql loader
dear all,
I have a table with a date column where I have specified the datatype as date, and when am trying to load datas sqlloader :
Record 51: Rejected - Error on table SYSTEM.PROJECT, column D_DATE.
ORA-01843: not a valid month
select sysdate from dual
11/10/2007 1:53:55 PM -- which is of the format mm/dd/2007
am loading the datas in the same format even then, am getting the above error..
Here it is..
control file
LOAD DATA
infile *
INSERT
INTO TABLE system.project
FIELDS TERMINATED BY ','
(SERIAL,D_DATE date "DD-Mon-YY",PLATE_NO,IN_KM,OUT_KM,LOCATION,DESTINATION,LITERS,VEHICLE_TYPE,Division,REMARKS)
begindata
table structure :
SQL> desc project1
Name Null? Type
SERIAL NUMBER(10)
D_DATE DATE
PLATE_NO VARCHAR2(20)
IN_KM VARCHAR2(20)
OUT_KM VARCHAR2(20)
LOCATION VARCHAR2(20)
DESTINATION VARCHAR2(40)
LITERS NUMBER(10)
VEHICLE_TYPE VARCHAR2(40)
DIVISION VARCHAR2(40)
REMARKS VARCHAR2(40)
Please guideThanks sam.. I changed the control file like :
LOAD DATA
infile *
append
INTO TABLE system.project
FIELDS TERMINATED BY ','
(SERIAL,D_DATE date "DD-Mon-YY",REMARKS)
begindata
and now it is working fine..
Thanks
Yusuf -
Help needed to load data using sql loader.
Hi,
I trying to load data from xls to oracle table(solaris OS) and its failing to load data.
Control file:
LOAD DATA
CHARACTERSET UTF16
BYTEORDER BIG ENDIAN
INFILE cost.csv
BADFILE consolidate.bad
DISCARDFILE Sybase_inventory.dis
INSERT
INTO TABLE FIT_UNIX_NT_SERVER_COSTS
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
HOST_NM,
SERVICE_9071_DOLLAR DOUBLE,
SERVICE_9310_DOLLAR DOUBLE,
SERVICE_9700_DOLLAR DOUBLE,
SERVICE_9701_DOLLAR DOUBLE,
SERVICE_9710_DOLLAR DOUBLE,
SERVICE_9711_DOLLAR DOUBLE,
SERVICE_9712_DOLLAR DOUBLE,
SERVICE_9713_DOLLAR DOUBLE,
SERVICE_9720_DOLLAR DOUBLE,
SERVICE_9721_DOLLAR DOUBLE,
SERVICE_9730_DOLLAR DOUBLE,
SERVICE_9731_DOLLAR DOUBLE,
SERVICE_9750_DOLLAR DOUBLE,
SERVICE_9751_DOLLAR DOUBLE,
GRAND_TOTAL DOUBLE
Log file:
Table FIT_UNIX_NT_SERVER_COSTS, loaded from every logical record.
Insert option in effect for this table: INSERT
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
HOST_NM FIRST * , CHARACTER
SERVICE_9071_DOLLAR NEXT 8 DOUBLE
SERVICE_9310_DOLLAR NEXT 8 DOUBLE
SERVICE_9700_DOLLAR NEXT 8 DOUBLE
SERVICE_9701_DOLLAR NEXT 8 DOUBLE
SERVICE_9710_DOLLAR NEXT 8 DOUBLE
SERVICE_9711_DOLLAR NEXT 8 DOUBLE
SERVICE_9712_DOLLAR NEXT 8 DOUBLE
SERVICE_9713_DOLLAR NEXT 8 DOUBLE
SERVICE_9720_DOLLAR NEXT 8 DOUBLE
SERVICE_9721_DOLLAR NEXT 8 DOUBLE
SERVICE_9730_DOLLAR NEXT 8 DOUBLE
SERVICE_9731_DOLLAR NEXT 8 DOUBLE
SERVICE_9750_DOLLAR NEXT 8 DOUBLE
SERVICE_9751_DOLLAR NEXT 8 DOUBLE
GRAND_TOTAL NEXT 8 DOUBLE
Record 1: Rejected - Error on table FIT_UNIX_NT_SERVER_COSTS, column HOST_NM.
Field in data file exceeds maximum length
Table FIT_UNIX_NT_SERVER_COSTS:
0 Rows successfully loaded.
1 Row not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Please help me ASAP.
Awaiting u r reply.Hi,
I verified and everything looks fine according to me.
Table structure:
OST_NM VARCHAR2(30)
SERVICE_9071_DOLLAR NUMBER(8,2)
SERVICE_9310_DOLLAR NUMBER(8,2)
SERVICE_9700_DOLLAR NUMBER(8,2)
SERVICE_9701_DOLLAR NUMBER(8,2)
SERVICE_9710_DOLLAR NUMBER(8,2)
SERVICE_9711_DOLLAR NUMBER(8,2)
SERVICE_9712_DOLLAR NUMBER(8,2)
SERVICE_9713_DOLLAR NUMBER(8,2)
SERVICE_9720_DOLLAR NUMBER(8,2)
SERVICE_9721_DOLLAR NUMBER(8,2)
SERVICE_9730_DOLLAR NUMBER(8,2)
SERVICE_9731_DOLLAR NUMBER(8,2)
SERVICE_9750_DOLLAR NUMBER(8,2)
SERVICE_9751_DOLLAR NUMBER(8,2)
GRAND_TOTAL NUMBER(8,2)
Control file:
LOAD DATA
BYTEORDER BIG ENDIAN
INFILE cost.csv
BADFILE consolidate.bad
DISCARDFILE Sybase_inventory.dis
INSERT
INTO TABLE FIT_UNIX_NT_SERVER_COSTS
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
HOST_NM ,
SERVICE_9071_DOLLAR NUMBER(8,2),
SERVICE_9310_DOLLAR NUMBER(8,2),
SERVICE_9700_DOLLAR NUMBER(8,2),
SERVICE_9701_DOLLAR NUMBER(8,2),
SERVICE_9710_DOLLAR NUMBER(8,2),
SERVICE_9711_DOLLAR NUMBER(8,2),
SERVICE_9712_DOLLAR NUMBER(8,2),
SERVICE_9713_DOLLAR NUMBER(8,2),
SERVICE_9720_DOLLAR NUMBER(8,2),
SERVICE_9721_DOLLAR NUMBER(8,2),
SERVICE_9730_DOLLAR NUMBER(8,2),
SERVICE_9731_DOLLAR NUMBER(8,2),
SERVICE_9750_DOLLAR NUMBER(8,2),
SERVICE_9751_DOLLAR NUMBER(8,2),
GRAND_TOTAL NUMBER(8,2)
Sample date file:
ABOS12,122.46,,1315.00,,1400.00,,,,,,,,1855.62,,4693.07
ABOS39,6391.16,,1315.00,,1400.00,,,,,,,,,4081.88,13188.04 -
All,
I have two tables HEADER_TABLE and LINE_TABLE. Each header record can have multiple line records. I have to load data from a flat file to these tables.Flat file can have two types of records. H-Header, L-Line. It looks as follows.. Each H record can have multiple corresponding L records
H..........
L.......
L......
L......
H.........
L.......
L......
L......
I have HEADER_ID column in HEADER_TABLE and HEADER_ID, LINE_ID columns in the LINE_TABLE.
While loading data using SQL Loader, I need to generate HEADER_ID and LINE_ID values as follows and load them.
H..........<HEADER_ID = 1>
L....... <HEADER_ID = 1><LINE_ID = 1>
L...... <HEADER_ID = 1><LINE_ID = 2>
L...... <HEADER_ID = 1><LINE_ID = 3>
H......... <HEADER_ID = 2>
L....... <HEADER_ID = 2><LINE_ID = 4>
L...... <HEADER_ID = 2><LINE_ID = 5>
L...... <HEADER_ID = 2><LINE_ID = 6>
Is it possible to do this with SQL LODER?
I tried to do this with sequences. But it loaded the tables as follows.
H..........<HEADER_ID = 1>
L....... <HEADER_ID = 1><LINE_ID = 1>
L...... <HEADER_ID = 1><LINE_ID = 2>
L...... <HEADER_ID = 1><LINE_ID = 3>
H......... <HEADER_ID = 2>
L....... <HEADER_ID = 1><LINE_ID = 4>
L...... <HEADER_ID = 1><LINE_ID = 5>
L...... <HEADER_ID = 1><LINE_ID = 6>
Thanks
KethaMorgan,
Examples given in the link are quite generic and I have tried them. But my requirement is focused on generating header_id and line_id values as i have described. It seems that SQLLDR scans all records for a particular WHEN clause and insert them into the specified table. I think that if SQLLDR is made to read recod in the data file sequentially, this can be done.
ANy idea of how to make SQLLDR read the records from the file sequentially?
Thanks
Ketha -
Hi:
Does somebody know if it is possible to upload data using an API in SQL Loader? Or SQL Loader is limited only to INSERT statements?
I need to bulk a lot of employees and their usernames and resposibilities. They are almost 200 employees. What I would like to do is to create a csv file with all this information (first_name, last_name, hire_date, sex, email, if it is a purchaser, username, password, responsibility...), and through a request load all this to Oracle Ebs. I want to use hr_employee_api.create_employee, fnd_user_pkg.create_user and fnd_wf_engine.propagate_user_role. I don't want to enter data using inserts because hr_employee_api.create_employee api changes more than one table.
I hope you can help me
Thanks in advanceWhy don't you
* load the data file into a temp table
* write a procedure that reads the temp table and calls the 3 APIs with the data from each row
Sandeep Gandhi -
Error in Loading Data with SQLLDR in Oracle 10G
Hello,
Can any one suggest whats the problem in the below mentioned Control file used for loading data through SQL*LOADER
LOAD DATA
INFILE 'D:\test\temt.txt'
BADFILE 'test.bad'
DISCARDFILE 'test.dsc'
INTO TABLE "TEST"
INSERT
(SRNO INTEGER(7),
PROD_ID INTEGER(10),
PROMO_ID INTEGER(10),
CHANNEL_ID INTEGER(10),
UNIT_COST INTEGER(10),
UNIT_PRICE INTEGER(10)
I am trying to load data in SCOTT schema as user scott.
Why do i get such an error, please refer the attach Log file.
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 20 14:43:35 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: D:\test\temt.ctl
Data File: D:\test\temt.txt
Bad File: test.bad
Discard File: test.dsc
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table "TEST", loaded from every logical record.
Insert option in effect for this table: INSERT
Column Name Position Len Term Encl Datatype
SRNO FIRST 7 INTEGER
PROD_ID NEXT 10 INTEGER
PROMO_ID NEXT 10 INTEGER
CHANNEL_ID NEXT 10 INTEGER
UNIT_COST NEXT 10 INTEGER
UNIT_PRICE NEXT 10 INTEGER
Record 1: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 2: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 3: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 4: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 5: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 6: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 7: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 8: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 9: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 10: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 11: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 12: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 13: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 14: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 15: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 16: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 17: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 18: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 19: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 20: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 21: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 22: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 23: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 24: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 25: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 26: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 27: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 28: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 29: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 30: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 31: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 32: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 33: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 34: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 35: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 36: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 37: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 38: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 39: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 40: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 41: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 42: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 43: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 44: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 45: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 46: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 47: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 48: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 49: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 50: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
Record 51: Rejected - Error on table "TEST".
ORA-01460: unimplemented or unreasonable conversion requested
MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
Table "TEST":
0 Rows successfully loaded.
51 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 3648 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 64
Total logical records rejected: 51
Total logical records discarded: 0
Run began on Fri Mar 20 14:43:35 2009
Run ended on Fri Mar 20 14:43:43 2009
Elapsed time was: 00:00:07.98
CPU time was: 00:00:00.28
Below is the method of using SQLLDR and table details,
SQL> desc test
Name Null? Type
SRNO NUMBER(7)
PROD_ID NUMBER(10)
PROMO_ID NUMBER(10)
CHANNEL_ID NUMBER(10)
UNIT_COST NUMBER(10)
UNIT_PRICE NUMBER(10)
Method for using sqlldr is :
cmd promt,
d:\> sqlldr scott/tiger
control = D:\test\temt.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 20 15:55:50 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 64
I even tried few examples,
Which of the below mentioned Control file make sense,
--1
LOAD DATA
INFILE 'D:\test\temt.txt'
BADFILE 'test.bad'
DISCARDFILE 'test.dsc'
INTO TABLE "TEST"
INSERT
FIELD TERMINATED BY (,)
(SRNO INTEGER(7),
PROD_ID INTEGER(10),
PROMO_ID INTEGER(10),
CHANNEL_ID INTEGER(10),
UNIT_COST INTEGER(10),
UNIT_PRICE INTEGER(10)
--2
LOAD DATA
INFILE 'D:\test\temt.txt'
BADFILE 'test.bad'
DISCARDFILE 'test.dsc'
INTO TABLE "TEST"
INSERT
FIELD TERMINATED BY (,) optionally enclosed by '"'
(SRNO INTEGER(7),
PROD_ID INTEGER(10),
PROMO_ID INTEGER(10),
CHANNEL_ID INTEGER(10),
UNIT_COST INTEGER(10),
UNIT_PRICE INTEGER(10)
*For code--1 i get below mentioned error..*
D:\>sqlldr scott/tiger
control = D:\test\temt.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 20 16:36:00 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL*Loader-350: Syntax error at line 8.
Expecting "(", found "FIELD".
FIELD TERMINATED BY (,)
^
*And for code--2 i get the below error,*
D:\>sqlldr scott/tiger
control = D:\test\temt.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Fri Mar 20 16:39:22 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL*Loader-350: Syntax error at line 8.
Expecting "(", found "FIELD".
FIELD TERMINATED BY (,) optionally enclosed by '"'
^
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------below is the data i am trying to load through sqlldr
1,14,999,3,89098,111287
2,14,999,2,88645,110899
3,14,999,2,90418,117623
4,14,999,3,89272,115999
5,14,999,4,86364,117623
6,15,999,3,87522,101399
7,15,999,4,84671,99999
8,15,999,4,84671,99999
9,15,999,4,86364,101399
10,15,999,4,88735,100399
11,15,999,2,90418,101399
12,15,999,3,89272,101399
13,15,999,2,90418,101399
14,17,999,2,9694,155099
15,17,999,3,97618,155099
16,17,999,3,97618,155099
17,18,999,3,11333,169783
18,18,999,2,11479,163279
19,18,999,3,11333,163279
20,18,999,3,115141,173504
21,18,999,2,117086,165565
22,18,999,2,116856,17532
23,18,999,2,117086,169783
24,19,999,4,489,6237
25,19,999,3,4968,6302
26,20,999,2,52876,60839
27,20,999,3,52202,59999
28,20,999,3,53246,59999
29,20,999,3,54205,60209
30,20,999,3,54205,60209
31,21,999,4,76204,106773
32,21,999,4,76204,106773
33,21,999,3,7877,105299
34,21,999,4,76204,106773
35,21,999,4,77576,105668
36,21,999,3,7877,105299
37,21,999,4,76204,105299
38,21,999,2,81377,107595
39,21,999,2,81377,107595
40,21,999,4,77728,107595
41,22,999,3,2187,2656
42,22,999,2,2216,2661
43,22,999,3,2187,2656
44,22,999,2,2251,2632
45,22,999,3,2187,2656
46,22,999,4,2154,2628
47,22,999,3,2187,2656
48,22,999,3,2231,2661
49,22,999,3,2231,2624
50,22,999,2,2296,2632
51,22,999,3,2231,2661
52,22,999,4,2158,2661
53,23,999,3,1913,2408
54,23,999,3,1951,2375
55,23,999,3,1987,2383
56,23,999,3,1951,2408
57,24,999,4,3946,4943
58,24,999,3,4073,4883
59,24,999,2,4053,4934
60,24,999,2,4053,4866
61,24,999,4,3946,4943
62,24,999,3,4001,4943
63,24,999,3,4154,4892
64,24,999,4,4025,4875
65,24,999,4,4025,4875
66,24,999,2,4134,4875
67,24,999,3,4081,4943
68,24,999,2,4134,4934
69,24,999,4,4025,4943
70,24,999,4,4025,4875
71,24,999,3,4081,4943
72,25,999,3,983,12655
73,25,999,3,983,12655
74,25,999,2,9958,12655
75,25,999,3,983,12655
76,25,999,2,9958,12832
77,25,999,3,10027,12832
78,25,999,2,10157,12774
79,25,999,4,9888,12655
80,25,999,2,10157,12832
81,25,999,4,9888,12832
82,25,999,4,9888,12832
83,26,999,3,1305,17034
84,26,999,3,1305,16799
85,26,999,3,13551,16858
86,27,999,3,3992,4927
87,27,999,3,4064,4876
88,29,999,3,43761,56175
89,29,999,2,44942,55621
90,29,999,4,42335,55399
91,29,999,2,44322,55399
92,29,999,2,45208,56175
93,29,999,2,45208,56175
94,29,999,4,43182,56175
95,29,999,3,44636,56175
96,29,999,4,43182,56175
97,29,999,4,43182,56175
98,30,999,3,869,1094
99,30,999,4,857,1079
100,30,999,2,898,1079
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Maybe you are looking for
-
In need of install help!!!
I am trying to install the Developer Workspace on my local machine. The install was going fine and it was very close to finishing when I lost power to my laptop and lost the installation. Now when I try to reinstall I keep getting the following err
-
JScrollPane + Component sizes before display
I was recently presented with a minor quandry. I have a JPanel which needs to occupy a minimum fixed amount of real estate on my application's GUI, call it 'checkbox_jpanel'. The problem is that as the user operates the application, more and more che
-
How to Convert a Element to a different Element?
I get a xml Element from others, for some reason I must convert it to my format, like add some attribute, change some attributes' name: example, original include: <original id="000" name="father"> <original id="001" name="first"/> <original
-
Consolidation package doesnt work, monitor works perfectly fine.
Hello All, I am facing a very weird problem. I have setup the consolidation and ownership models with all the structure configured and all the equity/intercompany elims configured. When I trigger the consolidations from Consolidation monitor, it work
-
Nested animation doesn't move on 'Play', but does on 'Test Movie'
I'm using Adobe Flash Pro CS6 12.0.0.481 on Mac OSX 10.6.8, freshly installed in the last day - so I haven't been fiddling with preferences yet. I'm using nested symbols for a bouncing ball animation. The innermost cymbal is the ball object itself ('