Simple connection problem.
Try to connect SQLPlus if you can do that then you can use DBD::Oracel
Try the same connection string in DBD:Oracle
Hope this helps
cheers
John
> CC: dbi-users@perl.org
> From: jona...@gmail.com
> Subject: Re: Need Help with DBI for oracle
> Date: Fri, 3 Jun 2011 16:05:23 +0200
> To: ganesh.b.ben...@gmail.com
>
> As you can read from the error message is not interpolated, exchange the
> single quotes for double quotes. Sorry for the abrupt response, but I am in
> transit
>
> jonasbn
>
> Sent from my iPhone
>
> On 02/06/2011, at 15.47, Ganesh Bendre <ganesh.b.ben...@gmail.com> wrote:
>
> > Hi,
> >
> > I am using the following code for fetching some data.
> > but not able to connect
> >
> > *CODE:*
> > #!C:/Perl/bin/perl.exe
> >
> > use DBI;
> > use DBD::Oracle;
> >
> > print "Content-type: text/html \n\n";
> >
> > $platform = "ORACLE";
> > $database = "I8Q.GRP.COM";
> > $tablename = "COUNTY_ADD";
> > $user = "dba";
> > $pw = "dbapass";
> >
> > $dsn = 'dbi:Oracle:$database:in-gh01:1521';
> >
> > $connect = DBI->connect($dsn, $user, $pw);
> >
> > $query = "select ctycode,ctydesc from county_add";
> > $query_handle = $connect->prepare($query);
> >
> > $query_handle->execute();
> >
> > $query_handle->bind_columns(undef, \$ctycode, \$ctydesc);
> >
> > while($query_handle->fetch()) {
> > print "$ctycode, $ctydesc <br />";
> > }
> > *CODE END*
> > **
> > **
> > I am getting the following error when i try to run the above code
> > **
> > *Error:*
> > DBI connect('$database:in-gh01:1521','dba',...) failed: ORA-06401: NETCMN:
> > id driver designator (DBD ERROR: OCIServerAttach) at exequery2.pl line 21
> > Can't call method "prepare" on an undefined value at exequery2.pl line 25.
> > *Error END*
> >
> > *I have installed *
> > *DBD::Oracle*
> > *DBI*
> > **
> > **
> > *i am stuck with this for almost one week
> > Please help me out*
> > **
> > *Ganesh.*
> > **