external table with preprocessor option
Hello!Can someone help me, I created an external table with option of preprocessor, but error encountered when querying the external table below.
I use Version 2.1.0.63 oracle sql developer.
I run the query on my client.
My files are under the oracle database server (version is 11.1.0.6).
Linux operating system.
Error report:
SQL error: ORA-29913: error in executing ODCIEXTTABLEOPEN legend
ORA-29400: data cartridge error
KUP-00554: error occurred when parsing the access settings
KUP-01005: syntax error: found 'distinctive sign': expected an a: "badfile, bigEndian, characterset, column, data, delimited, discardfile, disable_directory_link_check, fields, set, load, logfile, language, nodiscardfile, nobadfile, nologfile, date_cache, transformation, TailleLue, chain, skip, territory, variable.
KUP-01008: the bad ID was: PREPROCESSOR
KUP-01007: in column 10 on line 2
29913 00000 - "error in the execution of %s legend".
* Cause: The execution of the specified legend caused an error.
* Action: Examine the error messages take appropriate measures.
Upgrades the database to 11.1.0.7 the only way to solve this problem?
Thank you!
Dhekz
You need version 11.2 database...
http://download.Oracle.com/docs/CD/E11882_01/server.112/e10881/Chapter1.htm#NEWFTCH1
http://download.Oracle.com/docs/CD/E11882_01/server.112/e10595/tables013.htm#ADMIN12898
Tags: Database
Similar Questions
-
External table with the preprocessor file to display the list of files
Hello
in my db 11.2.0.2 I would create an external table with script preprocessor to show me the list of files in a directory.
Preprocessor banally:
#! / bin/bash
CD/MyDir
/ bin/ls-l *.txt 2 >/dev/null
The problem is the file name that contains white space (style windows in a Linux env), for ex:
-rw - r - r - 1 oracle oinstall 920 9 Jun 17:37 File1.txt
-rw - r - r - 1 oracle oinstall 72316 Jun 10 10:37 file GC output1.txt
-rw - r - r - 1 oracle oinstall 72316 Jun 10 10:40 GC file output2.txt
So I can't use FIELDS DELIMITED BY "". ""
FIXED size? No, because the file size change the length of the lines.
I tried to use awk in my preprocessos script, but I have the same problem:
/ bin/ls-l *.txt 2 >/dev/null | / bin/awk ' {printf "%s %.2d %s %s\n", $6, $ 7, $ 8, $9} '.
Any ideas?
Hello
I used java to retrieve information about the files.
-
can bind us a single external table with multiple files in OWB 11 g?
Hello
I wanted to ask if it is possible to link an external table with several source files in same or different places? Or an external table must be bound to a single source file and one place.
Thanks in advance,
Ann.
Published by: Ann on October 8, 2010 09:38Hello Ann,.
Can you please help me by telling me the steps to achieve this.
Right-click on the external table in the project tree, from the menu choose Configure.
then open right clock the node data files dialog Configuration properties and choose from the menu - Create
you will get a new record for the file - name of file data propertyAlso the link of the OWB user guide
http://download.Oracle.com/docs/CD/B28359_01/OWB.111/b31278/ref_def_flatfiles.htm#i1126304Kind regards
Oleg -
External table with the field tab delimiter
With the help of Oracle 11 g Release 2
Here is my table create statement external:
CREATE TABLE global.ext_a_attrib_cmt ( tag VARCHAR2(255) , from$ VARCHAR2(255) , to$ VARCHAR2(255) ) ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER DEFAULT DIRECTORY EXT_DATA_DIR ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE SKIP 1 BADFILE EXT_BAD_DIR:'a_attrib_cmt.bad' LOGFILE EXT_LOG_DIR:'a_attrib_cmt.log' -- FIELDS TERMINATED BY 0X'09' -- TAB delimited FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY "'" MISSING FIELD VALUES ARE NULL REJECT ROWS WITH ALL NULL FIELDS ) LOCATION ('a_attrib_cmt.txt') ) REJECT LIMIT UNLIMITED NOMONITORING /
Here is the text file, a_attrib_cmt.txt:
tag Of TO FrontSpringType_id Coil w/FRONT COIL SPRINGS FrontSpringType_id Sheet the FRONT/w suspension SPRINGS Aspiration_id Naturally aspirated w/o TURBO Aspiration_id Turbocharged w/TURBO Aspiration_id Supercharged w/COMPRESSOR SteeringType_id Grid w/RACK and PINION STEERING SteeringType_id Gear w/GEAR STEERING FuelDeliveryType_id CARB w/o FUEL INJ FuelDeliveryType_id FI w/FUEL INJ BedLength_id ?" BED BodyNumDoors_id ? DR BrakeSystem_id w / ? BRAKES FrontBrakeType_id w/FRONT? BRAKES PUBLIC has privileges to write to the directory EXT_DATA_DIR.
Here is the error I get:
Globall@ORA1 > select count (*) in the ext_a_attrib_cmt;
Select count (*) in ext_a_attrib_cmt
*
ERROR on line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN legend
ORA-29400: data cartridge error
KUP-00554: error occurred when parsing the access settings
KUP-01005: syntax error: found 'minussign': expected an a: "badfile, bigEndian, characterset, column, data, delimited, discardfile,
disable_directory_link_check, fields, fixed, charge, logfile, language, nodiscardfile, nobadfile, nologfile, date_cache, preprocessor, TailleLue, String, jump,
territory, variable.
KUP-01007: line 5, column 8
Just get rid of the comment line. You cannot cave comments to create external table statement. SY.
-
Several flat_files through the external table with only the common columns of loading
Hi, I have 50 flat files and each of them have some columns (fields) common and I need to load only the fields that are common to an external Table. Is any chance to do it with education unique external table. Or I need to load all flat_files at separate tables and then with the ETG and UNION load them only one table.If the page size for all the files are different, I think that your only option would be to define different external tables and create a view that joins all the.
HTH
Srini -
External table with mixed columns
Hello everyone. We use Oracle 11R1. We have an external table pointing to a CSV with 7 columns inside. The file has always column 7 but the column order differs from time to time. Each column has a header that remains consistent. Is there a way to map the column names to the column header, s so that we did not change the definition of the external table every time a new file is available in?
Thank you.
Hello
As John said, you must assign names of columns when the table is created. I guess you could have a dynamic SQL solution that reads the header you mentioned, uses this information to write a CREATE table, drop the table, and then recreated with the new order of the columns.
You may have a view that maps the 7 columns in your table of 7 columns in the view. Which column gets the mapping to that may depend on the header.
-
Loading external Table with quotes
I have a file with fields in the file are as TAB delimiter ~ TAB.
Example as below:
QM ~ CD ~ Exzm ~ BMW
DM ~ BD ~ Exzm ~ BMW
CREATE TABLE test
(
Col_1 VARCHAR2 (100),
Col_2 VARCHAR2 (100),
Col_3 VARCHAR2 (100),
Col_4 VARCHAR2 (100)
)
EXTERNAL ORGANIZATION
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY 'Test_Report '.
ACCESS SETTINGS
(records delimited by '\n'
CHARACTERSET 'UTF8 '.
fields terminated by '\t~\t '.
missing field values are null
)
LOCATION ("test.asc")
)
REJECT LIMIT UNLIMITED;
OUTPUT:
----------------
Data loaded in DB, but col_4 data comes from the quotation as below
col_4
-------
"BMW".
"BMW".
Note: Col1 - col3 data arrives correctly.
2807064 wrote:
A finding on my side.
I found that the values of Col_4 after inserting into DB with "transport return character" (CHR (13)) at the end of each value as shown below when I copy paste the value in notepad ++ "»
Example:
----------
"BMW".
"
But if I see the file I saw that BMW.
My question is, in this case the external table loading must fail right? Why is this it is to load data in DB?
Do you have this file begin life on windows, and then are transferred to * nix to serve an external table? If so, which explains a lot. Windows is the standard record delimiter x '0d0a' (Chr (13) 10) On * nix, it's just x '0A' (10. When the process of loader is scanning for record delimiter he's just looking for the '0A' x and x'd 0' gets included in the data.
Two solutions-
1 - Make sure that the data file is transferred so that the Records delimiters are converted. It's supposed to to happen with ascii ftp mode, but this week I saw several examples in the House of it does not.
2. attach your table definition external to seek the delimiter of actual recording instead of the default value of the operating system. == RECORDS DELIMITED BY X '0D0A '.
-
Error when calling a procedure using an external table with c#.
Hello
I'm developing an application scheduler with Visual Studio 2010 (c#) to start my PL/SQL procedures.
Everything works fine with each procedure, but one who reads the contents of an external table.
Strange thing is when I start the same procedure with Toad, I have no problem, but when I run with my c# code:
OracleCommand cmdMET = new OracleCommand();
cmdMET.CommandText = 'STG_AE. M_MET_S_EXT_DEFECT ';
cmdMET.CommandType = CommandType.StoredProcedure;
con = cmdMET.Connection;
OracleParameter retvalMET = new OracleParameter ("value", OracleDbType.Varchar2, 50);
retvalMET.Direction = ParameterDirection.ReturnValue;
cmdMET.Parameters.Add (retvalMET);
cmdMET.ExecuteNonQuery ();
I got this error:
ORA-29913: error in executing ODCIEXTTABLEFETCH legend
ORA-01722: invalid number
ORA-06512: at "STG_AE. M_MET_S_EXT_DEFECT', line 8
ORA-06512: at "STG_AE. MET_SRC', line 10
ORA-06512: at "STG_AE. PUTS", line 14
ORA-06512: at line 1
I can't understand why it works when I run it with Toad and why I get this error when launching of it with c#... Any advice would be great!
Thank you!
I can't understand why it works when I run it with Toad and why I get this error when launching of it with c#... Any advice would be great!
The error led to think that a string to number conversion fails all by accessing the external table.
What is the format of numeric fields in the external file?
I'm guessing that your session NLS_NUMERIC_CHARACTERS setting is defined differently whether you're in your application c# or toad.
Could check you on both?
-
External table with the empty file
Hello
My version of db: Oracle 11 g
I have a csv file that is empty.
I created an external table the empty csv file.
When I run:
Select count (*) in the externaltblname;
It returns 1.
It should return 0 to the right.
In the definition, I specified "SKIP 1.
But he always returns 1.
When I use this external table to load into a table target. It loads a single row with null values.
How to solve this problem. Please advice.
What works for me is the following (t_ext points to a blank csv):
SQL > select count (field) in the t_ext;
COUNT (FIELD)
------------
1
1 selected line.
SQL > select ascii (field) in the t_ext;
ASCII (FIELD)
------------
13
1 selected line.
SQL > select count (replace (field, chr (13))) of t_ext;
COUNT (REPLACE (FIELD, CHR (13)))
-----------------------------
0
1 selected line.
-
Download data from an external table with a where clause clause
Hello
How can I insert data in an external table into a table already created in the database where person_id = person - _id on the external table?
Example:
External table
XX_EXTERNAL_TBL (Person_id, emp_number, emp_name)
Internal table
XX_SQL_LOADER_TEST (Person_id, emp_number, emp_name)
ID of the person already exists on the inner table (want only the last column to import where the ID of the person are the same)
Thank youYou talk of * 'Update' * (Fanfarrias y tambores)
Update XX_SQL_LOADER_TEST SLT
Set emp_number = (SELECT emp_number from XX_EXTERNAL_TBL WHERE AND.) Person_id = HI. PERSON_id)
, emp_name = (SELECT XX_EXTERNAL_TBL emp_name AND where AND.) Person_id = HI. PERSON_id) -
JDBC and creation of external tables with positions
Hello
This could be a trick question or I'm probably going in circles with this one. I know that it is not possible to call the pl/sql command ("together define") using a jdbc connection. Correct me on this one, if I'm wrong ;)
So what I want because I want to run the following using a CallableStatement stmt:
-----
command prompt
Guest: CREATE TABLE 'TEST_IN '. "" TEST_RECEIPT_EXTERNAL "...
command prompt
CREATE TABLE 'TEST '. "" TEST_RECEIPT_EXTERNAL ".
('APPLE' VARCHAR2 (8 CHAR)
, VARCHAR2 (1 CHAR) 'PIE '.
'RECEPTION' VARCHAR2 (58 CHAR)
)
EXTERNAL ORGANIZATION
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY 'TEST_IN '.
ACCESS SETTINGS
(records delimited by newline
fields)
APPLE position (1: 8) CHAR (8),
PIE of the post (9: 9) char (1),
RECEIPT of the post (10: 67) CHAR (58))
)
LOCATION
("TEST_IN": "FLIP.) FLOP.19760104170600'))
REJECT LIMIT UNLIMITED
1 PARALLEL
/
-----
that gives me the expected error:
Parameter Missing or OUT to index: 1
Any thoughts on this would be very useful - thanks in advance,
SaschaUse a regular statement. There is no reason to DDL like that with a callable statement.
You should be OK then. -
When to load the external table condition
HelloIs my version of db: oracle 11g
I have a 6 gig csv file.
I divided it several 15 MB csv files.
But only the first csv file has header (with column headers).
I have to load each of these files into a target table.
I created an external table with jump 1.
But how can I substitute jumping 1 for other csv files.
Is there a way I can do it in the external table definition.
I can't merge the split csv files and run as one big file. So I don't hv this option. Please advice.
You should be able to use the LOAD WHEN clause to exclude a line based on the contents of a field. Or the other
WHEN LOAD 1 / 2! = "ID".
or, if the bonds are quoted,
WHEN LOAD 1:4! = « « ID » »
or you can always add a list of fields to your specifications and the names of the fields in the reference LOAD WHEN the condition instead of using an absolute position.
Don't know if you saw my comments on the use of the tail command before you replied, but if the break-up of the file is part of your project of automated process, and then deleting the header row could certainly be integrated into this process if your on a unix platform and using the split command to split the file.
Kind regards
Bob
-
field of varchar2 external table storing only 255 bytes (4000 bytes)
Hi all
I was wondering if someone can tell me what im missing here.
I have an external table with one column defined as varchar2 (4000 byte). the file contains a line with 255 characters (all the number 2 for simplicity). When I query the table, everything is fine. If I add 1 plus 2 chain (256 characters) it fails. im sure its something stupidly simple, but what am I missing? If he doesn't have to question fine up to 4000 characters?
Thank you
DaveI ran your testcase, thanks for that.
Make sure you read the SQL and PL/SQL FAQ as well (the first thread sticky on this forum), he explains how to post the code formatted and many other things.In any case, the .log file gave me:
LOG file opened at 07/18/11 20:05:33 Field Definitions for table DAVEP2 Record format DELIMITED, delimited by 0A Data in file has same endianness as the platform Rows with all null fields are accepted Fields in Data Source: MY_STRING CHAR (255) Terminated by "," Enclosed by """ and """ Trim whitespace same as SQL Loader
So, what happens if you create the table as follows:
CREATE TABLE davep2 ( my_string VARCHAR2(4000 BYTE) NULL ) ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER DEFAULT DIRECTORY FILE_TEST ACCESS PARAMETERS ( RECORDS DELIMITED BY 0x'0A' BADFILE FILE_TEST:'davep2.bad' LOGFILE FILE_TEST:'davep2.log' FIELDS TERMINATED BY ',' optionally enclosed by '"' and '"' missing field values are null ( my_string char(4000) ) ) LOCATION (FILE_TEST:'DaveP.csv')) REJECT LIMIT 0 NOPARALLEL
-
How do I get the number of incorrect records when you use external tables
Hi all, I have an external table DEPT,.
DEPT. DAT
20. ELECTRONICS
10. SHOES
30. CAMERA
Select * from the Department; only 10 and 30 dept will be led as deptdescr for 20 that there are more than 10 in length so this record will go into the wrong file,
y at - it count any query to display the folder or get any query to get the record to view the entries entries wrong file rather that will drop and see how much is rejected.
Table:
CREATE TABLE DEPT ( DEPT NUMBER, DEPTDESCR VARCHAR2 (10 CHAR) ) ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER DEFAULT DIRECTORY BATCH_INBOX ACCESS PARAMETERS ( RECORDS DELIMITED BY '\r\n' BADFILE BATCH_BAD:'UPS_DEPT_LOAD_%p.bad' LOGFILE BATCH_LOG:'UPS_DEPT_%p.log' NODISCARDFILE FIELDS TERMINATED BY '|' MISSING FIELD VALUES ARE NULL ( DEPT, DEPTDESCR ) ) LOCATION (BATCH_INBOX:'DEPT.DAT') ) REJECT LIMIT UNLIMITED NOPARALLEL NOMONITORING;
You can use the wrong file as the data file for another external table, with the entire line in a single field. Please see the demo below.
Scott@orcl12c > CREATE or REPLACE DIRECTORY batch_inbox AS 'c:\my_oracle_files '.
2.
Created directory.
Scott@orcl12c > CREATE or REPLACE DIRECTORY batch_bad AS 'c:\my_oracle_files '.
2.
Created directory.
Scott@orcl12c > CREATE or REPLACE DIRECTORY batch_log AS 'c:\my_oracle_files '.
2.
Created directory.
Scott@orcl12c > CREATE TABLE DEPT
2 (
NUMBER 3 DEPT,
4 DEPTDESCR VARCHAR2 (10 CHAR)
(5) ORGANIZATION EXTERNAL
6 (TYPE ORACLE_LOADER
7 DEFAULT DIRECTORY BATCH_INBOX
8 ACCESS SETTINGS
9 (RECORDS DELIMITED BY "\r\n"
10 BADFILE BATCH_BAD: 'UPS_DEPT_LOAD.bad'
11 BATCH_LOG:'UPS_DEPT_%p.log LOGFILE'
12 NODISCARDFILE
13 FIELDS TERMINATED BY ' |'
14 MISSING FIELD VALUES ARE NULL
15 (
DEPT 16,
17 DEPTDESCR
18 )
19 )
LOCATION 20 (BATCH_INBOX:'DEPT.) DAT')
21 )
RELEASE 22 UNLIMITED LIMIT
23 NOPARALLEL
24 NOMONITORING;
Table created.
Scott@orcl12c > SELECT * FROM dept
2.
DEPTDESCR DEPT
---------- ----------
10 SHOES
CAMERA 30
2 selected lines.
Scott@orcl12c > CREATE TABLE DEPT_bad
2 (
3 the_whole_row VARCHAR2 (4000)
(4) ORGANIZATION EXTERNAL
5 (TYPE ORACLE_LOADER
6 DEFAULT DIRECTORY BATCH_INBOX
7 ACCESS SETTINGS
8 (RECORDS DELIMITED BY "\r\n"
9 NOLOGFILE
10 FIELDS TERMINATED BY '\r\n '.
11. THE MISSING FIELD VALUES ARE NULL
12 (
13 the_whole_row CHAR (4000)
14 )
15 )
16 RENTAL (BATCH_BAD:'UPS_DEPT_LOAD.) THE BAD ")"
17 )
RELEASE 18 UNLIMITED LIMIT
19 NOPARALLEL
20 NOMONITORING
21.
Table created.
Scott@orcl12c > SELECT * FROM dept_bad
2.
THE_WHOLE_ROW
--------------------------------------------------------------------------------
20. ELECTRONICS
1 selected line.
-
External table Oracle via the Tables API
Hello world
I did experiment with the Oracle NoSQL database recently and I became a bit stuck with the new API of Tables. I have so far successfully of the external tables on the data entered using storage techniques 'vanilla' KV and avro (using generic and specific links) scheme, but create API Tables seems to be another matter entirely.
My question arises in the trainer interface, which has a KeyValueVersion and a KVStore. I can't translate a KeyValueVersion created with the API of Tables in a primary key for recovery (since I don't know what the key generated by the API actually looks like to!) or map it on an avro scheme. The problem seems to be that the Tables API writes data in some format that can be easily translated into a string or an integer (releases from external table lines due to unknown characters if I am trying to retrieve all the values in the database to see what it looks like to), and try to map it to an AVRO map results in the error message 'the data are not as AVRO'.
Scenario:
I created a very simple table in the administration tool KV, which consists of a column personId (integer) that is PK, firstName, lastName, emailAddr (all channels) and enter 5 rows with success. What I want to do is to create an external table called person that returns just those 5 values (and brand new I add to the table of course). This means that I have to first understand what the parentKey value must be defined in the .dat file and how to take this key and it becomes a primary key for the recovery of the line.
Faithful old Google could not find information on how to do this (he was only a thread similar to this with the answer "we'll add it soon"), so I hope that someone here managed to do!
Thank you
Richard
Hi Richard
I understand the issue you are facing. In the current version (12.1.3.0.9) the external tables feature only works with records of K/V not with the Table model, however, in the next version (which us will very soon be GA) we will support integration of external tables with the data of Table model as well. Please make sure that you have signed up for the announcement of release so that we can inform you of the release. I apologize for the inconvenience, he did to you.
Best
Anuj
Sign up for announcements of NoSQL database , so we can warn you versions futures and other updates from the product of NoSQL database
Maybe you are looking for
-
Shares in foreign CODECs?
A few times that I shot the film that I wanted to share a DVD with a person, knowing that they would be trying to view the DVD in another country. More recently, I shot a recital for a family that hosted a foreign exchange student. Everyone was mus
-
Original title: Windows 95/98 Hello I currently have an Apple. There are a few games, I used to play (i.e. Rollercoaster Tycoon) which are mainly Windows 95/98. I have considered buying a less expensive to play PC. What I have to buy windows 95/98 or
-
Packard Bell Easy Note back to factory settings
I want to return my Packard Bell Easy Note A to the factory setting. No idea how to do that?
-
Icon of the item Outlook in Windows Vista
I sometimes copy important emails from Outlook on my desktop to keep. Recently, I found that the icons for all these files 'Élément Outlook' have changed envelope (associated with Outlook 2007 emails) on the generic windows icon (associated with the
-
repair or replace damaged in windows DLL files 7
How to repair or replace .dll files in windows 7 64 bit?