how to do a connection inside plsql?

Is there a way to connect to oracle from plsql?

Anything available new oracle 11g new features.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Geert GConnect With a Mentor Oracle dbaCommented:
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
Geert GOracle dbaCommented:
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
Naveen KumarProduction Manager / Application Support ManagerCommented:
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.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

slightwv (䄆 Netminder) Commented:
>>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.
sakthikumarAuthor Commented:
Yes I want to connect to another DB without using DB link.
Naveen KumarConnect With a Mentor Production Manager / Application Support ManagerCommented:
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.

sakthikumarAuthor Commented:
If I am able to do that, I can easily debug plsql code in other environments.

I cannot create DBlink here.
Geert GConnect With a Mentor Oracle dbaCommented:
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
slightwv (䄆 Netminder) Commented:
>>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?
sakthikumarAuthor Commented:
I've requested that this question be deleted for the following reason:

No answers / impossible in oracle to do this.
Geert GOracle dbaCommented:
a response "It's not possible" is a valid answer.

so you'll have to examine the comments and accept accordingly
slightwv (䄆 Netminder) Commented:
I agree with the above post.

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

and an explicit no you can't
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.