Home » SQL & PL/SQL » SQL & PL/SQL » Database link
Database link [message #274516] Tue, 16 October 2007 04:55 Go to next message
sundarfaq
Messages: 235
Registered: October 2007
Location: Chennai
Senior Member
Hi all,

I want to select data from only one table not other tables from other databases.

Source database: rose
destination database:=margin.It has emp,dept,bonus tables in Scott schema.

I login in source database in rose.

I want to select the data from emp table from scott schema in margin database.Suppose i try to select the data from other tables in margin database means, it shows restrictions.

I try like create database link between two databases. but i able to select the data from all tables..

Thanks and regards,
Michael Holding
Re: Database link [message #274517 is a reply to message #274516] Tue, 16 October 2007 04:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Create a database link that connect to user that has only the privilege to access the tables you want.

Regards
Michel
Re: Database link [message #274522 is a reply to message #274517] Tue, 16 October 2007 05:07 Go to previous messageGo to next message
sundarfaq
Messages: 235
Registered: October 2007
Location: Chennai
Senior Member
i give the select for emp tables. after that i select a data from dept tables.i got output but i don't want select the data for other tables.
Re: Database link [message #274546 is a reply to message #274522] Tue, 16 October 2007 06:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I don't understand what you did but you did wrong.
Post ALL what you did from start to end.

Please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

Regards
Michel

[Updated on: Tue, 16 October 2007 06:53]

Report message to a moderator

Re: Database link [message #274784 is a reply to message #274522] Wed, 17 October 2007 02:32 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

holdingbe wrote on Tue, 16 October 2007 16:07

i give the select for emp tables. after that i select a data from dept tables.i got output but i don't want select the data for other tables.


You have to use where clause.
Re: Database link [message #274838 is a reply to message #274784] Wed, 17 October 2007 06:45 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Arju wrote on Wed, 17 October 2007 09:32


You have to use where clause.

And here I was all this time thinking it was the from clause that dictated what tables the data was retrieved from..
Re: Database link [message #274843 is a reply to message #274516] Wed, 17 October 2007 06:53 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

That is because the requirement is not clear.
Re: Database link [message #274962 is a reply to message #274843] Wed, 17 October 2007 23:17 Go to previous messageGo to next message
ora110
Messages: 42
Registered: September 2007
Location: China
Member

Arju wrote on Wed, 17 October 2007 19:53

That is because the requirement is not clear.

yes,I think so too.
Re: Database link [message #274976 is a reply to message #274516] Thu, 18 October 2007 00:02 Go to previous messageGo to next message
sundarfaq
Messages: 235
Registered: October 2007
Location: Chennai
Senior Member
Hi,
I get very difficult requirement from my friend.

I explain clearly below :

I have two databases.

Source databases: Flower
|__________schema: sample.
|______table :emp,dept,bonus,qa
Destination databases: Margin.
|__________schema:Testing.
|______ table :emp,dept,bonus,qa


Now, I login in flower databases in sample schema. I need select data from
Emp table from margin database in testing schema. At the same time I don’t want to access the other tables from margin database in testing schema.

What I try:
I create database link between flower databases and margin databases.i able to select data from all tables from margin database in testing
Schema.

I need to access emp table only and I don’t want other tables.

Please help me.

Thanks,
Michael
Re: Database link [message #274990 is a reply to message #274976] Thu, 18 October 2007 01:10 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is what I said in my first post.

Create a user on margin database that can only query emp table.
Create a database link on flower database that connects through this user.
And this is done.

Regards
Michel
Re: Database link [message #274994 is a reply to message #274516] Thu, 18 October 2007 01:15 Go to previous message
sundarfaq
Messages: 235
Registered: October 2007
Location: Chennai
Senior Member
thanks...
Now working fine
Previous Topic: How to Save password in **** format in tables (merged)
Next Topic: Change Datatype to CLOB
Goto Forum:
  


Current Time: Fri Dec 09 07:42:47 CST 2016

Total time taken to generate the page: 0.13278 seconds