Loading spatial data by sql *loader
hi there
i have a load_kat_opcina.ctl file from which i should load spatial data into my 10g db table.
load_data.ctl file is as shown below:
LOAD DATA
INFILE *
REPLACE
CONTINUEIF NEXT(1:1) = '#'
INTO TABLE KAT_OPCINA
FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(KO_MBR NULLIF KO_MBR=BLANKS,
KO_SIFRA NULLIF KO_SIFRA=BLANKS,
KO_NAZIV NULLIF KO_NAZIV=BLANKS,
KO_ID NULLIF KO_ID=BLANKS,
ID NULLIF ID=BLANKS,
is_null1 FILLER CHAR,
POVRSINA COLUMN OBJECT NULLIF is_null1='E'
( sdo_gtype INTEGER EXTERNAL,
sdo_srid INTEGER EXTERNAL NULLIF POVRSINA.sdo_srid=BLANKS,
SDO_POINT COLUMN OBJECT NULLIF is_null1='C'
( X INTEGER EXTERNAL,
Y INTEGER EXTERNAL,
Z INTEGER EXTERNAL NULLIF POVRSINA.SDO_POINT.Z=BLANKS),
SDO_ELEM_INFO VARRAY terminated by ';' NULLIF is_null1='P'
(SDO_ORDINATES INTEGER EXTERNAL),
SDO_ORDINATES VARRAY terminated by ':' NULLIF is_null1='P'
(SDO_ORDINATES INTEGER EXTERNAL)
BEGINDATA
0|426|MARKU[EVEC|314717|6789094|
0|3131|VURNOVEC|16605787|6789097|
#C|2003|||||1|1005|3|1|2|1|169|......|5589490440|5082192250:
0|3034|\UR\EKOVEC|16225011|6789100|
0|35|^EHI|12297784|6789190|
#C|2003|||||1|1005|2|1|2|1|239|....|5574944600|5064714553:
0|221|ODRANSKI OBRE@|12441649|6789193|
0|353|TRPUCI|14071974|6789199|
i have deleted most of data here due to space savings.
i call sql *loader from winxp command prompt as follows:
SQLLDR CONTROL=C:\temp\load_kat_opcina.ctl, USERID=username/pswrd@sid, LOG=logfile.log,BAD==baz.bad, DISCARD=DISCARD=toss.dsc
after executing command, table 'kat_opcina' is not filled with data from this .ctl file.
the following is the content of the log file:
SQL*Loader: Release 10.2.0.1.0 - Production on Sri Svi 31 14:20:28 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: C:\TEMP\load_kat_opcina.ctl
Data File: C:\TEMP\load_kat_opcina.ctl
Bad File: C:\TEMP\baz.bad
Discard File: C:\TEMP\toss.dsc
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: 1:1 = 0X23(character '#'), in next physical record
Path used: Conventional
Table KAT_OPCINA, loaded from every logical record.
Insert option in effect for this table: REPLACE
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
KO_MBR FIRST * | O(") CHARACTER
NULL if KO_MBR = BLANKS
KO_SIFRA NEXT * | O(") CHARACTER
NULL if KO_SIFRA = BLANKS
KO_NAZIV NEXT * | O(") CHARACTER
NULL if KO_NAZIV = BLANKS
KO_ID NEXT * | O(") CHARACTER
NULL if KO_ID = BLANKS
ID NEXT * | O(") CHARACTER
NULL if ID = BLANKS
IS_NULL1 NEXT * | O(") CHARACTER
(FILLER FIELD)
POVRSINA DERIVED * COLUMN OBJECT
NULL if IS_NULL1 = 0X45(character 'E')
*** Fields in POVRSINA
SDO_GTYPE NEXT * | O(") CHARACTER
SDO_SRID NEXT * | O(") CHARACTER
NULL if POVRSINA.SDO_SRID = BLANKS
SDO_POINT DERIVED * COLUMN OBJECT
NULL if IS_NULL1 = 0X43(character 'C')
*** Fields in POVRSINA.SDO_POINT
X NEXT * | O(") CHARACTER
Y NEXT * | O(") CHARACTER
Z NEXT * | O(") CHARACTER
NULL if POVRSINA.SDO_POINT.Z = BLANKS
*** End of fields in POVRSINA.SDO_POINT
SDO_ELEM_INFO DERIVED * ; VARRAY
NULL if IS_NULL1 = 0X50(character 'P')
*** Fields in POVRSINA.SDO_ELEM_INFO
SDO_ORDINATES FIRST * | O(") CHARACTER
*** End of fields in POVRSINA.SDO_ELEM_INFO
SDO_ORDINATES DERIVED * : VARRAY
NULL if IS_NULL1 = 0X50(character 'P')
*** Fields in POVRSINA.SDO_ORDINATES
SDO_ORDINATES FIRST * | O(") CHARACTER
*** End of fields in POVRSINA.SDO_ORDINATES
*** End of fields in POVRSINA
Record 1: Rejected - Error on table KAT_OPCINA.
ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
ORA-13365: layer SRID does not match geometry SRID
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 623
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 227
Record 2: Rejected - Error on table KAT_OPCINA.
ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
ORA-13365: layer SRID does not match geometry SRID
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 623
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 227
Record 33: Rejected - Error on table KAT_OPCINA.
ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
ORA-13365: layer SRID does not match geometry SRID
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 623
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 227
SQL*Loader-510: Physical record in data file (C:\TEMP\load_kat_opcina.ctl) is longer than the maximum(65536)
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
Specify SKIP=33 when continuing the load.
Table KAT_OPCINA:
0 Rows successfully loaded.
33 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: 215168 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 33
Total logical records rejected: 33
Total logical records discarded: 0
Run began on Sri Svi 31 14:20:28 2006
Run ended on Sri Svi 31 14:20:32 2006
Elapsed time was: 00:00:04.51
CPU time was: 00:00:00.26
error messages are all the same for record numbers: 3-32.
so, i'd like to know what am i doing wrong that table cannot be filled with data using sql *loader.
also, would like to know if there's another way of loading data into table from .ctl file (using maybe some other tool)
appreciate any help
thanks
Hi,
You receive:
ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
ORA-13365: layer SRID does not match geometry SRID
Have you created spatial index for table PORVSINA? I guess that yes, and you have created it with non NULL SRID value? So, ORA-13365 means that you are trying to insert spatial data with SRID that is not the same as SRID defined in spatial index.
Check index SRID and your data SRID, they must be the same. Or, you can disable spatial index.
Andrejus
Similar Messages
-
How to load XML data by sql*loader
I want to use SQL*loader to load XML file, which was briefly mentioned in "Application Developer's
Guide: XML" without any detail information and examples.
Does anyone have the information including sample control file or know where I can get the info?
Any help would be much appreciated.
Thanks.
Yi ZhongYi,
I found this on Meta-Link. Maybe this is it?
goal: How to load a XML document into XMLType data type?
fact: Oracle XML Developers Kit
fact: Oracle Server - Enterprise Edition
fact: SQL*Loader
fix:
The document can be loaded by SQL*Loader as if it was LOB data.
The following example (Unix commands) demonstrates how to do this:
$ ORACLE_SID=v901; export ORACLE_SID
$ ORAENV_ASK=NO; export ORAENV_ASK
$ . oraenv
$ sqlplus /nolog <<EOF
connect / as sysdba
drop user oss120517 cascade;
create user oss120517 identified by oss120517
default tablespace users temporary tablespace temp
quota unlimited on users;
grant connect,resource to oss120517;
revoke unlimited tablespace from oss120517;
connect oss120517/oss120517
create table test
(xml_id number
,xml_doc sys.xmltype);
EOF
$ cat <<EOF > sqlload.ctl
load data
infile *
into table test append
fields terminated by ','
(xml_id integer
,xml_filler filler char
,xml_doc lobfile(xml_filler) terminated by EOF)
begindata
1 , test.xml
EOF
$ sqlldr oss120517/oss120517 control=sqlload.ctl -
Unable to load clob data through sql loader
Hi Experts ,
My ctl file is :
LOAD DATA infile '$di_top/conversion/devtrack_notes.csv'
truncate into table xxdi_proj
fields terminated by ','
optionally enclosed by '"'
trailing nullcols (bugid,note *clob*)
{code}
The problem is note column is a clob and one of the
values has line breaks like this :
{code}
Hi Sir,
Would you please inform when the reports are scheduled for automatic process?
Maria will stop his process to avoid duplication.
Please inform asap
With Regards ,
Ronaldinho
{code}
When the data gets loaded ,
The first column gets the sentence 'Would you please inform.....' i.e . the data of second columns gets loaded into first column as nulls are recognized as end delimiter.
How to overcome this problem?
ThanksPl post your exact OS and database versions, along with your complete sqlldr command, the table description and a sample of your input csv file.
HTH
Srini -
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 -
Oracle 11g R2, Problem Loading Spatial Data
We have a geodatabase which has been implemented by oracle spatial. it has been working quite fine since 2 years ago. Recently the data center serving our geodatabase has been upgraded on both software and hardware specifications. The handler application now has difficulty retrieving spatial data. The problem is somehow strange; only some spatial objects are loaded and then application encounters exceptions.
Previous working database engine was an Oracle 11g R1 and the new one is Oracle 11g R2. The application is a java application mostly written by swing. Here is the stack trace:
java.sql.SQLRecoverableException: No more data to read from socket
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1200)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
at oracle.jdbc.driver.T4CCallableStatement.fetch(T4CCallableStatement.java:1079)
at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:369)
at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:273)
at ir.mas.aamar.service.map.MapService.getModifiedMap(MapService.java:405)
at ir.mas.aamar.map.MapPanel.redrawLayers(MapPanel.java:504)
at ir.mas.aamar.map.LayersTree.onSnapshotDisplayCheckBoxItemChanged(LayersTree.java:420)
at ir.mas.aamar.map.LayersTree.onMouseReleased(LayersTree.java:204)
at ir.mas.aamar.map.LayersTree.access$0(LayersTree.java:188)
at ir.mas.aamar.map.LayersTree$1.mouseReleased(LayersTree.java:170)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.sql.SQLRecoverableException: No more data to read from socket
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1200)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:853)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1469)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:389)
at ir.mas.aamar.service.map.MapService.executeJDBCQuery(MapService.java:78)
at ir.mas.aamar.service.map.MapService.getSnapshotsForThisTermPlusHoze(MapService.java:1013)
at ir.mas.aamar.dialog.edit.EditTools.refreshLayersCombo(EditTools.java:327)
at ir.mas.aamar.dialog.edit.EditTools.refresh(EditTools.java:301)
at ir.mas.aamar.dialog.edit.EditTools.<init>(EditTools.java:103)
at ir.mas.aamar.dialog.edit.EditTools.editTools(EditTools.java:62)
at ir.mas.aamar.map.MapPanel.paintComponent(MapPanel.java:7591)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.sql.SQLRecoverableException: Closed Resultset: next
at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:224)
at ir.mas.aamar.service.map.MapService.getSnapshotsForThisTermPlusHoze(MapService.java:1014)
at ir.mas.aamar.dialog.edit.EditTools.refreshLayersCombo(EditTools.java:327)
at ir.mas.aamar.dialog.edit.EditTools.refresh(EditTools.java:301)
at ir.mas.aamar.dialog.edit.EditTools.<init>(EditTools.java:103)
at ir.mas.aamar.dialog.edit.EditTools.editTools(EditTools.java:62)
at ir.mas.aamar.map.MapPanel.paintComponent(MapPanel.java:7591)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at ir.mas.aamar.dialog.edit.EditTools.setTypeOfEditModel(EditTools.java:452)
at ir.mas.aamar.dialog.edit.EditTools.<init>(EditTools.java:104)
at ir.mas.aamar.dialog.edit.EditTools.editTools(EditTools.java:62)
at ir.mas.aamar.map.MapPanel.paintComponent(MapPanel.java:7591)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I read in some forums that the problem could be caused by jdbc version incompatibility, so I just copied jdbc archives from the installed oracle 11g R2 jdbc folder but the problem persists. Last thing I should mention is that only spatial data is problemistic and non-spatial data is easily loaded.
Please Help, Thanks.Hi storm,
During the installation of oracle as you said if you have given the global password, basically this specific password will reflect to users such as
-sys
-system
-dbsnmp
-sysman
As you are new to oracle the basics that you should know is that "SYS" user is the highly privileged user in Oracle and should be logged in as "sys as sysdba" with his respective password (i.e. the global password that you have entered during database installation) to obtain his privilege. Remember to manipulate your database with caution when you are logged in as the sys user. You can log into the database using the sys user in the following way:
c\> sqlplus sys as sysdba
password: ****** --It will ask you for the password and you will have to give the global password that was given during installation
Hope this helps!!!
Regards, -
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 -
Does SSIS guarantee that it loads the data into SQL Server in the same order as it is in Excel
Hi,
We are trying to load several Excel files into SQL Server SSIS and we need to save the data in the database in the same order as it is in Excel..
My question is, Does SSIS guarantee that it loads the data into SQL Server in the same order as it is in Excel. If so, we will add a sequence to ensure we have the order.
Please advise.
Thanks & Regards,
DhanumjayThanks for your response.
If it is one file then we can add an index column, but we have to load hundreds of files.
How adding an index/key column to the table works unless SSIS picks and loads the data in the table in the same order as it is in Excel?
Just to explain my question better,
If excel has three rows {a,b},{c,d},{e,f}, does SSIS ensure it loads the data in the same order in a table.
Thanks. -
How to load oracle data into SQL SERVER 2000?
how to load oracle data into SQL SERVER 2000.
IS THERE ANY UTILITY AVAILABLE?Not a concern for an Oracle forum.
Als no need for SHOUTING.
Conventional solutions are
- dump the data to a csv file and load it in Mickeysoft SQL server
- use Oracle Heterogeneous services
- use Mickeysoft DTS
Whatever you prefer.
Sybrand Bakker
Senior Oracle DBA -
10G data pumps / sql loader
When data is moved by data pumps / sql loader,
is the change enter into redo ?
Thanks ericWhere can I find Oracle client for 10g (or earlier)? Look at the upper left corner of this page (there is red image "Download Oracle Software")...
Is SQL*Loader part of Oracle client? Yes it is. -
How to export&import data using sql *loader
Hi all,
How to export&import data from sql*loader. Give me the clear steps..
Thanks in AdvanceHi did you already exported data from SQL SERVER? if not using SQL*LOADER you cannot export data. SQL*LOADER is only mean for importing data from flat files(usually text files) into ORACLE tables.
for importing data into oracle tables using sql*loader use below steps
1) create a sql*loader control file.
it looks like as follows
LOAD DATA
INFILE 'sample.dat'
BADFILE 'sample.bad'
DISCARDFILE 'sample.dsc'
APPEND
INTO TABLE emp
TRAILING NULLCOLS
or for sample script of control file search google.
2) at command prompt issue following
$ sqlldr test/test
enter control file=<give control file name which you create earlier>
debug any errors (if occured) -
Loading data with dates using SQL*Loader
Dear everyone
I am currently trying to load some data containing dates using SQL*Loader.
For termination of fields I have been using ^ because I have some book titles which contain " and ' as part of their title. I found that the TO_DATE function did not seem to work using ^ instead of ". Would I be correct? I think the Oracle manual says that " must be used.
After some Web research I eventually amended my control file to as follows:
load data
infile 'h:\insert_statements\22_insert_into_SCAN_FILE_INFO.txt'
REPLACE
into table SCAN_FILE_INFO
fields terminated by "," optionally enclosed by '^'
TRAILING NULLCOLS
(scan_id, scan_filename
file_format_id
orig_scanning_resolution_dpi
scanner_id, scanner_operator_id
scanning_date "TO_DATE (:scanning_date, 'YYYY-MM-DD')"
original_map_publication_id
reprint_publication_id)
A simple line of data is as follow:
280001, ^1910 - London^, 270001, 400, 250001, 260001, "TO_DATE('2007-06-06', 'YYYY-MM-DD')", 200019,
The final column being null.
However when I attempt that I get the following error message:
Record 1: Rejected - Error on table SCAN_FILE_INFO, column SCANNING_DATE.
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
If I change the scanning_date part to:
scanning_date "EXPRESSION TO_DATE (:scanning_date, 'YYYY-MM-DD')",
or
scanning_date "CONSTANT TO_DATE (:scanning_date, 'YYYY-MM-DD')",
I get the error message:
Record 1: Rejected - Error on table SCAN_FILE_INFO, column SCANNING_DATE.
ORA-00917: missing comma
As soon as I do the following:
scanning_date "EXPRESSION, TO_DATE (:scanning_date, 'YYYY-MM-DD')",
or
scanning_date "CONSTANT, TO_DATE (:scanning_date, 'YYYY-MM-DD')",
I get too many values error message:
Record 1: Rejected - Error on table SCAN_FILE_INFO.
ORA-00913: too many values
I also tested out scanning_date DATE "YYYY-MM-DD", but that just gave the same ORA-01841 error message as above.
I must be doing something very simple which is wrong but I cannot figure it out.
Kind regards
TimAnd why do you have scanning date as "TO_DATE('2007-06-06', 'YYYY-MM-DD')" in your infile? All you need is 2007-06-06. If you can not change infile generation code, use:
load data
infile 'h:\insert_statements\22_insert_into_SCAN_FILE_INFO.txt'
REPLACE
into table SCAN_FILE_INFO
fields terminated by "," optionally enclosed by '^'
TRAILING NULLCOLS
(scan_id, scan_filename
file_format_id
orig_scanning_resolution_dpi
scanner_id, scanner_operator_id
scanning_date "TO_DATE(REPLACE(REPLACE(:scanning_date,'TO_DATE('),'''YYYY-MM-DD'')'), 'YYYY-MM-DD')"
original_map_publication_id
reprint_publication_id)SY. -
How can we load a LOBS data usng Sql loader?
How can we load a LOBS data usng Sql loader?
Did you go through SQL Loader documentation?
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_loading.htm#i1006803 -
Loading VARRAY's with SQL loader, direct path in 9i?
Isn't it possible to load VARRAY's with SQLloader and direct path in a Oracle 9i database?
/Magnus Hornstrom
mailto:[email protected]Daniel,
I appreciate your response alot.
Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
I will actually do some time tests myself, but I would appreciate your opinion.
Once again thanks for the great info you have provided. -
Unknown issue while loading .dbf file by sql loader
Hi guys,
I am having a unknown issue while loading .dbf file by sql loader.
I need to load .dbf data into oracle table.for this I converted .dbf file by just changing its extension as .csv . file structure after changing .dbf to .csv --
C_N_NUMBER,COMP_CODE,CPT_CODE,C_N_AMT,CM_NUMBER
1810/4,LKM,30,45,683196
1810/5,LKM,30,45,683197
1810/6,LKM,30,45,683198
1810/7,LKM,30,135,683200
1810/8,LKM,30,90,683201
1810/9,LKM,1,45,683246
1810/9,LKM,2,90,683246
1810/10,LKF,1,90,683286
2810/13,LKJ,1,50.5,680313
2810/14,LKJ,1,50,680316
1910/1,LKQ,1,90,680344
3910/2,LKF,1,238.12,680368
3910/3,LKF,1,45,680382
3910/4,LKF,1,45,680395
7910/5,LKS,1,45,680397
7910/6,LKS,1,90,680400
7910/7,LKS,1,45,680401
7910/8,LKS,1,238.12,680414
7910/9,LKS,1,193.12,680415
7910/10,LKS,1,45,680490
then I am loading it by sql loader.but I am getting always error below ...
Record 1: Rejected - Error on table C_N_DETL_TAB, column CPT_CODE.
ORA-01438: value larger than specified precision allowed for this column
Record 2: Rejected - Error on table C_N_DETL_TAB, column CPT_CODE.
ORA-01438: value larger than specified precision allowed for this column
table structure-
create table C_N_DETL_tab
"C_N_NUMBER" VARCHAR2(13),
"COMP_CODE" VARCHAR2(3),
"CPT_CODE" NUMBER(4),
"C_N_AMT" NUMBER(20,18),
"CM_NUMBER" NUMBER(7)
control file-
options(skip=1)
load data
infile '/softdump/pc/C_N_DETL.csv'
badfile '/softdump/pc/C_N_DETL.bad'
discardfile '/softdump/pc/C_N_DETL.dsc'
into table C_N_DETL_tab
truncate
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
C_N_NUMBER CHAR,
COMP_CODE CHAR,
CPT_CODE INTEGER,
C_N_AMT INTEGER,
CM_NUMBER INTEGER
but guys when I am increasing size of all columns of tabel upto its max value then data is loaded but when I am checking column max length after data loaded then its very less..
changed table structure-
create table C_N_DETL_tab
"C_N_NUMBER" VARCHAR2(130),
"COMP_CODE" VARCHAR2(30),
"CPT_CODE" NUMBER(32), ---- max value of number
"C_N_AMT" NUMBER(32,18), ---- max value of number
"CM_NUMBER" NUMBER(32) ---- max value of number
now i ma running ...
sqlldr express/express control=C_N_DETL.ctl log=C_N_DETL.log
o/p-
Table C_N_DETL_TAB, loaded from every logical record.
Insert option in effect for this table: TRUNCATE
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
---------- ---- ---- C_N_NUMBER FIRST * , O(") CHARACTER
COMP_CODE NEXT * , O(") CHARACTER
CPT_CODE NEXT 4 INTEGER
C_N_AMT NEXT 4 INTEGER
CM_NUMBER NEXT 4 INTEGER
Table C_N_DETL_TAB:
20 Rows successfully loaded.
0 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.
select max(length( CPT_CODE))from C_N_DETL_tab ---> 9
can u tell me why I need to increase size of table columns upto max value?although length of data is soo much less.
kindly check it..thnx in advance...
rgds,
pcNo database version of course. Unimportant.
If I recall correctly, it is 'integer external ' and you would best double quoting the alphanumerics (which you didn't ).
Try changing integer in integer external in the ctl file.
Sybrand Bakker
Senior Oracle DBA -
Problem when loading xml file using sql loader
I am trying to load data into table test_xml (xmldata XMLType)
i have an xml file and i want whole file to be loaded into a single column
when i use the following control file and executed from command prompt as follows
sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl direct=true;:
LOAD DATA
INFILE *
TRUNCATE INTO TABLE test_xml
xmltype(xmldata)
FIELDS
ext_fname filler char(100),
xmldata LOBFILE (ext_fname) TERMINATED BY EOF
BEGIN DATA
/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
the file is being loaded into table perfectly.
unfortunatley i cant hardcode file name as file name will be changed dynamically.
so i removed the block
BEGIN DATA
/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
from control file and tried to execute by giving file path from command line as follows
sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml direct=true;
but strangely it's trying to load each line of xml file into table instead of whole file
Please find the log of the program with error
Loading of XML through SQL*Loader Starts
SQL*Loader-502: unable to open data file '<?xml version="1.0"?>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '<Root>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '<Type>Forms</Type>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '<Type>PLL</Type>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
please help me how can i load full xml into single column using command line without hardcoding in control file
Edited by: 907010 on Jan 10, 2012 2:24 AMbut strangely it's trying to load each line of xml file into table instead of whole fileNothing strange, the data parameter specifies the file containing the data to load.
If you use the XML filename here, the control file will try to interpret each line of the XML as being separate file paths.
The traditional approach to this is to have the filename stored in another file, say filelist.txt and use, for example :
echo "/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml" > filelist.txt
sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=filelist.txt direct=true;
Maybe you are looking for
-
How do I burn songs from the iTunes Library to a CD-R?
Can someone tell me how to get a blank CDR to show up in the left column of itunes so that I may burn some of my music? I can get all three of my internal disc drives to show a commercial and burned CDR of music, I just can't get the blank ones to sh
-
MacBook Pro i7 running incredibly slow - could it be Migration Assistant?
My new MacBook Pro i7 is running super slow - generally, everything is slow to open, it hangs, t stalls and crashes completely - I thought this could be something to do with Migration Assistant, any ideas? I used Migration Assistant to copy the user
-
Can anyone recommend good html protection software
Hi all Does anyone know of a good html protection program or extension? I need to stop text & images being copied off my web site by disabling copy & save as from the right click menus, disable screen grabs, disable selecting blocks of text etc. I've
-
Where to store DBCP and what to do next?
Dear All, I would like to use the DBCP(Apache DB pool). I have download (commons-dbcp-1.4-bin.tar.gz) from http://commons.apache.org/dbcp/download_dbcp.cgi. I am using fedora linux and have unzip it too. What should be my next step is where I am stuc
-
LabView Beginner embarking on Motion/Vision App.
I am embarking on my first big LabView project; a motion controlled vision application that is going to measure the diameter of the bore of a glass tube. I would like to get as much information and ideas as possible from as many colleagues as are int