On 02/02/07 19:50, Terry Maragakis wrote:
I am having a problem establishing a connection with my database.

The following connection specification in my program

$dbh = DBI->connect("DBI:Oracle:D102L",'scott/tiger','');

Is giving me the error:

DBI connect('D102L','scott/tiger',...) failed: ORA-12154: TNS:could not
resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at
./test.pl line 17

Mentioning 'D102L' in the first argument in DBI->connect is
roughly equivalent to setting the environment variable
TWO_TASK to the same value. This is usually appropriate for
connecting to remote databases.

If you want to connect directly to a database on the local
computer, the simplest way is to use the ORACLE_SID environment
variable. You can set this within the perl program if you
wish. Vis:

  $ENV{ORACLE_SID} = 'D102L';

--
Charles Jardine - Computing Service, University of Cambridge
[EMAIL PROTECTED]    Tel: +44 1223 334506, Fax: +44 1223 334679

Reply via email to