sql server - ERR: install_driver(ODBC) failed: Can't locate DBD/ODBC.pm in @INC -


i trying connect mssql database using perl script.

my code looks follows:

#!/home/fds/freeware/perl/bin/perl  use dbi;  $user = "username"; $pass = "password"; $server = "server_name"; $database_name = "db";  $dsn = "driver={sql server};server=$server;database=$database_name;uid=$user;pwd=$pass";  $dbh = dbi->connect("dbi:odbc:$dsn") or die "couldn't open database: $dbi::errstr\n"; 

when run script, getting following error:

install_driver(odbc) failed: can't locate dbd/odbc.pm in @inc (@inc contains: /export/fds/linux_rhel6_x86_64/lang/perl/fdsperl5.12-cpanmodules-5.12-20160408/lib/perl5/x86_64-linux-thread-multi /export/fds/linux_rhel6_x86_64/lang/perl/fdsperl5.12-cpanmodules-5.12-20160408/lib/perl5 /export/fds/linux_rhel6_x86_64/lang/perl/5.12/lib/site_perl/5.12.5/x86_64-linux-thread-multi /export/fds/linux_rhel6_x86_64/lang/perl/5.12/lib/site_perl/5.12.5 /export/fds/linux_rhel6_x86_64/lang/perl/5.12/lib/5.12.5/x86_64-linux-thread-multi /export/fds/linux_rhel6_x86_64/lang/perl/5.12/lib/5.12.5 .) @ (eval 3) line 3. perhaps dbd::odbc perl module hasn't been installed, or perhaps capitalisation of 'odbc' isn't right. available drivers: anydata, csv, dbm, examplep, excel, file, gofer, mock, multi, multiplex, pgpp, proxy, sqlite, sponge, wire10, mysql, mysqlpp. @ test_connect line 12

can let me know how proceed?

this error got fixed when exported following environmental variables corresponding values: ld_library_path & perl5lib


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -