connecting oracle from perl
I was trying to run this command and got this error :
Code:
perl -e 'use DBD::Oracle; print $DBD::Oracle::VERSION,"\n";' Quote:
|
Not sure what that error message means, and haven't searched the 'net for it. (Have you?)
I'm using Perl to extract rows from Oracle (via SELECT) statements, and I also utilize the DBI and DBD::Oracle modules. A few questions:
For posterity's sake, here's a quick example (YMMV) of a file that can be sourced into a Bourne shell environment: Code:
# Environment for Oracle client Code:
#!/usr/bin/perl |
Thanks anomie for your response.
I have searched in net,tried some(http://modperlbook.org/html/22-1-2-i...oad-DBD-O.html), but not getting resolved. All the environment are set in ~.bashrc file of user oracle. Initially I tried to install through cpan and result is as below: Code:
install DBD:Oracle Quote:
I generally use shell scripts in my works. But since last few weeks ,I am learning perl and I love to use perl in my work whenever possible. |
FWIW - and I hope you're able to determine otherwise - I was not able to get DBD::Oracle working with RHEL5 and Perl v5.8 at all. :(
So I actually downloaded the latest Perl source code, compiled it and installed it into a "sandboxed" environment (using an unprivileged user), e.g. /myperl. Then, I installed DBI and DBD::Oracle into the shiny, new /myperl environment. In order to do all that successfully, I first had to set: Code:
export PATH=/myperl/bin:/bin:/usr/bin
Then, of course, for Perl scripts that will utilize the new environment, set #!/myperl/bin/perl as the interpreter. If you decide you're crazy enough (like me) to go to all this trouble, do NOT do any of these steps (except for creating the /myperl directory) as root. If you accidentally trample your Perl v5.8 install, you could potentially screw up your system. |
All times are GMT -5. The time now is 11:54 PM. |