Select from remote table
Hi, i have two user schemas.
BIQUERYRHTST and BIETLRHTST
On BIQUERYRHTST, i have a database link.
and i execute the following sentence
select * from [email protected], and it works correctly.
If i want to execute the same select on BIETLRHTST, what permissions does i need?
Without have to create the dblink on BIETLRHTST
Thanks
Check more information about CREATE DATABASE LINK
If you created a private database link as mentioned in the doc, you can't share it with other user. Create a public database link instead.
Similar Messages
-
PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables
Dear ALL,
My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
Can anybody tell me how to fix this error ? Because am not able to get the records.
Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
+(The following error has occurred:+
A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
If anyone having any idea kindly share.
Thanks and Regards
BiswaHi,
Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
Kindly tell if u know any resolution.
Thanks -
Insert into local table as select from remote tables
Hi all,
In Oracle DB version 11g i have the following issue:
I want to insert into a table in the current schema as selecting data from two remote tables. I execute the insert in portions of data. Firstly, when the target table where i want to insert is empty the Select as Insert is being executed very fast. But after every insert i made , the performance became worse than the previous one. I have no FKs or indexes in the local table/target table where i'm inserting/... I tried using /*+ append*/ hint but no success...what should be the reason of that?
Thanks in advance,
Alexander.a.stoyanov wrote:
Hi all,
In Oracle DB version 11g i have the following issue:
I want to insert into a table in the current schema as selecting data from two remote tables. I execute the insert in portions of data. Firstly, when the target table where i want to insert is empty the Select as Insert is being executed very fast. But after every insert i made , the performance became worse than the previous one. I have no FKs or indexes in the local table/target table where i'm inserting/... I tried using /*+ append*/ hint but no success...what should be the reason of that?
Thanks in advance,
Alexander.How should we know? You don't give enough information to be able to tell. Not even the SQL involved.
Please read {message:id=9360002} and {message:id=9360003}
and follow the advice given. -
ORA-22992: cannot use LOB locators selected from remote tables
Has anyone had this error msg before?
Thx .If you want, you could facilitate your process with a global temporary table as follows:
SQL> create global temporary table clob_temp (
2 id number,
3 test_clob clob)
4 on commit delete rows;
Table created.
SQL> Create or Replace procedure run_clob (p_id in number, p_file_name in varchar2)
2 AS
3 l_clob clob;
4 l_bfile bfile := BFILENAME ('TEMP_DIR', p_file_name);
5 begin
6 insert into clob_temp values (p_id, empty_clob() )
7 returning test_clob into l_clob;
8 DBMS_LOB.OPEN(l_bfile, DBMS_LOB.LOB_READONLY);
9 DBMS_LOB.LOADFROMFILE(l_clob, l_bfile, DBMS_LOB.getlength(l_bfile));
10 DBMS_LOB.CLOSE(l_bfile);
11 insert into clob_table@dlog_link (id, test_clob)
12 select * from clob_temp;
13 commit;
14 end;
15 /
Procedure created.
SQL> select count(*) from clob_table@dlog_link;
COUNT(*)
0
SQL> exec run_clob (1, 'clobtest.txt')
PL/SQL procedure successfully completed.
SQL> select count(*) from clob_table@dlog_link;
COUNT(*)
1 -
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 -
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 -
Selecting from two tables but making it just one selection
Is there a way to select from two tables and just have one selection appear?
Specifically I have a fact_install_unit, and a fact_install_arch table.
Sometimes the value exists in fact_install_unit.factory_timestamp, and sometimes when fact_install_unit.factory_timestamp is null I need to pull it from the fact_install_arch.factory_timestamp.
sort of like:
(select fact_install_unit.factory_timestamp
from fact_install_unit, fact_install_arch
where fact_install_unit.fl_unit_sak = fact_install_arch.fl_unit_sak
and where fact_install_unit.factory_timestamp is null then display fact_install_arch.factory_timestamp)> I was just stating that I do not have sufficient priveleges to create views in this database.
>
nm means "no more" than that
And how are we supposed to know that? You seem to have changed the thread subject to "unfortunately I only have read-only and insufficient priveleges", which is not even a question.
nm means "New Mexico":
http://www.myshortpencil.com/schooltalk/messages/85/515.html?971794944 -
Selecting from multiple tables, into one internal table
Hi,
What is the best & most efficient method of selecting from multiple table (in my case 6,) into one internal table?
Thanks,
John
Points will be rewarded and all responses will be highly appreciated.I have simple example :
First one - Join 5 tables
data : f1 type i,
f2 type i,
f3 type i.
start-of-selection.
get run time field f1.
write the query 4 or 5 tables join.
get run time field f2.
f3 = f2 - f1 ( Total time).
Second one - joins 3 table and use for all entries
data : f1 type i,
f2 type i,
f3 type i.
start-of-selection.
get run time field f1.
write the query 3 tables join and use for all entries
get run time field f2.
f3 = f2 - f1. ( Total time )
Finally you can have time diffrence between the both sql statement. -
I have a db, call it xyz.mdb
It suddenly is that SSMS is not listing the table objects nor the Views. SELECT * FROM sys.Tables and SELECT * FROM sys.Views work very fine. But when I click on the tables node, on Objects Explorer, Only the Systems Tables and File Tables folders
show.
Other DBs on same SQL instance do not show same problem. They are all working very fine.
I have backed up and restored this db on other computers and the behaviour is the same. Incidentally right-clicking the db and clicking Properties throws up this error message.
-------------------------------------------------------------------------Error!
Cannot show requested dialog.
Property Size is not available for Database '[Pliny E DB - NOA 2014]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.PropertyCannotBeRetrievedExceptionText&EvtID=Size&LinkId=20476
--------------------------------------------------------------------------------End>
When I try to Refrresh the Tables node on Object Explorer, I get this other:
------------------------------Error!
SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x9090d9b7; actual: 0x909001b4). It occurred during a read of page (1:1173) in database ID 21 at offset 0x0000000092a000 in file 'c:\Databases\Clients\NOA\Pliny E DB -
NOA 2014.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check
(DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 824)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476
------------------------------End>
The Help link of course is not valid any more.
Many thanks
Vie
@Abuja
VieYour database is corrupted and you need to run.
DBCC CHECKDB
You already have a backup so do it...
This link will provide you with more information:
http://msdn.microsoft.com/en-us/library/ms176064.aspx
Maybe you are looking for
-
Satellite M30X-134 - I'm looking for a new motherboard
Hello, im looking for a new motherboard for my Satelite M30X-134! I was offered one with the Toshiba number K000019680 with the advice that this one is for all M30X notebooks. Im a little irritated, because my thoshiba trader told me, that I need one
-
Problem with decimal fields using BADI For PD Infotypes
Hi, I'm implementing BADI HRBAS00INFTY. For reading the fields of infotype , I'm using the substring of the field NEW_INNNN-VDATA . I have a problem with fields of type DEC. In field NEW_INNNN-VDATA it looks like this : '####' I believe that the po
-
Troubles connecting an Airport (2011) to ATT 2wire 2701 ADSL..help?
I can't seem to get the Airport to function as my router ect I have ATT Internet DSL service and a 2wire 2701 modem/router. There is no way to disable the wireless on the 2 wire.. I set up the 2wire in bridge mode, set the airport up to function as
-
Hi We have bought the DAQcard-6024E card with it's drivers. (for PCMCIA) I need a list of the instructions for setting up and reading the card using C++. Where can I find such a list or document? Thanks!
-
I have an ipad 2 but got locked, just want to know if it is possible unlocked
hello a question, I have an ipad 2 but got locked, just want to know if it is possible unlocked