BLOB data and SQL Loader
Has any one used SQL Loader for BLOB data? I would think you can only use it for text type data.
Thanks,
Vic
If each blob is in a separate file, then you should be able to use LOBFILES to load them. Each row in the data file would need to have the name of the file containing the blob for that row. File ulcase9.ctl in the demo directory shows an example of using LOBFILES to load a lob column.
If you want the blob in the data file, then the data file needs to use types that have include length information in then, such as VARRAW, LONG VARRAW or VARRAWC. Also, the records for the data files cannot be terminated by a character string or newline. That's because the blob data might contain the character string or newline in the middle of its data. Instead, you would need to use the VAR record type.
Similar Messages
-
Sql@loader-704 and ORA-12154: error messages when trying to load data with SQL Loader
I have a data base with two tables that is used by Apex 4.2. One table has 800,000 records . The other has 7 million records
The client recently upgraded from Apex 3.2 to Apex 4.2 . We exported/imported the data to the new location with no problems
The source of the data is an old mainframe system; I needed to make changes to the source data and then load the tables.
The first time I loaded the data i did it from a command line with SQL loader
Now when I try to load the data I get this message:
sql@loader-704 Internal error: ulconnect OCISERVERATTACH
ORA-12154: tns:could not resolve the connect identifier specified
I've searched for postings on these error message and they all seem to say that SQL Ldr can't find my TNSNAMES file.
I am able to connect and load data with SQL Developer; so SQL developer is able to find the TNSNAMES file
However SQL Developer will not let me load a file this big
I have also tried to load the file within Apex (SQL Workshop/ Utilities) but again, the file is too big.
So it seems like SQL Loader is the only option
I did find one post online that said to set an environment variable with the path to the TNSNAMES file, but that didn't work..
Not sure what else to try or where to look
thanksHi,
You must have more than one tnsnames file or multiple installations of oracle. What i suggest you do (as I'm sure will be mentioned in ed's link that you were already pointed at) is the following (* i assume you are on windows?)
open a command prompt
set TNS_ADMIN=PATH_TO_DIRECTOT_THAT_CONTAINS_CORRECT_TNSNAMES_FILE (i.e. something like set TNS_ADMIN=c:\oracle\network\admin)
This will tell oracle use the config files you find here and no others
then try sqlldr user/pass@db (in the same dos window)
see if that connects and let us know.
Cheers,
Harry
http://dbaharrison.blogspot.com -
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 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
thanksHi,
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 -
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. -
NLS_DATE_FORMAT and sql*loader
dear all.
Facts:
- oracle 10g r2 std edition
- centos 4.3
i have a problem. i want to upload data through sql*loader but there are date format errors.
- the data in the date field is in that format: MM/DD/YYYY
- i want to upload in that formar : DD/MM/YYYY
My *sh file have the following parameters:
# /bin/bash
export ORACLE_SID=plelpp
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_DATE_FORMAT=DD/MM/YYYY --> THAT IS THE WAY THAT I WANT
sqlldr USERID=SYSTEM, CONTROL=datprinf.ctl, LOG=datprinf.log, data=data_generada_para_datprinf.dat, bad=datprinf.bad, discard=datprinf.dsc
My *.ctl file have this in the date fields:
FECALT DATE "DD/MM/YYYY",
In order to upload the rows i had tested too in that way:
FECALT "TO_DATE(:FECALT,'DD/MM/YYYY')",
but anything, always show me the same error:
Record 1: Rejected - Error on table SUNAT.DATPRINF, column FECALT.
ORA-01843: mes no valido
i had put the export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 in sh file but anyhting works...
i saw the link in metalink about Note:257909.1 but anything.
Please would you help me ???
Thanks a lot !!!Internal storage of date fields is always the same, regardless which format you use. In other words you don't store 'DD/MM/YYY' or anything like that. For sqlloader you have to specify the actual format in the external file. Later on you may choose the output format you want.
Werner -
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) -
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 -
HT1595 My AppleTV seems to be stuck on the "Setting Date and Time" load page
I just moved from a house to an apartment and when I hooked up my appleTV it said "Setting date and time" with a spinning load wheel and it's been doing this for a long time now. I hit MENU on the remote and tried going to Settings> General> Network like it said at the bottom of the screen, but nothing happened. It's connected to the right WiFi network, but the only icons it shows on the home screen are the 'Computers' icon (for Home Sharing) and the 'Settings' icon. My movies, music, tv shows, netflix etc. icons aren't showing up. I restarted it and got as far as the "Setting date and time" load page again, where it just sits and loads.
Welcome to the Apple Community.
Assuming this is not the first time you have used your Apple TV
1. You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
2. Also try restarting the router.
3. If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
If this is a new Apple TV, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123. -
Load data with SQL Loader link field between CSV file and Control File
Hi all,
in a SQL Loader control file, how do you specify link with field in CSV file and Control file?
E.g. if I wat to import the record in table TEST (col1, col2, col3) with data in csv file BUT in different position. How to do this?
FILE CSV (with variable position):
test1;prova;pippo;Ferrari;
xx;yy;hello;by;
In the table TEST i want that col1 = 'prova' (xx),
col2 = 'Ferrari' (yy)
col3 = default N
the others data in CSV file are ignored.
so:
load data
infile 'TEST.CSV'
into table TEST
fields terminated by ';'
col1 ?????,
col2 ?????,
col3 CONSTANT "N"
Thanks,
AttilioWith '?' mark i mean " How i can link this COL1 with column in csv file ? "
Attilio -
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 -
How to insert BLOB datatype image using PL/SQL Procedure and SQL Loader
Hi,
How to insert an image into database using PL/SQL Procedure and also how to insert using SQL Loader. Please help by giving sample code and process description.
Thanks,
Vijay Vhttp://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006
-
I created a small test table to try and figure out the syntax for the control file for SQL*Loader. I'm using what I found on technet but I can't seem to get past ->
** SQL*Loader-416: SDF clause for field LOCALDATA in table QUERY_INTERMEDIA references a non existent field.**
All the files, control file, .bat file and front.tif file all exist in the same directory. I was able to get this to work when the column type was a blob but can't seem to get this right for interMedia.
create table bsw.query_intermedia
customer_id number not null,
image_front ORDSYS.ORDImage
LOB (image_front.source.localData) STORE AS
(tablespace images_lc1 storage (pctincrease 0)
pctversion 0 chunk 8K NOCACHE LOGGING DISABLE STORAGE IN ROW)
pctfree 0
Control file
LOAD DATA
INFILE *
INTO TABLE query_intermedia
TRUNCATE
FIELDS TERMINATED BY ','
(customer_id integer external,
image_front column object
(source column object
localdata_fname FILLER CHAR(128),
localdata LOBFILE(image.source.localdata_fname)
mimetype char(40)
BEGINDATA
1,front.tif,image/tif
.bat file to initiate sqlldr.
sqlldr userid=bsw/bsw control=control_intermedia.ctl log=test_intermedia.log rows=300 bindsize=20000000 readsize=20000000
Any help or suggestions would be much appreciated. Thanks.
nullUser,
There's a [url http://forums.oracle.com/forums/forum.jspa?forumID=260]SQL Developer Forum that's probably better suited for SQL Developer enhancement requests.
John -
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
Maybe you are looking for
-
hi all In transaction me61, there is a text tab in the toolbar. this follows to a page where we can enter evaluate a vendor based on conditions defined. The text entered is a longtext, my requirement is to catch this text. I checked tables CDPOS - wh
-
Report to get the last price of the material
Dear gurus Is there any report to get the material,material description,vendor that last supplied the material , the last rate Regads Sam
-
Re:Standard Functional Module to Create Product in CRM
Hi Frnds , I am Looking for a Standard Functional Module were i can create a Product in CRM , Please kindly let me know the fields that has to be input in that FM or you mail me @ [email protected] . It is Urgent and Immd for me the cor
-
Non-Full Screen Presentation with Keynote?
Does anyone know if it's possible to run a Keynote presentation not in full screen mode? I have a couple of kiosk displays that I'd like to display Keynote presentations along side some data feeds and real-time information from other apps. Do you kno
-
Hi, I have a problem with report RFUMSV00 (Italy) and table TRVOR. The problem is referred to the counter (field VZAHL) in TRVOR, the field has the right value but the report starts always by 1. There was a similar problem with the page number resolv