Doubt in external table.
I want to read the csv file and load into oracle table.But I am getting file with filename_<today date> for every day.
Is it possible to use single External table to read file in dynamic.
or what is the best way to do this?
My oracle version 10g in windows OS.
Thanks in advance,
>
I want to read the csv file and load into oracle table.But I am getting file with filename_<today date> for every day.
Is it possible to use single External table to read file in dynamic.
>
Yes - it is possible. You need to issue an ALTER TABLE command to provide the new filename before you SELECT from the table.
alter table myExternalTable location ('myNewFileName.ext'); See the Location of Datafiles and Output Files section of Chapter 12 External Tables Concepts in the Utilities doc
http://docs.oracle.com/cd/B28359_01/server.111/b28319/et_concepts.htm#i1009094
Also see the Altering External Tables section of Managing External Tables in the DBA Guide
http://docs.oracle.com/cd/E14072_01/server.112/e10595/tables013.htm
That sections has examples for all of the ALTER statements you can use. For example you can also alter the DIRECTORY object being used.
ALTER TABLE admin_ext_employees
DEFAULT DIRECTORY admin_dat2_dir;
Similar Messages
-
External table Authenticaittion
hi all
In external table authenticatio, how to authenticate passwords.
I have usernames and encrypted pwds in an oracle table. How to verify them at user login.
If my doubt is a childish one, plz excuse me
Thanks in AdvanceHi Anand,
When you use external tables, you pretty much have complete control over the process. All you have to do is make sure you encript the password that is passed in and match it with the stored encrypted password. For example suppose I have the following table
OBIEE_SECURITY:
USER PASSWORD
joe jk4A9M#920
Then in an initialization block, when I set the USER variable, I'll set it with a custom query like:
SELECT USER
FROM OBIEE_SECURITY
WHERE USER = ':USER'
AND PASSWORD = ENCRYPT(':PASSWORD')
John Minkjan has an excellent blog about general External Table authentication. See it here
Hope this helps!
Best regards,
-Joe -
How to use external table - creating NFS mount -the details involved
Hi,
We are using Oracle 10.2.0.3 on Solaris 10. I want to use external tables to load huge csv data into the database. This concept was tested and also found to be working fine. But my doubt that : since ours is a J2EE application, the csv files have to come from the front end- from the app server. So in this case how to move them to the db server?
For my testing I just used putty to transfer the file to db server, than ran the dos2unix command to strip off the control character at the end of file. but since this is to be done from the app server, putty can not be used. In this case how can this be done? Are there any risks or security issues involved in this process?
Regardsorausern wrote:
For my testing I just used putty to transfer the file to db server, than ran the dos2unix command to strip off the control character at the end of file. but since this is to be done from the app server, putty can not be used. In this case how can this be done? Are there any risks or security issues involved in this process? Not sure why "putty" cannot be used. This s/w uses the standard telnet and ssh protocols. Why would it not work?
As for getting the files from the app server to the db server. There are a number of options.
You can look at it from an o/s replication level. The command rdist is common on most (if not all) Unix/Linux flavours and used for remote distribution and sync'ing of files and directories. It also supports scp as the underlying protocol (instead of the older rcp protocol).
You can use file sharing - the typical Unix approach would be to use NFS. Samba is also an option if NTLM (Windows) is already used in the organisation and you want to hook this into your existing security infrastructure (e.g. using Microsoft's Active Directory).
You can use a cluster file system - a file system that resides on shared storage and can be used by by both app and db servers as a mounted/cooked file system. Cluster file systems like ACFS, OCFS2 and GFS exist for Linux.
You can go for a pull method - where the db server on client instruction (that provides the file details), connects to the app server (using scp/sftp/ftp), copy that file from the app server, and then proceed to load it. You can even add a compression feature to this - so that the db server copies a zipped file from the app server and then unzip it for loading.
Security issues. Well, if the internals is not exposed then security will not be a problem. For example, defining a trusted connection between app server ad db server - so the client instruction does not have to contain any authentication data. Letting the client instruction only specify the filename and have the internal code use a standard and fixed directory structure. That way the client cannot instruct something like +/etc/shadow+ be copied from the app server and loaded into the db sever as a data file. Etc. -
How to use remote directory for external table
Hi Folks,
I have 2 Oracle 11GR2 64 bit database installed on Win 2008 server as prod1 and prod2.
I have one directory created on prod1 server as EXT_TAB_DIR using the path as D:\OrsDWtest_dir .
I want to use this directory in Prod2 server and use external table using this remote directory.
I am able to access the Prod1 directory from Prod2 machine and also i have created Network map drive as Z drive pointing to that prod1 D:\OrsDWtest_dir directory. Also i checked read and Write permissions are there . I am able to create the external table but when i try to fetch the data i m getting below error ..
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file IOMM_20121213_060736.csv in EXT_TAB_DIR not found
now my doubt is this possible ? Can we use remote directory for External table ? or is there is there any alternative way to achieve same ?
Thanks & Regards,
Vikash Jain(DBA)could you confirm the name and the existence of this file "IOMM_20121213_060736.csv" ?
same error like:
http://www.oracle-base.com/articles/9i/external-tables-9i.php
if the load files have not been saved in the appropriate directory the following result will be displayed.
SQL> SELECT *
2 FROM countries_ext
3 ORDER BY country_name;
SELECT *
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file Countries1.txt in EXT_TABLES not found
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1Edited by: Fran on 10-ene-2013 23:32 -
Prblem white handle files using External tables
Hi,
I Created an external table to handle files.
Its working fine.
But it is rejecting the records, where the fnal column in a record contains no (null) value.
The data is as follows.
empno|name|positon
184|abc|supervisor
185|xyz|
186|efg|clerk
I have given '\n' as row delimiter. and '|' as field delimiter.
For the above data I am getting only the 1st and 3rd records only.
External tables are not accepting the 2nd re4cord.
In the log file it is specifying the error as "KUP-04023: field start is after end of record".
Could anyone please give me some idea to solve this problem.
Thank you,
Regards,
Gowtham Sen.Hi Michaels,
I have one more doubt.
After I added the clause "MISSING FIELD VALUES ARE NULL", its working fine.
Case 1:
The data is as follows.
empno|name|positon
184|abc|supervisor
185|xyz|
186|efg|clerk
Now I am getting the data while query the external table as follows
empno name position
184 abc supervisor
185 xyz <null>
186 efg clerk
Case 2:
But there is a case that the data my come in the following way.
empno|name|positon
184|abc|supervisor
185|xyz|
186|efg|clerk
18
187
For this data I am getting the data if I query external table as follows.
empno name position
184 abc supervisor
185 xyz <null>
186 efg clerk
18 <null> <null>
187 <null> <null>
Here I would like to result the last records because, the records violated the formating. But its not doing as I expected.
Do I need to add any other clauses.
Thanks in advance,
Thank you,
Regards,
Gowtham Sen -
Error: while Selecting External table
Hi everybody,
When i Select an external table i am getting this error. The file is like this:
229|1|506460|SIGROUP |4890|100|0|0|10:31:01|2007/12/17|M009|20191395001|L|B|12|CLIENT|INE547A01012|10:31:00|
229|1|506460|SIGROUP |4900|900|0|0|10:31:01|2007/12/17|M009|20191395001|L|B|13|CLIENT|INE547A01012|10:31:00|
229|1|500407|SWARAJENG |21400|300|0|0|10:33:28|2007/12/17|OWN|20191397001|L|B|154|OWN|INE277A01016|10:33:28|
I had created the Table like this:
SQL> CREATE TABLE TEMP_SAUDA
2 (S_A VARCHAR2(20),
3 S_TYPE VARCHAR2(20),
4 S_CO VARCHAR2(20),
5 S_CONAME VARCHAR2(40),
6 S_RATE NUMBER,
7 S_QTY NUMBER,
8 S_G NUMBER,
9 S_H NUMBER,
10 S_TIME TIMESTAMP WITH TIME ZONE,
11 S_DATE DATE,
12 S_PCODE VARCHAR2(20),
13 S_SETNO VARCHAR2(20),
14 S_M VARCHAR2(20),
15 S_N VARCHAR2(20),
16 S_O VARCHAR2(20),
17 S_CLIENTOWN VARCHAR2(10),
18 S_ISIN VARCHAR2(12),
19 S_ORDER_TIME TIMESTAMP WITH TIME ZONE
20 )
21 ORGANIZATION EXTERNAL
22 (TYPE oracle_loader
23 DEFAULT DIRECTORY BSE17122007
24 ACCESS PARAMETERS
25 (RECORDS DELIMITED BY NEWLINE
26 FIELDS
27 (
28 S_A CHAR(20),
29 S_TYPE CHAR(20),
30 S_CO CHAR(20),
31 S_CONAME CHAR(20),
32 S_RATE CHAR(20),
33 S_QTY CHAR(20),
34 S_G CHAR(20),
35 S_H CHAR(20),
36 S_TIME CHAR(35) date_format TIMESTAMP WITH TIMEZONE mask "DD-MON-RR HH.MI.SSXFF AM TZH:TZM
37 S_DATE CHAR(22) date_format DATE mask "mm/dd/yyyy hh:mi:ss ",
38 S_PCODE CHAR(20),
39 S_SETNO CHAR(20),
40 S_M CHAR(20),
41 S_N CHAR(20),
42 S_O CHAR(20),
43 S_CLIENTOWN CHAR(20),
44 S_ISIN CHAR(20),
45 S_ORDER_TIME date_format TIMESTAMP WITH TIMEZONE mask "DD-MON-RR HH.MI.SSXFF AM TZH:TZM"
46 )
47 )
48 location (BSE17122007:'BR171207.DAT')
49 )
50 ;
Table created.
SQL> SELECT * FROM TEMP_SAUDA;
SELECT * FROM TEMP_SAUDA
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "date_format": expecting one of: "binary_double,
binary_float, comma, char, date, defaultif, decimal, double, float, integer, (,
nullif, oracle_date, oracle_number, position, raw, recnum, ), unsigned,
varrawc, varchar, varraw, varcharc, zoned"
KUP-01007: at line 21 column 14
ORA-06512: at "SYS.ORACLE_LOADER", line 19
Is there any mistake in this table creation.
what i have to declare to the time format if the format in the file id hh:mm:ss
Thank u...!
RaviThe output you posted is completely wrong, I could not even create the table without errors.
Try with this.
CREATE TABLE TEMP_SAUDA
(S_A VARCHAR2(20),
S_TYPE VARCHAR2(20),
S_CO VARCHAR2(20),
S_CONAME VARCHAR2(40),
S_RATE NUMBER,
S_QTY NUMBER,
S_G NUMBER,
S_H NUMBER,
S_TIME TIMESTAMP WITH TIME ZONE,
S_DATE DATE,
S_PCODE VARCHAR2(20),
S_SETNO VARCHAR2(20),
S_M VARCHAR2(20),
S_N VARCHAR2(20),
S_O VARCHAR2(20),
S_CLIENTOWN VARCHAR2(10),
S_ISIN VARCHAR2(12),
S_ORDER_TIME TIMESTAMP WITH TIME ZONE
ORGANIZATION EXTERNAL
(TYPE oracle_loader
DEFAULT DIRECTORY BSE17122007
ACCESS PARAMETERS
(RECORDS DELIMITED BY NEWLINE
FIELDS terminated by "|"
S_A CHAR(20),
S_TYPE CHAR(20),
S_CO CHAR(20),
S_CONAME CHAR(20),
S_RATE CHAR(20),
S_QTY CHAR(20),
S_G CHAR(20),
S_H CHAR(20),
S_TIME CHAR(8) date_format TIMESTAMP WITH TIMEZONE mask "HH.MI.SSXFF AM TZH:TZM",
S_DATE CHAR(10) date_format DATE mask "yyyy/mm/dd",
S_PCODE CHAR(20),
S_SETNO CHAR(20),
S_M CHAR(20),
S_N CHAR(20),
S_O CHAR(20),
S_CLIENTOWN CHAR(20),
S_ISIN CHAR(20),
S_ORDER_TIME char(8) date_format TIMESTAMP WITH TIMEZONE mask "HH.MI.SSXFF AM TZH:TZM"
location (BSE17122007:'BR171207.DAT')
;With this you get:
SQL> col s_time format a40
SQL> col s_date format a40
SQL> col s_order_time format a40
SQL> r
1* select s_time,s_date,s_order_time from temp_sauda
S_TIME S_DATE S_ORDER_TIME
01-JAN-08 10.31.01.000000 AM +00:00 17.DEC.2007 00:00:00 01-JAN-08 10.31.00.000000 AM +00:00
01-JAN-08 10.31.01.000000 AM +00:00 17.DEC.2007 00:00:00 01-JAN-08 10.31.00.000000 AM +00:00
01-JAN-08 10.33.28.000000 AM +00:00 17.DEC.2007 00:00:00 01-JAN-08 10.33.28.000000 AM +00:00Be aware that your file does not contain date information for the time fields, so as you see above it is defaulted to 01-JAN-08 for the S_TIME and S_ORDER_TIME column. -
Error while creating external table
Hi i tried to create external table. The table is created but while selecting that table it is throwing below errors
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file Countries1.txt in EXT_TABLES not found
ORA-06512: at "SYS.ORACLE_LOADER", line 19I've created temp directory in window under oracle directory " C:\oracle\product\10.2.0\temp"
In the temp directory i've a text file countries1.txt
the text file has the below information
ENG,England,English
SCO,Scotland,English
IRE,Ireland,English
WAL,Wales,WelshI've connected to system user and created one directory and granted the read and write permissions to user SCOTT.
SQL> create or replace directory ext_tables as 'C:\oracle\product\10.2.0\temp\';
Directory created.
SQL> grant read,write on directory ext_tables to scott;
Grant succeeded.The creation of external table query is
CREATE TABLE countries_ext (
country_code VARCHAR2(5),
country_name VARCHAR2(50),
country_language VARCHAR2(50)
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY ext_tables
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY ','
MISSING FIELD VALUES ARE NULL
country_code CHAR(5),
country_name CHAR(50),
country_language CHAR(50)
LOCATION ('Countries1.txt')
PARALLEL 5
REJECT LIMIT UNLIMITED;And the error is
SQL> select *from countries_ext;
select *from countries_ext
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file Countries1.txt in EXT_TABLES not found
ORA-06512: at "SYS.ORACLE_LOADER", line 19
SQL> Please help me in thisYou are missing something. Most probably the file does not exists in your specified path. This is working in my 10.2.0.3
Step1: Check the file is actually there.
C:\oracle\product\10.2.0>mkdir temp
C:\oracle\product\10.2.0>cd temp
C:\oracle\product\10.2.0\temp>dir
Volume in drive C is C_Drive
Volume Serial Number is 8A93-1441
Directory of C:\oracle\product\10.2.0\temp
07/30/2011 12:00 PM <DIR> .
07/30/2011 12:00 PM <DIR> ..
07/30/2011 12:00 PM 79 countries1.txt
1 File(s) 79 bytes
2 Dir(s) 50,110,582,784 bytes free
C:\oracle\product\10.2.0\temp>type countries1.txt
ENG,England,English
SCO,Scotland,English
IRE,Ireland,English
WAL,Wales,Welsh
C:\oracle\product\10.2.0\temp>Step 2: Creating the directory object.
SQL> show user
USER is "SYS"
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
SQL> create or replace directory ext_tables as 'C:\oracle\product\10.2.0\temp';
Directory created.
SQL> grant read,write on directory ext_tables to scott;
Grant succeeded.
SQL>Step 3: Table definition.
C:\>sqlplus scott@orclsb/tiger
SQL*Plus: Release 10.1.0.4.2 - Production on Sat Jul 30 12:04:24 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> CREATE TABLE countries_ext (
2 country_code VARCHAR2(5),
3 country_name VARCHAR2(50),
4 country_language VARCHAR2(50)
5 )
6 ORGANIZATION EXTERNAL (
7 TYPE ORACLE_LOADER
8 DEFAULT DIRECTORY ext_tables
9 ACCESS PARAMETERS (
10 RECORDS DELIMITED BY NEWLINE
11 FIELDS TERMINATED BY ','
12 MISSING FIELD VALUES ARE NULL
13 (
14 country_code CHAR(5),
15 country_name CHAR(50),
16 country_language CHAR(50)
17 )
18 )
19 LOCATION ('Countries1.txt')
20 )
21 PARALLEL 5
22 REJECT LIMIT UNLIMITED;
Table created.
SQL> SELECT * FROM countries_ext;
COUNT COUNTRY_NAME
COUNTRY_LANGUAGE
ENG England
English
SCO Scotland
English
IRE Ireland
English
COUNT COUNTRY_NAME
COUNTRY_LANGUAGE
WAL Wales
Welsh -
Error while selecting date from external table
Hello all,
I am getting the follwing error while selecting data from external table. Any idea why?
SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
2 SE_CUST_ID NUMBER(38),
3 SE_TRAN_AMT_LCY FLOAT(126),
4 SE_REVERSAL_MARKER VARCHAR2(255))
5 ORGANIZATION EXTERNAL (
6 TYPE ORACLE_LOADER
7 DEFAULT DIRECTORY ext_tables
8 ACCESS PARAMETERS (
9 RECORDS DELIMITED BY NEWLINE
10 FIELDS TERMINATED BY ','
11 MISSING FIELD VALUES ARE NULL
12 (
13 country_code CHAR(5),
14 country_name CHAR(50),
15 country_language CHAR(50)
16 )
17 )
18 LOCATION ('SE2.csv')
19 )
20 PARALLEL 5
21 REJECT LIMIT UNLIMITED;
Table created.
SQL> select * from se2_ext;
SQL> select count(*) from se2_ext;
select count(*) from se2_ext
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04043: table column not found in external source: SE_REF_NO
ORA-06512: at "SYS.ORACLE_LOADER", line 19It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
HTH -- Mark D Powell -- -
Error while querying the external tables in 9i
i am working on a project on Oracle 9iR2 on Linux AS 3.0, i am in urgent need to port my data in text files for using in the DB
I have created an external table using the following script. While executing a query it gives the following error. Pls Hlp
create table ap_info_ex
(ser_no number(7),
no_of_sps number(1),
hpy_liq_mm number(2),
rmp_rnk_cd number(1),
ir number(3),
dps_flg varchar2(1))
organization external
(type oracle_loader
default directory aps_jul
access parameters (records delimited by newline
fields terminated by ","
(sno char,
no_sps char,
hpy_mm char,
rmp_rnk char,
ir char,
dpsflg char))
location ('info.txt'));
Table has been created successfully
but when i execute a query say
select * from ap_info_ex;
THIS IS THE ERROR MESSAGE I AM GETTING
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file AP_INFO_EX_6151.log
OS error Permission denied
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
hope you would help me. i am greateful for that.Arun,
Here are the things you could do.
1. You may want to specify a logfile in your access parameters using the command 'logfile'.
For example,
logfile 'info.log'. You could create the file in advance and provide appropriate permissions to the operating system user(In unix, I use the commands 'touch' and 'chmod').
2. You could specify the command
'NOLOGFILE' in your access parameters.
3. Provide permissions for the user to create files in the folder associated with the directory object 'aps_jul'. -
Join large external external Tables (best practice ?)
Hi there,
I have three external tables in a master-detail relation: table A (10000000 rows) is master of table B (20000000 rows), Table B is master of table C (100000000 rows). Can you tell my the best way:
- directly join the external tables, or
- copy the external tables into tables, create an index, and join them
What is more efficient, and why ?
Thanks for your help and ideas.
Gerhard.In general, if the joins you are doing can benefit from indexes, you will want to copy the data to database tables. If the joins will end up doing full table scans anyway, it will matter far less.
For data integrity, you will likely also want to be able to enforce foreign key constraints.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
How to import external table, which exist in export dump file.
My export dump file has one external table. While i stated importing into my developement instance , I am getting the error "ORA-00911: invalid character".
The original definition of the extenal table is as given below
CREATE TABLE EXT_TABLE_EV02_PRICEMARTDATA
EGORDERNUMBER VARCHAR2(255 BYTE),
EGINVOICENUMBER VARCHAR2(255 BYTE),
EGLINEITEMNUMBER VARCHAR2(255 BYTE),
EGUID VARCHAR2(255 BYTE),
EGBRAND VARCHAR2(255 BYTE),
EGPRODUCTLINE VARCHAR2(255 BYTE),
EGPRODUCTGROUP VARCHAR2(255 BYTE),
EGPRODUCTSUBGROUP VARCHAR2(255 BYTE),
EGMARKETCLASS VARCHAR2(255 BYTE),
EGSKU VARCHAR2(255 BYTE),
EGDISCOUNTGROUP VARCHAR2(255 BYTE),
EGREGION VARCHAR2(255 BYTE),
EGAREA VARCHAR2(255 BYTE),
EGSALESREP VARCHAR2(255 BYTE),
EGDISTRIBUTORCODE VARCHAR2(255 BYTE),
EGDISTRIBUTOR VARCHAR2(255 BYTE),
EGECMTIER VARCHAR2(255 BYTE),
EGECM VARCHAR2(255 BYTE),
EGSOLATIER VARCHAR2(255 BYTE),
EGSOLA VARCHAR2(255 BYTE),
EGTRANSACTIONTYPE VARCHAR2(255 BYTE),
EGQUOTENUMBER VARCHAR2(255 BYTE),
EGACCOUNTTYPE VARCHAR2(255 BYTE),
EGFINANCIALENTITY VARCHAR2(255 BYTE),
C25 VARCHAR2(255 BYTE),
EGFINANCIALENTITYCODE VARCHAR2(255 BYTE),
C27 VARCHAR2(255 BYTE),
EGBUYINGGROUP VARCHAR2(255 BYTE),
QTY NUMBER,
EGTRXDATE DATE,
EGLISTPRICE NUMBER,
EGUOM NUMBER,
EGUNITLISTPRICE NUMBER,
EGMULTIPLIER NUMBER,
EGUNITDISCOUNT NUMBER,
EGCUSTOMERNETPRICE NUMBER,
EGFREIGHTOUTBOUNDCHARGES NUMBER,
EGMINIMUMORDERCHARGES NUMBER,
EGRESTOCKINGCHARGES NUMBER,
EGINVOICEPRICE NUMBER,
EGCOMMISSIONS NUMBER,
EGCASHDISCOUNTS NUMBER,
EGBUYINGGROUPREBATES NUMBER,
EGINCENTIVEREBATES NUMBER,
EGRETURNS NUMBER,
EGOTHERCREDITS NUMBER,
EGCOOP NUMBER,
EGPOCKETPRICE NUMBER,
EGFREIGHTCOSTS NUMBER,
EGJOURNALBILLINGCOSTS NUMBER,
EGMINIMUMORDERCOSTS NUMBER,
EGORDERENTRYCOSTS NUMBER,
EGRESTOCKINGCOSTSWAREHOUSE NUMBER,
EGRETURNSCOSTADMIN NUMBER,
EGMATERIALCOSTS NUMBER,
EGLABORCOSTS NUMBER,
EGOVERHEADCOSTS NUMBER,
EGPRICEADMINISTRATIONCOSTS NUMBER,
EGSHORTPAYMENTCOSTS NUMBER,
EGTERMCOSTS NUMBER,
EGPOCKETMARGIN NUMBER,
EGPOCKETMARGINGP NUMBER,
EGWEIGHTEDAVEMULTIPLIER NUMBER
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY EV02_PRICEMARTDATA_CSV_CON
ACCESS PARAMETERS
LOCATION (EV02_PRICEMARTDATA_CSV_CON:'VPA.csv')
REJECT LIMIT UNLIMITED
NOPARALLEL
NOMONITORING;
While importing , when i seen the log file , it is failing the create the external table. Getting the error "ORA-00911: invalid character".
Can some one suggest how to import external tables
Addressing this issue will be highly appriciated.
NaveenHi Srinath,
When i observed the create table syntax of external table from import dump log file, it show few lines as below. I could not understand these special characters. And create table definationis failing with special character viz ORA-00911: invalid character
ACCESS PARAMETERS
LOCATION (EV02_PRICEMARTDATA_CSV_CON:'VPA.csv').
I even observed the create table DDL from TOAD. It is same as i mentioned earlier
Naveen -
DATE fields and LOG files in context with external tables
I am facing two problems when dealing with the external tables feature in Oracle 9i.
I created an External Table with some fileds with the DATE data type . There were no issues during the creation part. But when i query the table, the DATE fields are not properly selected though the data is there in the files. Is there any ideas to deal with this ?
My next question is regarding the log files. The contents in the log file seems to be growing when querying the external tables. Is there a way to control this behaviour?
Suggestions / Advices on the above two issues are welcome.
Thanks
LakshminarayananHi
If you have date datatypes than:
select
greatest(TABCASER1.CASERRECIEVEDDATE, EVCASERS.FINALEVDATES, EVCASERS.PUBLICATIONDATE, EVCASERS.PUBLICATIONDATE, TABCASER.COMPAREACCEPDATE)
from TABCASER, TABCASER1, EVCASERS
where ...-- join and other conditions
1. greatest is good enough
2. to_date creates date dataype from string with the format of format string ('mm/dd/yyyy')
3. decode(a, b, c, d) is a function: if a = b than return c else d. NULL means that there is no data in the cell of the table.
6. to format the date for display use to_char function with format modell as in the to_date function.
Ott Karesz
http://www.trendo-kft.hu -
External Table Security with OBIEE 11G is not working properly.
Hello Everyone,
we just upgraded for OBIEE from 10G to 11G.
not what we had in 10G for object level and data level security is that we were using "External table" and LDAP Authentication.
Now for User we are capturing Groups in that table, so basically we have Group-level security.
so in that case we are creating Groups in External Table, RPD & Catalog.
Now we upgraded OBIEE to 11G, there we have totally different concept for security.
So here in what we have to do to implement the same concept. because we have created the Application Roles in Admin Console and Groups in Enterprise Manager with same name, and assigned same Groups to same Application Role.
now while applying security in frontend we can catalog groups options too!!! so do we have to create the same groups in catalog too?? and while applying the security to catalog which one do we need to use? "Application Role" OR "Catalog Groups"???
Thanking You..Hi,
which version r u using? until obiee11.1.1.5 its bug but solve it by workaround method . also the bug fixed in obiee.11.1.1.6
11700314 REPORT NOT EXPORTED FULLY INTO EXCEL WHEN DOWNLOADING FROM PAGES OTHER THAN 1
1) stop it all u r bi serivices then take a back of u original instanconfig.xml file then do the below changes
D:\Oracle\Middleware\instances\instance1\config\OracleBIPresentationServicesComponent\coreapplication_obips1
instanceconfig.xml
just add below content then
<Views>
<Pivot>
<MaxCells>6500000</MaxCells>
<MaxVisibleColumns>100</MaxVisibleColumns>
<MaxVisiblePages>1000</MaxVisiblePages>
<MaxVisibleRows>65000</MaxVisibleRows>
<MaxVisibleSections>25</MaxVisibleSections>
<DefaultRowsDisplayed>500</DefaultRowsDisplayed>
<!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
<!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDownload>64000</DefaultRowsDisplayedInDownload>
<!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DisableAutoPreview>false</DisableAutoPreview>
</Pivot>
<Table>
<MaxCells>6500000</MaxCells>
<MaxVisiblePages>1000</MaxVisiblePages>
<MaxVisibleRows>65000</MaxVisibleRows>
<MaxVisibleSections>25</MaxVisibleSections>
<DefaultRowsDisplayed>500</DefaultRowsDisplayed>
<!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
<!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager--><DefaultRowsDisplayedInDownload>64000</DefaultRowsDisplayedInDownload>
</Table>
</Views>
Restart all u r bi services..
then test it out.
Thanks
Deva -
Report query not returning the field value from external table
hi
I have an issue regarding reports. I have a query having 4 fields from external table and remaining from db tables. the report query returns all the fields from the db tables and only 2 fields from external table. but the same query if I tried in plsql developer it returns all the fields values.
Can anyone please help me in this issue.
Thanks and Regards
kkDuplicate post?
value not displaying in report whereas it returns in plsql developer
value not displaying in report whereas it returns in plsql developer
Please log a SR if you do not get any reply to your thread instead of creating new one.
Thanks,
Hussein -
External table - fetch location ?
Using Oracle 10.2.0.5
An external table is a construct that gives me SQL access to a file.
Is it possible to know the name of the file somehow inside the select? Like Add a column with the file name?
pseudo example
CREATE TABLE EXT_DUMMY
"RECORDTYPE" VARCHAR2(100 BYTE),
"COL1" VARCHAR2(100 BYTE),
"COL2" VARCHAR2(100 BYTE),
"FILE" VARCHAR2(100 BYTE)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER DEFAULT DIRECTORY "IMPORT_BAD_FILE"
ACCESS PARAMETERS (
records delimited BY newline
FIELDS TERMINATED BY ';'
MISSING FIELD VALUES ARE NULL
( RECORDTYPE CHAR
, COL1 CHAR
, COL2 CHAR
, FILE CHAR FILLER
LOCATION ( 'Testfile1.txt, Testfile2.txt' )
reject limit 10
;The result could look like this:
RECORDTYPE COL1 COL2 FILE
SAMPLE DUMMY DUMMY Testfile1.txt
SAMPLE DUMMY1 DUMMY Testfile1.txt
SAMPLE DUMMY2 DUMMY Testfile1.txt
SAMPLE DUMMY3 DUMMY Testfile1.txt
SAMPLE DUMMY1 DUMMY1 Testfile2.txt
SAMPLE DUMMY1 DUMMY2 Testfile2.txt
SAMPLE DUMMY2 DUMMY1 Testfile2.txtI would like to know from which file a certain row is read. Maybe I missed an option in the documentation. In this example I have two different files as the source for the external table.
Another use case could be this:
If I enable a user to switch the external table to a different file alter table EXT_DUMMY location ('Testfile3.txt' ). How can we know which file is read during the select on the table? When userA does the select, maybe userB just altered the location before the select was started. Therefore userA would read in a different file then expected.
Edited by: Sven W. on May 26, 2011 4:48 PM
Edited by: Sven W. on May 26, 2011 4:51 PM
Edited by: Sven W. on May 26, 2011 5:11 PMHi Sven,
I'm not sure how much we can rely on this, but let's consider the following :
create table test_xt (
rec_id number
, message varchar2(100)
organization external (
default directory test_dir
access parameters (
records delimited by newline
fields terminated by ';'
location (
'marc5.txt'
, 'test1.csv'
, 'test2.csv'
, 'test3.csv'
);I always thought the ROWID doesn't hold much sense for an external table, but...
SQL> select t.rowid
2 , dump(t.rowid) as rowid_dump
3 , regexp_substr(dump(t.rowid,10,9,1),'\d+$') as file#
4 , t.*
5 from test_xt t
6 ;
ROWID ROWID_DUMP FILE# REC_ID MESSAGE
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,0 0 1 this is a line from marc5.txt
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,33 0 2 this is a line from marc5.txt
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,66 0 3 this is a line from marc5.txt
(AADVyAAAAAAAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,0,0,0,0,0,0,0,0,99 0 4 this is a line from marc5.txt
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,0 1 1 this is a line from test1.csv
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,33 1 2 this is a line from test1.csv
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,66 1 3 this is a line from test1.csv
(AADVyAAAAAEAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,1,0,0,0,0,0,0,0,99 1 4 this is a line from test1.csv
(AADVyAAAAAIAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,2,0,0,0,0,0,0,0,0 2 1 this is a line from test2.csv
(AADVyAAAAAIAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,2,0,0,0,0,0,0,0,33 2 2 this is a line from test2.csv
(AADVyAAAAAIAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,2,0,0,0,0,0,0,0,66 2 3 this is a line from test2.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,0 3 1 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,33 3 2 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,66 3 3 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,99 3 4 this is a line from test3.csv
(AADVyAAAAAMAAAAAA Typ=208 Len=17: 4,0,0,213,200,0,0,0,3,0,0,0,0,0,0,0,132 3 5 this is a line from test3.csv
16 rows selected
Then with a join to EXTERNAL_LOCATION$ :
SQL> with ext_loc as (
2 select position-1 as pos
3 , name as filename
4 from sys.external_location$
5 where obj# = ( select object_id
6 from user_objects
7 where object_name = 'TEST_XT' )
8 )
9 select x.filename,
10 t.*
11 from test_xt t
12 join ext_loc x on x.pos = to_number(regexp_substr(dump(t.rowid,10,9,1),'\d+$'))
13 ;
FILENAME REC_ID MESSAGE
marc5.txt 1 this is a line from marc5.txt
marc5.txt 2 this is a line from marc5.txt
marc5.txt 3 this is a line from marc5.txt
marc5.txt 4 this is a line from marc5.txt
test1.csv 1 this is a line from test1.csv
test1.csv 2 this is a line from test1.csv
test1.csv 3 this is a line from test1.csv
test1.csv 4 this is a line from test1.csv
test2.csv 1 this is a line from test2.csv
test2.csv 2 this is a line from test2.csv
test2.csv 3 this is a line from test2.csv
test3.csv 1 this is a line from test3.csv
test3.csv 2 this is a line from test3.csv
test3.csv 3 this is a line from test3.csv
test3.csv 4 this is a line from test3.csv
test3.csv 5 this is a line from test3.csv
Seems to work... assuming the files are always read in the order specified through the LOCATION parameter, and the generated ROWID actually means what I think it means.
Maybe you are looking for
-
MBean not found error while creating Resource Adapter
Hi, During the post installation configuration of Oracle Identity Manager, I had to create Resource Adapter as mentioned in the steps below. In the final step, when I click OK, I’m getting an error message “An error has occurred. MBean not found” (I
-
InCopy is best for PDF creation...what do you think?
I use Apple pages 09 export to create PDF documents with Adobe Acrobat Pro 9 (mac). I use these with my clients, and since I am a communicaitons consultant, I want them to stand out. I have found pages does not do the entire job...I must add things
-
How to run the help doc created in chm format in web
I have created a help doc in chm format. I am able to call this help doc in client version using the host command. i.e host('hh filename'); But if I try to rcall the help doc in the web application,its not working. May I know the reason for this and
-
Ship to Warehouse in Third Party Orders
Hi Everyone, In Case of Third Party Orders, Let me know the configuratins that needs to be done if we want the warehouse Nos. has to be selected as Ship to Party Information in SO/PR/PO. This is required in case we need a third party Item to be dive
-
Half of my itunes on my macbook randomly got stored as "damaged"
i left my computer on (but charging) all day, & when I got back it seemed like my computer had had part of it's memory erased- when I went online, it didn't have any of my usual websites remembered (i.e. I typed in "f" & it didn't fill in the rest of