Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

perl and sql

Status
Not open for further replies.

devilpanther

Programmer
Oct 8, 2004
57
IL
I would like to learn how to work with databases like sql. to read and write from them with perl.

can some one please point me to a good location where i can learn all that on-line.

Thank you.
 
There's a Getting Started FAQ here - Database Resources section of FAQs

Mike

To err is human,
but to really foul things up -
you require a man Mike.

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Thread hijack? I assume you mean adding my issues to this thread? Well since the other poster is also trying to get perl to connect with MS SQL I thought it would be best to keep this as one thread not add a new one. If this is not the way to do it, then sorry I thought this was the best way to do this. Now thats if thats what you ment by thread hijack....if not then whats it mean?

That being said....

Mike -

Thanks that answered that question. But I am still getting some errors. When I run the perl Makefile.PL without getting the error message:

=======================
ERROR MESSAGE
=======================
Configuring DBD::ODBC ...

>>> Remember to actually *READ* the README file!
And re-read it if you have any problems.

Using DBI 1.46 (for perl 5.008005 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBI/

The DBD::ODBC module needs to link with an ODBC 'Driver Manager'.
(The Driver Manager, in turn, needs one or more database specific ODBC drivers.
The DBD::ODBC module does _not_ include any ODBC drivers!)

You need to indicate where your ODBC Driver Manager is installed.
You can do this ether by setting the ODBCHOME environment variable
or by runing 'perl Makefile.PL -o odbcdir'.

If you do not have an ODBC Driver Manager you can try building
the free iODBC Driver Manager in the iodbcsrc directory.

==============================


I think i have the iodbc 3.52.1 installed but it but am not totally sure its correct. i didnt get any error messages. So i think its right. Now if I use:

perl Makefile.PL -o /dir_of_iODBC it seems to run ok but when I runmake test I get an error even after setting the environment variables. Here is the output:

================
[root@localhost DBD-ODBC-1.13]# DBI_DSN=myserver1
[root@localhost DBD-ODBC-1.13]# DBI_USER=myUN
[root@localhost DBD-ODBC-1.13]# DBI_PASS=myPW
[root@localhost DBD-ODBC-1.13]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01base.........ok 3/5install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/01base.t line 15
# Looks like you planned 5 tests but only ran 3.
# Looks like your test died just after 3.
t/01base.........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 4-5
Failed 2/5 tests, 60.00% okay
t/02simple.......skipped
all skipped: DBI_DSN is undefined
t/03dbatt........skipped
all skipped: DBI_DSN is undefined
t/05meth.........skipped
all skipped: DBI_DSN is undefined
t/07bind.........skipped
all skipped: DBI_DSN is undefined
t/08bind2........skipped
all skipped: DBI_DSN is undefined
t/09multi........skipped
all skipped: DBI_DSN is undefined
t/20SqlServer....skipped
all skipped: DBI_DSN is undefined
t/30Oracle.......skipped
all skipped: DBI_DSN is undefined
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/01base.t 255 65280 5 4 80.00% 4-5
8 tests skipped.
Failed 1/9 test scripts, 88.89% okay. 2/5 subtests failed, 60.00% okay.
make: *** [test_dynamic] Error 255
[root@localhost DBD-ODBC-1.13]#


=================


Any ideas?

Again if this is the incorrect way to add to a thread I appoligize.

-Ryan
 
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so'

Does this file exist, or could it be corrupted?

--Paul

Nancy Griffith - songstress extraordinaire,
and composer of the snipers anthem "From a distance ...
 
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so'

Does exists. Could be corrupted, hmmm. What would you suggest?

Ryan
 
Like this to set variables - I should have said last time.

Code:
[root@localhost DBD-ODBC-1.13]# export DBI_DSN=myserver1
[root@localhost DBD-ODBC-1.13]# export DBI_USER=myUN
[root@localhost DBD-ODBC-1.13]# export DBI_PASS=myPW

Mike

To err is human,
but to really foul things up -
you require a man Mike.

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
I started over on a clean install of Fedora Core 2.

I installed DBI
That seemed to go fine

I set Env. Variables:
export DBI_DSN=myserver1
export DBI_USER=myUN
export DBI_PASS=myPW
That seemed fine

Installed iodbc to /usr/local/stow/iodbc-3.52.2
That seemed fine

export LD_LIBRARY_PATH=/usr/local/stow/iodbc-3.52.2/
That seemed fine and I see this now in the PATH

Now trying to get the DBD::ODBC installed is where I am having issues.
I run perl Makefile.PL -o /usr/local/stow/iodbc-3.52.2/
that seems ok However it reports
"WARNING: LD_LIBRARY_PATH doesn't include =/usr/local/stow/iodbc-3.52.2/"
This is odd since I can see it in the env
But it does pick up all the DBI_DSN USER and PASS.
"make" seems fine
"make test" has many errors and fails all over the place. Here is what I get"

===================
output
===================
[root@localhost DBD-ODBC-1.13]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01base.........ok 3/5install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/01base.t line 15
# Looks like you planned 5 tests but only ran 3.
# Looks like your test died just after 3.
t/01base.........dubious
Test returned status 255 (wstat 65280, 0xff00)
Scalar found where operator expected at (eval 152) line 1, near "'int'
$__val"
(Missing operator before $__val?)
DIED. FAILED tests 4-5
Failed 2/5 tests, 60.00% okay
t/02simple.......ok 2/36install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/02simple.t line 21
# Looks like you planned 36 tests but only ran 2.
# Looks like your test died just after 2.
t/02simple.......dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 3-36
Failed 34/36 tests, 5.56% okay
t/03dbatt........ok 2/24install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/03dbatt.t line 24
# Looks like you planned 24 tests but only ran 2.
# Looks like your test died just after 2.
t/03dbatt........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 3-24
Failed 22/24 tests, 8.33% okay
t/05meth.........ok 1/8install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 2) line 3
Compilation failed in require at (eval 2) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/05meth.t line 24
# Looks like you planned 8 tests but only ran 1.
# Looks like your test died just after 1.
t/05meth.........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-8
Failed 7/8 tests, 12.50% okay
t/07bind.........ok 1/11install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 2) line 3
Compilation failed in require at (eval 2) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/07bind.t line 22
# Looks like you planned 11 tests but only ran 1.
# Looks like your test died just after 1.
t/07bind.........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-11
Failed 10/11 tests, 9.09% okay
t/08bind2........ok 2/5install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/08bind2.t line 26
# Looks like you planned 5 tests but only ran 2.
# Looks like your test died just after 2.
t/08bind2........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 3-5
Failed 3/5 tests, 40.00% okay
t/09multi........ok 3/7install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 4) line 3
Compilation failed in require at (eval 4) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/09multi.t line 26
# Looks like you planned 7 tests but only ran 3.
# Looks like your test died just after 3.
t/09multi........dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 4-7
Failed 4/7 tests, 42.86% okay
t/20SqlServer....ok 2/37install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/20SqlServer.t line 47
# Looks like you planned 37 tests but only ran 2.
# Looks like your test died just after 2.
t/20SqlServer....dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 3-37
Failed 35/37 tests, 5.41% okay
t/30Oracle.......ok 2/4install_driver(ODBC) failed: Can't load
'/root/DBD-ODBC-1.13/blib/arch/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC:
libiodbc.so.2: cannot open shared object file: No such file or directory at
/usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at t/30Oracle.t line 26
# Looks like you planned 4 tests but only ran 2.
# Looks like your test died just after 2.
t/30Oracle.......dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 3-4
Failed 2/4 tests, 50.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/01base.t 255 65280 5 4 80.00% 4-5
t/02simple.t 255 65280 36 68 188.89% 3-36
t/03dbatt.t 255 65280 24 44 183.33% 3-24
t/05meth.t 255 65280 8 14 175.00% 2-8
t/07bind.t 255 65280 11 20 181.82% 2-11
t/08bind2.t 255 65280 5 6 120.00% 3-5
t/09multi.t 255 65280 7 8 114.29% 4-7
t/20SqlServer.t 255 65280 37 70 189.19% 3-37
t/30Oracle.t 255 65280 4 4 100.00% 3-4
Failed 9/9 test scripts, 0.00% okay. 119/137 subtests failed, 13.14% okay.
make: *** [test_dynamic] Error 255
[root@localhost DBD-ODBC-1.13]#
===================
End output
===================

Sorry that output is so long but thought maybe one of you might need it.

Any Ideas?

Ryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top