Selecting from external table
Hi,
I have an external table with 3 data files. How can I define by the select statement from which data file I'd like to select, is it possible at all?
( like at partitioned table I can define the partition name in the select statement)
Is there a limit how many data files can belong to an external table?
Thanks
Orsi
Hi,
I wasn'rt clear, so I write an example:
CREATE TABLE ADMIN_EXT_EMPLOYEES
EMPLOYEE_ID NUMBER(4),
FIRST_NAME VARCHAR2(20 BYTE),
LAST_NAME VARCHAR2(25 BYTE),
JOB_ID VARCHAR2(10 BYTE),
MANAGER_ID NUMBER(4),
HIRE_DATE DATE,
SALARY NUMBER(8,2),
COMMISSION_PCT NUMBER(2,2),
DEPARTMENT_ID NUMBER(4),
EMAIL VARCHAR2(25 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY ADMIN_DAT_DIR
ACCESS PARAMETERS
LOCATION ('empxt1.dat', 'empxt2.dat', 'empxt3.dat'')
I'd like select only from one of the dat files, and my question is if is it posible to do that.
Thanks
Similar Messages
-
Hi
I am trying to craete an external table and then select the data from the table. However I am getting error while trying to select the data from external table.
SQL>CREATE OR REPLACE DIRECTORY my_dir as 'C:\arun';
Directory created.
SQL>GRANT ALL ON DIRECTORY my_dir TO PUBLIC;
Grant succeeded.
SQL>DROP TABLE proj_checklists_external;
Table dropped.
SQL>CREATE TABLE proj_checklists_external
2 ( checklist_submission_id NUMBER
3 ,Lead_reviewer_name VARCHAR2(30)
4 ,Lead_reviewer_corp_id VARCHAR2(10)
5 ,creation_date VARCHAR2(10)
6 ,submitted_dater VARCHAR2(10)
7 ,approved_date VARCHAR2(10)
8 ,status VARCHAR2(50)
9 )
10 ORGANIZATION EXTERNAL
11 (
12 TYPE ORACLE_LOADER
13 DEFAULT DIRECTORY my_dir
14 ACCESS PARAMETERS
15 (
16 RECORDS DELIMITED BY NEWLINE
17 FIELDS TERMINATED BY ','
18 )
19 LOCATION ('Book1.txt')
20 )
21 PARALLEL 5
22 REJECT LIMIT 200;
Table created.
SQL>SELECT * FROM proj_checklists_external;
SELECT * FROM proj_checklists_external
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file PROJ_CHECKLISTS_EXTERNAL_28484.log
OS error No such file or directory
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
I craeted an file PROJ_CHECKLISTS_EXTERNAL_28484.log also in C:\arun and then tried to select but still got same error.
Any idea how to overcome this error.
Regards
Arunhere you go:
SQL> CREATE OR REPLACE DIRECTORY GRATIS_LOAD as 'D:\AdvSourceData\Membership\';
Directory created
SQL> GRANT ALL ON DIRECTORY GRATIS_LOAD to ADVROLE;
Grant succeeded
SQL>
SQL> DROP TABLE MEMB_BATCH_LOAD_ID;
Table dropped
SQL> CREATE TABLE MEMB_BATCH_LOAD_ID (
2 ID_NUMBER VARCHAR2(10),
3 STATUS CHAR(1)
4 )
5 ORGANIZATION EXTERNAL
6 ( TYPE ORACLE_LOADER
7 DEFAULT DIRECTORY GRATIS_LOAD
8 ACCESS PARAMETERS
9 ( records delimited by NEWLINE
10 fields (
11 ID_NUMBER POSITION (1:10) CHAR,
12 STATUS POSITION (11:1) CHAR
13 )
14 )
15 LOCATION
16 ( 'GRATISID.TXT'
17 )
18 );
Table created
SQL> select * from memb_batch_load_id;
select * from memb_batch_load_id
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file MEMB_BATCH_LOAD_ID_1388_5552.log
OS error The system cannot find the file specified.
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
SQL> -
Data Mismatch while selecting from External Table
Hi I am not able create an external table,I am trying to create and test table and able to create but when i selecting the data it showing data mismatch.I tried for an test data but it returned error.I want to load from an excel file saved as test.csv
CREATE TABLE Per_ext
CITY VARCHAR2(30),
STATE VARCHAR2(20),
ZIP VARCHAR2(10),
COUNTRY VARCHAR2(30)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY dataload
ACCESS PARAMETERS
MISSING FIELD VALUES ARE NULL
LOCATION ('test.csv')
REJECT LIMIT UNLIMITED;
test.csv file contents
city ---------- state---------Zip------------country
Bombay----- MH------------34324-------india
london-------London------1321---------UK
Pune---------MH------------3224---------india
Banglore---- Karnataka---11313-------india
rgds
soumyaHi Justin
I am getting following error when i trying from toad
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 "comma": expecting one of: "badfile, byteordermark, characterset, column, data, delimited, discardfile, exit, fields, fixed, load, logfile, language, nodiscardfile, nobadfile, nologfile, date_cache, processing, readsize, string, skip, territory, variable"
KUP-01007: at line 1 column 29
ORA-06512: at "SYS.ORACLE_LOADER", line 19
rgds
soumya -
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 -- -
Importing Users from external table in obiee 11g
Hi Every one,
Do any one help me giving suggestions that how we can import users from external table.
I am using obiee 11.1.1.6.
In that external table Which i am using there are 56K users.
They are able to login to obiee analytics.
But for setting object level security I need to make diffrent groups with these users to assign the dashbords and required objects in front end.
But how can we get all these users into BI server or presentation server to make them into groups.
Thanks in advance.
Edited by: 861096 on Mar 13, 2012 8:44 AMHi,
or if your lowest level is the same like
Day->month->year->Total
Day->businessMonth->businessyear->Total
Then yes, it is.
Create the first, then you start to create the second by adding your top(business year) level on the same level as the one you have (year) both under your total.
Then when you would add your second base level, there is a special option for it, something like use other hierarchy level/shared level (sorry can't recall and does not have a connection right now) then you select your existing day level under your businessmonth level.
Hope this helps,
Regards,
D -
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 -
How to populate a table based on a row selection from another table.
Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
ganeshI understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
"EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
Hope this helps. -
How to do a SELECT from different tables into an internal table?
How to do a SELECT from different tables into an internal table?
I want to select data from MARA, MARC and ZPERSON and populate my ITAB_FINAL
REPORT zinternal_table.
TABLES:
mara,
marc,
zperson.
TYPES:
BEGIN OF str_table1,
v_name LIKE zperson-zname,
v_matnr LIKE marc-matnr,
v_emarc LIKE marc-emarc,
v_werks_d LIKE marc-werks_d,
v_dstat LIKE marc-dstat,
END OF str_table,
i_table1 TYPE STANDARD TABLE OF str_table1.
DATA:
BEGIN OF str_table2,
v_mandt LIKE mara-mandt,
v_ernam LIKE mara-ernam,
v_laeda LIKE mara-laeda,
END OF str_table2,
itab_final LIKE STANDARD TABLE OF str_table2.first find the link between mara , marc and zperson , if u have link to 3 tables then u can jus write a join and populate the table u want ( thats final table with all the fields).
u defenitely have alink between mara and marc so join them and retrieve all data into one internal table.
then for all the entries in that internal table retrieve data from zperson into another internal table.
then loop at one internal table
read another internal table where key equals in both the tables.
finally assign fileds if sy-subrc = 0.
gs_finaltable-matnr = gs_table-matnr
etc...
and finally append gs_finaltable to gt_finaltable.
there u go ur final table has all the data u want.
regards
Edited by: BrightSide on Apr 2, 2009 3:49 PM -
Select from nested table in a nested table security problem
please help
running Oracle 9.2.0.3.0 on RH AS 2.1
I can select the inner most nested table as the creator, but can't use the same select statement as USER2.
ORA-00942: table or view does not exist
-- begin make of objects and tables
create or replace type mydata_t as object ( x float, y float);
create or replace type mydata_tab_t as table of mydata_t;
create or replace type mid_t as object (
graphname varchar2(12),
datapoints mydata_tab_t );
create or replace type mid_tab_t as table of mid_t;
create or replace type top_t as object (
someinfo int,
more_mid mid_tab_t );
create table xyz (
xyzPK int,
mainstuff top_t )
nested table mainstuff.more_mid store as mid_nt_tab
(nested table datapoints store as mydata_nt_tab)
-- grants
grant all on mydata_t to user2;
grant all on mydata_tab_t to user2;
grant all on mid_t to user2;
grant all on mid_tab_t to user2;
grant all on top_t to user2;
grant all on xyz to user2;
-- insert
insert into xyz values (1, top_t(22,mid_tab_t(mid_t('line1',mydata_tab_t(
mydata_t(0,0),
mydata_t(15,15),
mydata_t(30,30))))));
commit;
-- select fails as user2
select * from table(select Y.datapoints as DP_TAB
from table(select X.mainstuff.more_mid as MORE_TAB
from scott.xyz X
where X.xyzPK=1) Y
where Y.graphname='line1') Z;
-- select works as user2, but i need individual lines
select Y.datapoints as DP_TAB
from table(select X.mainstuff.more_mid as MORE_TAB
from scott.xyz X
where X.xyzPK=1) Y
where Y.graphname='line1';Thank you for your reply.
I have tried
select value(t) from table t;
but it is still not working. I got almost the same answer as before.
Anyway thank you very much again.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by MARCELO OCHOA ([email protected]):
Originally posted by meimei wu ([email protected]):
[b]I created a nested object-relational table using REF type in oracle8i. when I tried to select * from the table, I got lots of number as the ref type values, but actually, the value in ref type should be of type varchar2 and number. The number I got looked like following code:
JARTICLE_REF_TYPE(000022020876108427C2FE0D00E0340800208FD71F76103B99B12009C0E0340800208FD71F,
Does anyone know how I can get the actual value that I inserted into the nested table?
your help is appreciated.<HR></BLOCKQUOTE>
Try this:
select value(t) from table t;
Best regards, Marcelo.
null -
How to avoid ORA-3113 when selecting from XMLTYPE table
Hi,
If I register an XML-schema, Oracle automatically creates a table xxxxxx_tab of XMLTYPE. (I use Oracle 9.2.0.1)
When I do a DESCRIBE or a SELECT from this table I get the error: 'ORA-03113:
end-of-file on communication channel' and my connection is dropped.
I opened a TAR for this and Oracle says: 'It is an internal bug so cannot be viewed in metalink. This is fixed in release 10i.' (do they mean oracle DB rel 10i, or a new version of XDK?)
I saw an example in Oracle Magazine (Jan
2003) "Make XML Native and Relative" about Oracle 9i Rel 2 and XML. As you can see in codeListing 7, the author also does a select from such a
table (CD331_tab): Why doesn't he have any problems?
Is there a workaround for this bug? What's the purpose of being able to automatically upload XML-data to a registered schema if you can't do a select of the data?
Thank you!It appears that the XML Schema is not entirely valid. Specifically, the definition of element "DeviceCategory" has two definitions of element "Audio" appearing within a <choice> model i.e. something like :
<element name="DeviceCategory">
<choice>
<sequence>
<element name="Audio">
</sequence>
<sequence>
<element name="Audio">
</sequence>
</choice>
This is disallowed by XML Schema spec per. the Unique Particle Attribution Constraint. The general idea is that a XML Schema describes a determinstic content model i.e. schema processor can always unambiguosly determine the matching declaration when it encounters an element. However that's not the case with the declaration above. On encoutering "Audio", it could match either the first or the second declaration of the element. Hence the error.
You will have to rework the schema to avoid this constraint. One mechanism could be to define complexType and their restrictions.
- Ravi -
Select from a table from other schema
Hi,
I want to make a select from a table how is into other Schema and into other instance.
form example, if I have _2 schemas (in diferent instances)_:
SCHEMA1 =
*(DESCRIPTION =*
*(ADDRESS =*
*(PROTOCOL = TCP)*
*(HOST = XXX.XXX.XXX.XX1)*
*(PORT = 1560)*
*(CONNECT_DATA =*
*(SERVER = DEDICATED)*
*(SERVICE_NAME = SCHEMA1)*
SCHEMA2 =
*(DESCRIPTION =*
*(ADDRESS =*
*(PROTOCOL = TCP)*
*(HOST = XXX.XXX.XXX.XX2)*
*(PORT = 1560)*
*(CONNECT_DATA =*
*(SERVER = DEDICATED)*
*(SERVICE_NAME = SCHEMA2)*
and into SCHEMA2 there is a table TABLE_A.
If I`m connected into SCHEMA1:
how can I do to make a select from the TABLE_A?
thanks very much.1) Referring to an entry in the tnsnames.ora file as a "schema" as you have here with schema1 and schema2 is likely to be confusing. You have multiple schemas in the same database-- in this case, you appear to be trying to query tables in a different database. If we try to answer using your TNS aliases "schema1" and "schema2", there is likely to be a great deal of confusion between schemas/ databases/ and TNS aliases. So I will assume that your tnsnames.ora file actually reads
TNS_ALIAS1 =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = HOST1)
(PORT = 1560)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DB1)
TNS_ALIAS2 =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = HOST2)
(PORT = 1560)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DB2)
)2) Given the TNS aliases above, assuming that we are talking about the tnsnames.ora file on HOST1, you would need to create a database link from DB1 to DB2. You can either specify a fixed username and password for the database link or you can specify that the connection happens as the current user (which assumes that the passwords are synchronized between the databases).
CREATE DATABASE LINK to_db2
CONNECT TO username_on_db2
IDENTIFIED BY password_on_db2
USING 'TNS_ALIAS2'3) Assuming the database link is in place
SELECT *
FROM schema2.table_name@to_db2Justin -
Select from two tables and insert into a third
I'm trying to do a select from two tables and do an insert into a third table from the two resulting columns.
I have the following....
DECLARE
tempsid number;
temphostid number;
BEGIN
select "DBSID_ID","ID" into tempsid,temphostid from "DBSIDS","SERVERS"
where "HOST_SID" like '%'||"DBSID_NAME"||'%'
and "HOST_NAME" not like 'vio%'
and exists (select "DBSID_NAME" from DBSIDS)
order by "DBSID_NAME";
insert into "DBSID_LOOKUP" ("SIDLOOKUP_ID", "SERVERLOOKUP_ID")
values(tempsid, temphostsid);
END;
run;
I get the error ....
ORA-06550: line 11, column 18:
PL/SQL: ORA-00984: column not allowed here
ORA-06550: line 10, column 1:
PL/SQL: SQL Statement ignored
1. DECLARE
2. tempsid number;
3. temphostid number;okay ... I tried a different way ...
DECLARE
a number;
b number;
BEGIN
select "DBSID_ID","ID" into a,b from "DBSIDS","SERVERS"
where "HOST_SID" like '%'||"DBSID_NAME"||'%'
and "HOST_NAME" not like 'vio%'
and exists (select "DBSID_NAME" from DBSIDS)
order by "DBSID_NAME";
insert into "DBSID_LOOKUP" (SIDLOOKUP_ID, SERVERLOOKUP_ID) values (a, b);
END;
and now it whines about ...
ORA-01422: exact fetch returns more than requested number of rows -
LDAP in weblogic. Need additional GROUP from External Table
I have the LDAP authentication in weblogic & I need to get the GROUP information from external table also since I have some more groups in table apart from LDAP groups.So how can I get that.
I tried using GROUP variable in RPD but it didn't work.
Please let me know if anyone has faced this issue in OBIEE11gHI,
As per my knowledge OBIEE user should be authenticated from only one source. it should be either database authetication or LDAP authentication. we cant associate multiple initilization blocks for single system variable USER. so you should convey client to insert groups/users in LDAP.
I hope this help you and understand it.
Thanks
Jay. -
XML parsing failed while select from my table with criteria
While select from my table an error displayed as
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '/<XML Path>/row[c24="SA0010001"]'
select * from category
where existsNode(xmlrecord, '/<XML Path>/row[c24="SA0010001"]') = 1;
xmlrecord
<row id="52843" xml:space="preserve">
<c1>Refund of Domestic Payment Order</c1>
<c2>Ref Dom Py Or</c2>
<c3>PLsql</c3>
<c20>1</c20>
<c21>62_TAABSINPUTT___OFS_TAABS</c21>
<c22>0803181605</c22>
<c23>62_TAABSINPUTT_OFS_TAABS</c23>
<c24>SA0010001</c24>
<c25>1</c25>
</row>Hi,
Did you copy that sample from some demo?
The part "<XML Path>" is meant to be replaced by a real XPath fragment.
Here, I think you may just want this :
select * from category
where existsNode(xmlrecord, '/row[c24="SA0010001"]') = 1;Edit : OK, just seen your previous post and the example given
Edited by: odie_63 on 6 juil. 2010 21:16 -
Selecting from two tables and confirming from them despites they not relate
Please I need a query to select from two tables that are not related to each other.
I also want to confirm data's as in verify wether what the user has entered is in accordance with what is in the tables
Examples
the first table is named "Card" and the second table is named "Student_Details"
Card table contains a column named "Pin_Number".
The Student_Details table contains fields such as Exam_Number, Name, Age, Sex.
The user has to Enter the Pin_Number which has to be confirmed in the Card table and Exam_Number which has to be confirmed in the Student_Details table and verify that both data's are correct.
Please I need the SQL and PL/SQL queries for this problem.
ThanksHi,
I think you need two different queries
You can write a procedure like:
create or replace procedure p1 (p_pin_number number, p_exam_number)
is
r_card_row card%rowtype;
r_student_details student_details%rowtype;
cursor c1 is
select *
from card
where pin_number = p_pin_number;
cursor c2 is
select *
from student_details
where exam_number = p_exam_number;
begin
open c1;
loop
fetch c1 into r_card_row;
exit when c1%notfound;
.... do whatever you want..... and the samething you can do with other cursor
end loop;
close c1;
end p1;Hope this helps
Ghulam
Maybe you are looking for
-
How to force Dreamweaver refresh the file view
For some reason I have files in a local folder which Dreamweaver can't see. How can I refresh the files? Also, is there a site garbage file somewhere. Seems this program ate a style sheet which took six months to make.
-
Itunes wont download on windows HELP
Hi all im new to this so be easy on me please well i have tried loads of times to install itunes on my windows 7 laptop. i put my email in and then press download, it states that i have downloaded itunes but then its no where to be found, it does not
-
ITunes 7.0 ignoring "Remember playback position"
I've been encountering an issue where iTunes 7.0 is ignoring last marked playback position on files with "Remember playback position" set. The files in question are on my iPod. I can't put my finger on it, but I have for certain encountered this anom
-
F110 hitlist on ECC6.0 for rundate
Hi, my customer recently switched to ECC6.0. When you now start transaction F110 (payment prog) and execute the possible entries on the run date, the system shows a list of all payment id. Since we have more then 5000 SAp provides a pop-up message th
-
Hi, I have export of a table with name "abc". I need to import the table "abc" into another database but with a different name like "abc_temp". Is it possible? I cannot import as "abc" and rename as "abc_temp" Thanks