Create an external table fails
I'm trying to map a trace file in an external table ' but I get the error message "missing the key word."set verify off
create or replace directory 'TRACE_DIR' as '/db_home/oracle/product/diag/rdbms/test/dtms_t/trace';
column id new_value os_user;
SELECT sys_context('USERENV', 'OS_USER') id FROM DUAL;
BEGIN
EXECUTE IMMEDIATE 'alter session set tracefile_identifier = &os_user' ;
END;
/
column tracefile_loc new_value tracefile
select SUBSTR(tracefile_loc,INSTR(tracefile_loc,'/',-1)+1) tracefile_loc
from
( select value ||'/'||(select instance_name from v$instance) ||'_ora_'||
(select spid||case when traceid is not null then '_'||traceid else null end
from v$process where addr = (select paddr from v$session
where sid = (select sid from v$mystat
where rownum = 1
)
)
) || '.trc' tracefile_loc
from v$parameter where name = 'user_dump_dest'
)
/
jbrock@ddtms_t> CREATE TABLE trace_ext
2 (line varchar2(80)
3 )
4 ORGANIZATION EXTERNAL
5 (
6 TYPE ORACLE_LOADER
7 DEFAULT DIRECTORY trace_dir
8 ACCESS PARAMETERS
9 (
10 records delimited by newline
11 missing field values are null
12 ( line
13 )
14 )
15 LOCATION (&&tracefile)
16 )
17 REJECT LIMIT UNLIMITED;
LOCATION (ddtms_t_ora_9101_JBROCK.trc)
*
ERROR at line 15:
ORA-00905: missing keyword
Hello
JimmyB wrote:
... jbrock@ddtms_t> CREATE TABLE trace_ext 2 (line varchar2(80) 3 ) 4 ORGANIZATION EXTERNAL 5 ( 6 TYPE ORACLE_LOADER 7 DEFAULT DIRECTORY trace_dir 8 ACCESS PARAMETERS 9 ( 10 records delimited by newline 11 missing field values are null 12 ( line 13 ) 14 ) 15 LOCATION (&&tracefile) 16 ) 17 REJECT LIMIT UNLIMITED; LOCATION (ddtms_t_ora_9101_JBROCK.trc) * ERROR at line 15: ORA-00905: missing keyword
The location must not be single-quotes? For line 15, try
LOCATION ('&&tracefile')
Tags: Database
Similar Questions
-
Creating the external Table to alert log
Hello
I create an external table in oracle database 11g for the alert log file monitoring (to find the ORA errors), I used this statement to create an external table
Create the directory TESTForAlertLog as 'E:\oracle\product\10.2.0\admin\db\bdump '.
create table Alert_Log)
Message varchar2 (30),
Date of the day
)
(external) Organization
type oracle_loader
Default directory TESTForAlertLog
(settings) access
records delimited by newline
fields ended by ',' possibly framed by "" "
missing field values are null
(
"Message."
'DAY' DATE 'DD MM YYYY ".
)
)
location ("alert_db.log")
)
reject limit unlimited;
Output is
DAY OF MSG
ORACLE V10.2.0.1.0 - Production vsnsta = 0
ORACLE V10.2.0.1.0 - Production vsnsta = 0
ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
ORA-00313: open failed for the members of the group log 1 of thread 1
ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"
ORA-27041: could not open the file
ORA-00313: open failed for the members of the Group of newspapers wire 2 1
ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"
ORA-27041: could not open the file
ORA-00313: open failed for the members of Group 3, Journal of thread 1
ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"
ORA-27041: could not open the file
ORACLE V10.2.0.1.0 - Production vsnsta = 0
ORACLE V10.2.0.1.0 - Production vsnsta = 0
But I need the eyes of output like this
DAY OF MSG
ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
ORA-00313: open failed for the members of the group log 1 of thread 1
ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"Mon dec 22 13:10:48 2008
ORA-27041: could not open the file
ORA-00313: open failed for the members of the Group of newspapers wire 2 1
ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"Mon dec 22 13:10:48 2008
ORA-27041: could not open the file
ORA-00313: open failed for the members of Group 3, Journal of thread 1
ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"Mon dec 22 13:10:48 2008
ORA-27041: could not open the file
ORACLE V10.2.0.1.0 - Production vsnsta = 0
ORACLE V10.2.0.1.0 - Production vsnsta = 0
I need the message and time of the message occurred
No idea... is it possible to get this output...
Thank U very much
Concerning
SHANRead this - he explains how:
http://www.singleQuery.com/2007/02/read-the-alert-log-with-SQL/ -
create an external table based on local drive
Hello world
Is it possible to create an external table and that it points to a file on my local drive?
It is perhaps a silly question. I'm sorry.
Thank you
Lydiea
In addition to the response of William Robertson (which is correct), if you do not have a way to make the server access to your local disk, you can use sql loader on your local computer to load the data into an actual table.
-
Creating the external Table - length fixed
I was responsible for importing data in fixed length of a text file in an oracle table. To do this, I create an external Table. I'm finally at the point where the script works to create the table, but when I run a statement select for ' select * from external table ', I have received only a single line/record (the first line of the text file).
This is what the script looks like:
CREATE TABLE EXT_MD
(
AR_SID VARCHAR2 (12),
AR_SSN VARCHAR2 (4).
AR_LASTNAME VARCHAR2 (29),
AR_FIRSTNAME VARCHAR2 (27),
AR_RACE VARCHAR2 (1).
DATE OF AR_DOB,
NA_LASTNAME VARCHAR2 (29),
NA_FIRSTNAME VARCHAR2 (27),
NA_SEX VARCHAR2 (1).
ID_FBI_ID VARCHAR2 (9).
AR_ARR_DATE VARCHAR (26).
AR_PRIMARY_CHARGE VARCHAR2 (35),
DEM_STREET_NBR VARCHAR2 (5).
DEM_STREET_NAM VARCHAR2 (10),
DEM_STREET_SFX VARCHAR2 (2),
DEM_STREET_DIR VARCHAR2 (2),
DEM_CITY VARCHAR2 (10),
DEM_STATE VARCHAR2 (2),
DEM_ZIP VARCHAR2 (5).
AR_TRACK_NUM VARCHAR2 (12),
DEM_ORI VARCHAR2 (9)
)
EXTERNAL ORGANIZATION
(TYPE ORACLE_LOADER
THE DEFAULT DIRECTORY EXT_DIR
ACCESS SETTINGS
(
RECORDS DELIMITED BY NEWLINE
BADFILE EXT_DIR: 'ext_bag.bad'
EXT_DIR LOG file: 'ext_good.log'
FIELDS
MISSING FIELD VALUES ARE NULL
(
AR_SID(1:12) CHAR (12),
AR_SSN(13:16) CHAR (4),
AR_LASTNAME(17:45) TANK (29),
AR_FIRSTNAME(46:72) TANK (27),
AR_RACE(73:73) CHAR (1),
AR_DOB(74:83) CHAR(10) DATE_FORMAT DATE MASK "YYYY-MM-DD"
NA_LASTNAME(84:112) TANK (29),
NA_FIRSTNAME(113:139) TANK (27),
NA_SEX(140:140) CHAR (1),
ID_FBI_ID(141:149) CHAR(9),
AR_ARR_DATE(150:175) TANK (26),
AR_PRIMARY_CHARGE(176:210) CHAR (35),
DEM_STREET_NBR(211:215) CHAR (5),
DEM_STREET_NAM(216:225) CHAR(10),
DEM_STREET_SFX(226:227) CHAR (2),
DEM_STREET_DIR(228:229) CHAR (2),
DEM_CITY(230:239) CHAR(10),
DEM_STATE(240:241) CHAR (2),
DEM_ZIP(242:246) CHAR (5),
AR_TRACK_NUM(247:258) CHAR (12),
DEM_ORI(259:267) TANK (9)
)
)
LOCATION ("daily.txt")
)
REJECT LIMIT UNLIMITED;
That's what part of the log file looks like:
For table EXT_MD field definitions
Record format DELIMITED BY newline
Data in file have same "endianness" as platform
Rows with all null fields are accepted
Fields of the Data Source:
AR_SID TANK (12)
Position of the record (1: 12)
Cut the whites of right
AR_SSN CHAR (4)
Position of the record (13: 16)
Cut the whites of right
etc (shows the rest of the columns with similar message) then at the end of the log file
Transformations of columns
ROWID
Date table EXT_MD Cache statistics
Maximum size: 1000
Entries: 1
Hits: 0
Rate: 0
Assistance or management will most certainly be appreciated. Thanks in advance.
Published by: zephyr223 on March 25, 2013 10:47Hello
Which characters do you have in your data file that define the "line break".Oracle documentation:
If DELIMITED BY NEWLINE is specified, then the actual value used is platform-specific. On UNIX platforms, NEWLINE is assumed to be "\n". On Windows NT, NEWLINE is assumed to be "\r\n".
you have these 'hidden' characters in your folder or are they something else?
Kind regards
Harry -
Create an external table to import csv to dynamic action
Hello
I'm trying to import data from a csv file into a table. The csv is located on the server and I try to do an external table to copy its contents to the master data table.
I can't even save the code, without this error:
It works very well in the SQL Developer.PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge
CREATE TABLE "DATA_CSV" ( "C1" VARCHAR2(255), "C2" VARCHAR2(255), "C3" VARCHAR2(255), "C4" VARCHAR2(255), "C5" VARCHAR2(255), "C6" VARCHAR2(255), "C7" VARCHAR2(255), "C8" VARCHAR2(255), "C9" VARCHAR2(255), "C10" VARCHAR2(255), "C11" VARCHAR2(255), "C12" VARCHAR2(255), "C13" VARCHAR2(255), "C14" VARCHAR2(255), "C15" VARCHAR2(255), "C16" VARCHAR2(255), "C17" VARCHAR2(255), "C18" VARCHAR2(255), "C19" VARCHAR2(255), "C20" VARCHAR2(255) ) ORGANIZATION EXTERNAL ( TYPE ORACLE_LOADER DEFAULT DIRECTORY FTP_FOLDER ACCESS PARAMETERS ( records delimited BY newline fields terminated BY ';' optionally enclosed BY '"' lrtrim missing field VALUES are NULL ) LOCATION ('foo.csv') ); {code} The server I work on, runs on Apex 4.2.2. Thanks in advance, for your help Skirnir
-
Helps to create an external table to a dashboard
I am creating a table in an external file that will receive and organize partitions from Quiz.fla when you click on the button to submit the results. I also want another fla file to reference the external table and pull 15 scores him and then view scores on a scrolling banner. I want the banner to be able update dynamically (I guess it would accomplish the reloading of the banner fla every time it reaches the end of its cycle, with the first load of the image of the outer table on an onClipEvent action), how it will update while remaining open. The main reason that I need two separate files for the quiz and the banner of the score is that they are displayed on two different monitors. What would be the most effective way to solve this problem? I know a little actionscript, but I don't have much experience with the call for data and functions from external fla or as files (table and function referring to the way in which the data will be organized inside the table will be in a file separate .as).
I currently work in AS2, since I had almost no experience with AS3.
Please mark this thread as answered, if it is closed.
-
Creating an external Table using Xml Dataset - how to include null values?
The script below works fine, but I'm fails as soon as the xml file does not contain a column for a line, or has the value as "< ACTUAL_FLAG / >.
Is there way I can show the missing values as null?
With the help of "missing field is null values" does not work for me.
Any help would be appreciated.
< < < < < < < < < <
/ * Formatting on the 2010-05-24 14:53:01 (v5.136.908.31019 PS5) * /.
DROP TABLE ENE_GL_SAP_TEMP;
CREATE TABLE ENE_GL_SAP_TEMP
(
status VARCHAR2 (50).
number of ledger_id (15),
set_of_books_id NUMBER (15),
accounting_date DATE,
CURRENCY_CODE VARCHAR2 (15).
Date_Created DATE,
created_by NUMBER (15),
actual_flag VARCHAR2 (1).
user_je_category_name VARCHAR2 (25).
user_je_source_name VARCHAR2 (25).
Segment1 VARCHAR2 (25).
Segment2 VARCHAR2 (25).
segment3 VARCHAR2 (25).
segment4 VARCHAR2 (25).
segment5 VARCHAR2 (25).
segment6 VARCHAR2 (25).
segment7 VARCHAR2 (25).
entered_dr NUMBER,
entered_cr NUMBER,
accounted_dr NUMBER,
accounted_cr NUMBER,
Reference1 VARCHAR2 (100)
)
EXTERNAL ORGANIZATION
(
TYPE ORACLE_LOADER
THE DEFAULT DIRECTORY ENE_SOLAR_FTP_IN_DIR
ACCESS SETTINGS
(
records delimited by ' < / GL_REC >.
BadFile "temp.bad."
logfile "temp.log.
fields)
filler TANK (2000) TERMINATED BY "< GL_REC >,"
status (50) tank surrounded by '<>STATUS' and ' < / STATUS >. "
ledger_id char (15), framed by '< LEDGER_ID >' and ' < / LEDGER_ID >, "
set_of_books_id char (15), framed by '< SET_OF_BOOKS_ID >' and ' < / SET_OF_BOOKS_ID >, "
accounting_date char (11), framed by '< ACCOUNTING_DATE >' and ' < / ACCOUNTING_DATE >, "
Char (15) currency_code framed by '< CURRENCY_CODE >' and ' < / CURRENCY_CODE >. "
tank (11) Date_Created framed by '< DATE_CREATED >' and ' < / DATE_CREATED > "date_format DATE mask MON/dd/yyyy". "
created_by char (12), framed by '< CREATED_BY >' and ' < / CREATED_BY >. "
actual_flag char (1) surrounded by '< ACTUAL_FLAG >' and ' < / ACTUAL_FLAG >, "
user_je_category_name tank (25), framed by '< USER_JE_CATEGORY_NAME >' and ' < / USER_JE_CATEGORY_NAME >, "
user_je_source_name tank (25), framed by '< USER_JE_SOURCE_NAME >' and ' < / USER_JE_SOURCE_NAME >, "
tank (25) Segment1 framed by '< SEGMENT1 >' and ' < / SEGMENT1 >. "
tank (25) Segment2 framed by '< SEGMENT2 >' and ' < / SEGMENT2 >. "
tank (25) segment3 framed by '< SEGMENT3 >' and ' < / SEGMENT3 >. "
segment4 tank (25), framed by '< SEGMENT4 >' and ' < / SEGMENT4 >, "
tank (25) segment5 framed by '< SEGMENT5 >' and ' < / SEGMENT5 >, "
segment6 tank (25), framed by '< SEGMENT6 >' and ' < / SEGMENT6 >, "
segment7 tank (25), framed by '< SEGMENT7 >' and ' < / SEGMENT7 >. "
entered_dr char (15), framed by '< ENTERED_DR >' and ' < / ENTERED_DR >, "
entered_cr char (15), framed by '< ENTERED_CR >' and ' < / ENTERED_CR >, "
accounted_dr char (15), framed by '< ACCOUNTED_DR >' and ' < / ACCOUNTED_DR >, "
accounted_cr char (15), framed by '< ACCOUNTED_CR >' and ' < / ACCOUNTED_CR >, "
tank (100) of reference1 framed by '< REFERENCE1 >' and ' < / REFERENCE1 >.
)
)
LOCATION ("books2.xml")
)
PARALLEL
REJECT LIMIT UNLIMITED;
Select * from ENE_GL_SAP_TEMP;
> > > > > > > > > > > > > > > > > >Hello
It's funny, I never thought of parsing an XML through SQL * Loader before.
Are you aware of the XML DB features? They are intended only for what you are doing here.
Also, please look at function XMLTable. It allows you to directly map your XML file in columns and relational rows.
For example, by giving an example of file "book.xml" like this:
1 2 ABC DEF 1 3 XYZ TTT Then, just do:
SELECT * FROM XMLTable( '/GL_RECS/GL_REC' passing xmltype( bfilename('XML_DIR','book.xml'), nls_charset_id('CHAR_CS') ) columns status varchar2(50) path 'STATUS', ledger_id varchar2(15) path 'LEDGER_ID', segment1 varchar2(25) path 'SEGMENT1', segment2 varchar2(25) path 'SEGMENT2' );
-
Create an external Table - KUP-04020
11.2.0.1.0 64-bit
... ORGANIZATION EXTERNAL (TYPE ORACLE_LOADER DEFAULT DIRECTORY ext_tab_dir ACCESS PARAMETERS (RECORDS DELIMITED BY NEWLINE FIELDS TERMINATED BY ',' ENCLOSED BY '"' (... {code} {code}ORA-29913: error in executing ODCIEXTTABLEFETCH callout ORA-29400: data cartridge error KUP-04020: found record longer than buffer size supported, 524288, in c:\ext_tables\nff.csv{code} When opening up the data for examination, the records are delimited with LF, and not CRLF. Would this be picked up with delimiter NEWLINE, or should I use something else?
To resolve this problem, change the delimiter CHARACTERSET and reviews
ex:
saves the delimiter character > record delimiter '\n '.Add in the parameters of access CHARACTERSET 'utf8 '.
-
Hello
I made an excel csv file, but some of the columns of the excel file are null, so I did type .dat
and when I try: select *.
from caen:
I get this error:
Error at startup on line 2 of the command:
Select *.
Caen
Error report:
SQL error: ORA-29913: error in executing ODCIEXTTABLEFETCH legend
ORA-30653: reject limit reached
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.
I also have a comma after each line FRO this .dat file.
Can you help me to import this file?
Thank youSome of your data values seem to have a comma in the data:
Cultivarea cerealelor (exclusiv orez), plantelor leguminoase si aplantelor producatoare de seminte oleaginoase Cultivarea legumelor si a pepenilor, a radacinoaselor si tuberculilor Cultivarea fructelor arbustilor fructiferi, capsunilor, nuciferilorsi a altor pomi fructiferi Cultivarea condimentelor, plantelor aromatice, medicinale si aplantelor de uz farmaceutic
I suggest that you change your data file if you can so that text fields are surrounded with double quotes.
-
Create the external data with dates table
I have a CSV file that looks a little like this:
abcuser,12345,5/12/2012,5,250.55
xyzuser, 67890, 5/1/2012,1,50
ghjuser, 52523, 1 January 00
When I create the external table, then question him, I get an error of date:
CREATE TABLE xtern_ipay
(
username VARCHAR2 (50).
acctNbr NUMBER 20 (0)
datelastused DATE,
number_rtxns NUMBER (12: 0).
amtused NUMBER (12: 0)
)
external organization (TYPE oracle_loader DEFAULT directory "XTERN_DATA_DIR"
(Settings) ACCESS
records delimited BY newline completed fields BY ',')
release location ("SubscriberStatistics.csv") limit) UNLIMITED;
The error I see in the newspaper of rejection:
For table XTERN_IPAY field definitions
Record format DELIMITED BY newline
Data in file have same "endianness" as platform
Rows with all null fields are accepted
Fields of the Data Source:
USERID CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
ACCTNBR CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
DATELASTUSED CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
NUMBER_RTXNS CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
AMTUSED CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
column in treatment of DATELASTUSED error in the row 1 for the g:\externaltables\SubscriberStatistics.csv data file
ORA-01858: a non-digit character was found here where was waiting for a digital
column in treatment of DATELASTUSED error in line 2 to the g:\externaltables\SubscriberStatistics.csv data file
ORA-01858: a non-digit character was found here where was waiting for a digital
column in treatment of DATELASTUSED error on line 3 for the g:\externaltables\SubscriberStatistics.csv data file
ORA-01858: a non-digit character was found here where was waiting for a digital
Any ideas on that? I know I must tell oracle the date on the external file format, but I can't understand it.
-
Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL
Hi guys,.
I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:
------------------------------------------------------------------------
ERROR on line 5:
ORA-00911: invalid character
ORA-06512: at "GEO. TEST_DDL', line 4
ORA-06512: at line 5
-------------------------------------------------------------------------
I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.
If anyone can help with ideas or experience?
Geoffrey KossamiThe error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.
There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.
Jack
-
How to load the file tabs with field-delimited a comma in an external table
I am trying to create an external table in oracle 11 g r2. the script is as below. It fails if the field contains commas.
for example, the following data will not be loaded.
ERT 123, poipoipoi, yutio 567
Please suggest how to solve this problem. Thank you!
CREATE TABLE external_interaction
(
TAX_ID NUMBER (8).
pubmed_id_list varchar2 (36),
interaction_id_type varchar2 (36)
)
EXTERNAL ORGANIZATION
(TYPE ORACLE_LOADER
THE DEFAULT DIRECTORY ET_NCBI_DIR
ACCESS SETTINGS
(records delimited by 0 x '0A'
jump 1
BADFILE et_ncbi_log_dir: 'interactions.bad'
Et_ncbi_log_dir LOG file: 'interactions.log'
fields terminated by '\t '.
missing field values are null
REJECT ROWS WITH ALL FIELDS ARE NULL
(
TAX_ID,pubmed_id_list,
interaction_id_type
)
)
LOCATION (ET_NCBI_DIR: "interactions")
)
REJECT LIMIT UNLIMITED
NOPARALLEL
NOMONITORING;Thanks for the reply.
Should I use
collumn_name tank (2000) in the table creation script because it is larger than the default char (255)
-
error returned when I try to install an external table...
gurus of the afternoon...
This is the first time I tried to do this bear so please with me...
I need to create an external table to load in regular data files prior to a MERGER past update/Insert made in ORACLE table as fact here...
But alas, my lack of knowledge has already failed here...
first of all, I run this...ORA-06564: object CHRIS21_UPLOAD_PROCESS does not exist
.. After committing what I then...CREATE OR REPLACE DIRECTORY xtern_data_dir AS 'C:\worKstuff\Small Projects\CHRIS21_Upload_Process';
Its something to do with the name of the folder I run the file from... ? ! ? Am I missing something?CREATE TABLE SU_XTERN_EMP_AUDIT ( staff_member VARCHAR2(150) ,surname VARCHAR2(50) ,forename VARCHAR2(40) ,preferred_name VARCHAR2(40) ,email_id VARCHAR2(10) ,email_address VARCHAR2(50) ,start_date VARCHAR2(10) ,end_date VARCHAR2(10) ,posishun VARCHAR2(10) ,job_title VARCHAR2(40) ,FTE VARCHAR2(10) ,fac_service VARCHAR2(10) ,area VARCHAR2(10) ,gruup VARCHAR2(10) ,LOCATIONs VARCHAR2(6) ,mpoposit VARCHAR2(12) ,mpopstart VARCHAR2(12) ,mpopend VARCHAR2(12) ,mpo_fte VARCHAR2(8) ,mpo_fac VARCHAR2(8) ,mpo_dept VARCHAR2(8) ,mpo_group VARCHAR2(8) ,mpo_loc VARCHAR2(8) ,termin_date VARCHAR2(10) --DATE ,title VARCHAR2(8) ,ft_pt VARCHAR2(2) ,cp_mode VARCHAR2(2) ,new_status VARCHAR2(12) ) ORGANIZATION EXTERNAL ( DEFAULT DIRECTORY CHRIS21_Upload_Process ACCESS PARAMETERS ( records delimited BY newline --fields terminated BY ',' fields ( staff_member position(1:150) VARCHAR2(150), surname position(151:201) VARCHAR2(50) ,forename position(202:242) VARCHAR2(40) ,preferred_name position(243:283) VARCHAR2(40) ,email_id position(284:294) VARCHAR2(10) ,email_address position(295:345) VARCHAR2(50) ,start_date position(346:396) VARCHAR2(10) ,end_date position(397:407) VARCHAR2(10) ,posishun position(408:418) VARCHAR2(10) ,job_title position(419:459) VARCHAR2(40) ,FTE position(460:470) VARCHAR2(10) ,fac_service position(471:481) VARCHAR2(10) ,area position(482:492) VARCHAR2(10) ,gruup position(493:503) VARCHAR2(10) LOCATIONs position(504:510) VARCHAR2(6) ,mpoposit position(511:513) VARCHAR2(12) ,mpopstart position(514:526) VARCHAR2(12) ,mpopend position(527:539) VARCHAR2(12) ,mpo_fte position(540:548) VARCHAR2(8) ,mpo_fac position(549:557) VARCHAR2(8) ,mpo_dept position(558:566) VARCHAR2(8) ,mpo_group position(567:575) VARCHAR2(8) ,mpo_loc position(576:584) VARCHAR2(8) ,termin_date position(585:595) VARCHAR2(10) --DATE ,title position(596:604) VARCHAR2(8) ,ft_pt position(605:607) VARCHAR2(2) ,cp_mode position(608:610) VARCHAR2(2) ,new_status position(611:623) VARCHAR2(12) ) ) LOCATION ('LDAP_report_TESTER_2010-09-09.csv') ) REJECT LIMIT UNLIMITED;
Thanks for looking...
Steven
Published by: Mr_Alkan on Aug 13, 2010 15:08Change this
staff_member position(1:10) VARCHAR(10), surname position(11:60) VARCHAR(50) ,forename position(61:100) VARCHAR(40) ,preferred_name position(101:140) VARCHAR(40) ,email_id position(141:150) VARCHAR(10) ,email_address position(151:200) VARCHAR(50) ,start_date position(201:210) VARCHAR(10) ,end_date position(211:220) VARCHAR(10) ,posishun position(221:230) VARCHAR(10) ,job_title position(231:270) VARCHAR(40) ,FTE position(271:280) VARCHAR(10) ,fac_service position(281:290) VARCHAR(10) ,area position(291:300) VARCHAR(10) ,gruup position(301:310) VARCHAR(10) ,LOCATIONs position(311:316) VARCHAR(6) ,mpoposit position(317:328) VARCHAR(12) ,mpopstart position(329:340) VARCHAR(12) ,mpopend position(341:352) VARCHAR(12) ,mpo_fte position(353:360) VARCHAR(8) ,mpo_fac position(361:368) VARCHAR(8) ,mpo_dept position(369:376) VARCHAR(8) ,mpo_group position(377:384) VARCHAR(8) ,mpo_loc position(385:392) VARCHAR(8) ,termin_date position(393:402) VARCHAR(10) ,title position(403:410) VARCHAR(8) ,ft_pt position(411:412) VARCHAR(2) ,cp_mode position(413:414) VARCHAR(2) ,new_status position(415:426) VARCHAR(12)
TO
staff_member position(1:10) char(10), surname position(11:60) char(50) ,forename position(61:100) char(40) ,preferred_name position(101:140) char(40) ,email_id position(141:150) char(10) ,email_address position(151:200) char(50) ,start_date position(201:210) char(10) ,end_date position(211:220) char(10) ,posishun position(221:230) char(10) ,job_title position(231:270) char(40) ,FTE position(271:280) char(10) ,fac_service position(281:290) char(10) ,area position(291:300) char(10) ,gruup position(301:310) char(10) ,LOCATIONs position(311:316) char(6) ,mpoposit position(317:328) char(12) ,mpopstart position(329:340) char(12) ,mpopend position(341:352) char(12) ,mpo_fte position(353:360) char(8) ,mpo_fac position(361:368) char(8) ,mpo_dept position(369:376) char(8) ,mpo_group position(377:384) char(8) ,mpo_loc position(385:392) char(8) ,termin_date position(393:402) char(10) ,title position(403:410) char(8) ,ft_pt position(411:412) char(2) ,cp_mode position(413:414) char(2) ,new_status position(415:426) char(12)
And see if it works.
For more information, see this link.
http://download.Oracle.com/docs/CD/E11882_01/server.112/e16536/et_params.htm#i1009548
Concerning
REDA
-
ORA-29913 for external table on Windows 7
Hello
Please help with the following problem.
I installed Oracle 11 g on Windows 7 Pro workstation and have created an external table.
I'm getting an ORA-29913 when I select.
What I did is given below.
create the directory imp_files as 'C:\app\user\admin\orcl\dpdump\'-'C:\orcl_work '.
;drop table people
;
create table people)
first name varchar2 (250).
VARCHAR2 (250) last_name,.
hire_date date,
number of salary
)
(external) Organization
type oracle_loader
the default directory data_pump_dir
(settings) access
records delimited by newline
BadFile data_pump_dir: 'pers1%a_%p.bad' /*'pers.bad'*/
data_pump_dir log file: "pers1%a_%p.log" /*'pers.log'*/
fields termintated by ' |'
missing field values are null
(first_name, last_name, hire_date 'dd.mm.yyyy' format mask, salary)
)
location ("pers_table1.txt")
)
reject limit unlimited
;Hello
you completed wrongly spelt...
Try to fix that and try again.
See you soon,.
rich
-
Pretreatment of an external table - table is empty at the end
Hello
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE 11.2.0.1.0 Production."
AMT for Solaris: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Solaris 10 x 86
I'm trying to create an external table that first pre-process a file and then the bed. The problem is that, in the end, the outer table is empty even if the read file is not empty.
First, the table works gunzip on the 'employees.csv.gz' file located in/export/home/oracle/archives and then bed. The file employees.csv.gz exists in the specified location. This is the complete script:
-This Directory keeps the archived files
CREATE or REPLACE DIRECTORY arch_dir AS 'archives/export/home/oracle/archives";
-This directory shows where the command gunzip
CREATE or REPLACE the bin_dir AS DIRECTORY ' / usr/bin';
CREATE TABLE emp_exadata
(
employee_id NUMBER (22, 0),
first name VARCHAR2 (20).
last_name VARCHAR2 (25).
e-mail VARCHAR2 (25).
Phone_Number VARCHAR2 (20).
hire_date DATE,
job_id VARCHAR2 (10),
higher wages (22: 2),
commission_pct NUMBER 22 (2)
manager_id NUMBER (22, 0),
department_id NUMBER (22, 0)
)
EXTERNAL ORGANIZATION
(
TYPE oracle_loader
Arch_dir default DIRECTORY
ACCESS SETTINGS
(
RECORDS delimited BY NEWLINE
preprocessor bin_dir: "gunzip".
end fields BY «»
missing field VALUES are NULL
(
employe_id,
first name,
last_name,
E-mail
Phone_Number,
hire_date CHAR date_format DATE mask "dd-mm-yyyy hh24:mi:ss."
job_id,
salary,
commission_pct,
manager_id,
department_id
)
)
LOCATION ("employees_exp.csv.gz")
)
REJECT LIMIT UNLIMITED;
When I choose to emp_exadata the result set is empty!
SELECT * FROM emp_exadata;
no selected line
When I look at the db server in the directory /export/home/oracle/archives I see no archived file employees_exp.csv. Here is the result of the first three lines:
bash - $3.2-3 employees_exp.csv head
198, Donald, Ollivier, DOCONNEL, 650.507.9833, 21/06/2007 00:00:00, SH_CLERK, 2600, 124, 50,.
199, Douglas, grant, DGRANT, 650.507.9844, 2008-01-13 00:00:00, SH_CLERK, 2600, 124, 50,.
200 Jennifer Whalen, JWHALEN 515.123.4444, 17/09/2003 00:00:00, AD_ASST, 4400, 101, 10.
The end of the lines in the file line is LF (unix style). The encoding is in ANSI format.
I tried to experiment around, but cannot view records when I select in the external table. Please help me to solve it.
I also register the generated log file:
LOG file opened at 01/06/15 16:40:11
For table EMP_EXADATA field definitions
Record format DELIMITED BY newline
Data in file have same "endianness" as platform
Rows with all null fields are accepted
Fields of the Data Source:
EMPLOYEE_ID CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
FIRST NAME CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
LAST_NAME CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
EMAIL CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
PHONE_NUMBER CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
HIRE_DATE TANK (19)
Day DATE data type, date mask dd-mm-yyyy hh24:mi:ss
Completed by «,»
Trim whitespace same as SQL Loader
JOB_ID CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
SALARY CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
COMMISSION_PCT CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
MANAGER_ID CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
DEPARTMENT_ID CHAR (255)
Completed by «,»
Trim whitespace same as SQL Loader
You need to carefully examine the description of the PREPROCESSOR option in the chapter of the manual external Tables utility.
The first point that applies to your question is that the preprocessor must write its data transformed to stdout. To do this with gunzip, you use the - c command line parameter. The second point that applies to your case, in view of the answer to the first point, is that you must write a script shell if your preprocessor requires command line settings.
Kind regards
Bob
Maybe you are looking for
-
Equium A100-027: recovery disk remove second partition data?
I installed the update of Windows Vista Service Pack 2 and now the laptop will not charge.I have a partitioned hard drive and will have to use the restore product disc. I have a lot of pictures and things on the second part of the hard drive.I want t
-
How to scan the document and save it in the laptop.
Original title: scan for laptop How to scan on canon mx420 and place it in the documents on my computer laptop everything wireless
-
I'm running XP SP3 home page. Recently, I get an automatic Windows Update message that a 2007 SP2 update is ready for download and installation. Is that what sounds good since I installed SP3?Thanks for your comments.Andy
-
How can I burn my recordings of .wav for audio disc?
I have a portable recorder on which I made some recordings of playing me the piano. I am now using WMP to try to burn them to an audio CD. I have a red beside them, X once I coached in WMP which says that the drive can not burn because WMP cannot d
-
ESS: failed to create udppacket / fileNotFoundException
Hello everyone, I searched this forum but have not found anything of any help. I tried to test the email newsletters using the new BlackBerry JDE 4.6.0 and its bundled ESS and Device Simulator. I started the SSE in stand-alone Mode and use Outlook Ex