Solved

how to do a connection inside plsql?

Posted on 2013-11-27
15
350 Views
Last Modified: 2013-12-20
Is there a way to connect to oracle from plsql?

Anything available new oracle 11g new features.
0
Comment
Question by:sakthikumar
  • 5
  • 3
  • 3
  • +1
15 Comments
 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39682994
if you are using pl/sql then you are already inside the oracle db
if you want to connect to another db, setup a db_link and use that db_link from the pl/sql

some more detail explanation may help to understand what you're looking for
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 39684674
from plsql to oracle connecting ?????

read it this way --> Only after you connect to oracle database, you can use pl/sql right.

Can you please explain as to what is your requirement as it is difficult to understand from what had posted here.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39689859
>>Anything available new oracle 11g new features.

A ton of new features.  This is why Oracle has a New Features Guide for every release.  The online docs for your specific version has it.
0
 

Author Comment

by:sakthikumar
ID: 39691752
Yes I want to connect to another DB without using DB link.
0
 
LVL 28

Assisted Solution

by:Naveen Kumar
Naveen Kumar earned 167 total points
ID: 39691800
hmmm.. why you want to connect to another db without using db links ? The whole purpose of having db links is to give that feature right. You do not need to login to another database from one database, all you need to do is to just use the db link to query the required data from the target database by running the query from the source database itself.

connect command is not a pl/sql command to be used in the pl/sql programs. If it is using sql or unix shell scripts, then use the exit command to first logout from the current database, then again use the connect command to the target database with the username/password accordingly.

Thanks,
0
 
LVL 36

Accepted Solution

by:
Geert Gruwez earned 333 total points
ID: 39691817
there is no other way ...
unless you would use the host environment

technically with pl/sql you can (if you have the priviliges) create scripts on the host server
and have the database execute them

1 such sample is sending mails with attachments
> sending a mail is also contacting another database (outlook), but this has been embedded in a package, so it's not all that difficult any more

but what's the point ?
unless you want to achieve something malicious ?

please explain what exactly you want to do
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:sakthikumar
ID: 39694662
If I am able to do that, I can easily debug plsql code in other environments.

I cannot create DBlink here.
0
 
LVL 36

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 333 total points
ID: 39695204
if you can't create a dblink
and can't use the host environment or don't have access to it

then the answer to your first question is:
No, It's not possible
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39695336
>>I can easily debug plsql code in other environments.

How do you see being able to connect to a remote database from inside pl/sql in a local database being able to assist you in being able to debug pl/sql code in the remote database?
0
 

Author Comment

by:sakthikumar
ID: 39697584
I've requested that this question be deleted for the following reason:

No answers / impossible in oracle to do this.
0
 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39697585
a response "It's not possible" is a valid answer.

so you'll have to examine the comments and accept accordingly
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39698115
I agree with the above post.

Please review:
The experts told me “you can’t do that”. What do I do now?

http://support.experts-exchange.com/customer/portal/articles/755964-the-experts-told-me-%E2%80%9Cyou-can%E2%80%99t-do-that%E2%80%9D-what-do-i-do-now-?b_id=44
0
 
LVL 36

Expert Comment

by:Geert Gruwez
ID: 39705546
with alternatives
#39691800
#39691817

and an explicit no you can't
#39695204
#39698115
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now