Re: Perl+DBI question [C1]



On Mon, Jul 28, 2008 at 8:06 AM, Srinivas KATTI <srinivas.katti@xxxxxxxxx>wrote:

I am working on perl assignment which is first perl code in our
environment, i have come across following problem, pls if you could
provide your expert consultansy it will be great help to me

I am trying to use DBI in my program (simple program), below is the piece
of code


************************************************************************************************************************************************
#!/usr/bin/perl -w
#use lib '/tools/dev/perl_modules/DBI/1.48/DBI-1.48';

BEGIN {
push @INC,"/tools/dev/perl_modules/DBI/1.48/DBI-1.48";
}



Try /tools/dev/perl_modules -- Perl will add the sub-directories.
See the other directories on @INC for examples.
Or, maybe, you need to add blib to the end of the name you're using.

If you haven't installed DBI yet, do so -- don't try to use it (or build any
DBD modules) until it is installed. Doing that prevents this sort of
headache.



use DBI;
use strict;
my $dbh = DBI->connect( 'dbi:Sybase:SNYCTLDBD01',
'glrecadm',
'glrecadm',
{
RaiseError => 1,
AutoCommit => 0
}
) || die "Database connection not made:
$DBI::errstr";
$dbh->disconnect();

when i execute the above program, get the following error

************************************************************************************************************************************************
Can't locate loadable object for module DBI in @INC (@INC contains:
/usr/perl5/5.00503/sun4-solaris /usr/perl5/5.00503
/usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005 .
/tools/dev/perl_modules/DBI/1.48/DBI-1.48) at
/tools/dev/perl_modules/DBI/1.48/DBI-1.48/DBI.pm line 254
BEGIN failed--compilation aborted at
/tools/dev/perl_modules/DBI/1.48/DBI-1.48/DBI.pm line 254.
BEGIN failed--compilation aborted at dbp.pl line 7.


**********************************************************************************************************************************************

when i check the DBI.pm code

glrecdev@drdbpmpk01:[/tools/dev/perl_modules/DBI/1.48/DBI-1.48]> ls -l
DBI*
-rwxr-xr-x 1 fftst root 269772 Mar 14 2005 DBI.pm
-rwxr-xr-x 1 fftst 307 133636 Jan 20 2005 DBI.xs
-rwxr-xr-x 1 fftst 307 20392 Dec 14 2004 DBIXS.h
glrecdev@drdbpmpk01:[/tools/dev/perl_modules/DBI/1.48/DBI-1.48]>

the comments specified in DBI.pm says

# If you get an error here like "Can't find loadable object ..."
# then you haven't installed the DBI correctly. Read the README
# then install it again.

So is this correct? do i need to install it again Or is it something that
i am missing or not using correctly?

Please do let me know if you need any other info to understand/trouble
shoot my query



--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."


Relevant Pages

  • Errors in DBI installation!!
    ... I am getting the errors when trying to install DBI module. ... Perl versions below 5.6.1 are no longer supported by the DBI. ... *** Error code 1 ...
    (perl.dbi.users)
  • Problem of DBI build
    ... I installed Oracle Application Server 4.0.8.2 included perl module. ... I need to installe DBI and DBD::Oracle module. ... You can install them any time after installing the DBI. ... line 318: error 1705: Function prototypes are an ANSI feature. ...
    (perl.dbi.users)
  • Fwd: DBI install error,can you help me?
    ... Are you sure the compiler you have is the one used to build Perl? ... I try to install the DBI package but it failed. ... d declaration specifiers or '...' ...
    (perl.dbi.users)
  • Re: Unable to install DBD::ODBC on OSX Leopard 10.5.2
    ... Have you installed a newer DBI? ... Subject: Unable to install DBD::ODBC on OSX Leopard 10.5.2 ... the same assignment fails in line 336. ... Marble Bar Asset Management LLP is regulated and authorised by the FSA. ...
    (perl.dbi.users)
  • Problem of DBI build
    ... I installed Oracle Application Server 4.0.8.2 included perl module. ... I need to installe DBI and DBD::Oracle module. ... You can install them any time after installing the DBI. ... line 318: error 1705: Function prototypes are an ANSI feature. ...
    (perl.dbi.users)