sure thing marto,
#!/usr/bin/perl use DBI; use CGI; #BEGIN{ $ENV{'ORACLE_HOME'}="/opt/oracle/product/10.2.0/client_1"; $ENV{'LD_LIBRARY_PATH'}="/opt/oracle/product/10.2.0/client_1/lib32:/us +r/local/lib/sprolib:/usr/local/lib:/usr/lib:/usr/openwin/lib:/usr/dt/ +lib:/usr/lib:/usr/ucblib"; #$ENV{'TWO_TASK'}='DB'; #} print "Content-Type:text/html\n\n"; print<<__HTML__; <html> <head> </head> <title>Test123</title> <body> __HTML__ my $DB="sampleSID"; my $HOST="DBSERVERNAME"; my $PORT="1521"; my $USER="ms_swan"; my $PASS="ms_swan915"; print "<br><br>"; print "Environment variables are:". %ENV; print %ENV; print "<br><br><br><br><br><br>"; print "This is before connecting\n"; my $MysqlDbh = DBI->connect("DBI:Oracle:host=$HOST;sid=$DB;por +t=$PORT",$USER, $PASS, {RaiseError => 0, AutoCommit => 1,PrintError = +> 1 }); print $MysqlDbh; if (! $MysqlDbh) { print "Error Error Error"; }else{ print "Connected"; } my $Statement="select * from AdditionalNodeInformation where Node = '1 +23'"; my $Sth = $MysqlDbh->prepare($Statement); if (! $Sth) { print "Unable to prepare query $Statement.\n$DBI::errstr\n"; exit; } if (! $Sth->execute) { print "Unable to execute query $Statement\n$DBI::errstr\n"; exit; }else{ print "This query has been executed"; } print "</html>";


You can see that the env vars are set.. As 'almut' said, its a problem with Dynamic linking libs.. But i am not certain abt where to set it, other than in crle.. Also, this is running on a TIP server, which is a variation of the IBM's Websphere server.. So, it can be an issue with the server too... And about the error,
install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/site_p +erl/5.8.8/sun4-solaris/auto/DBD/Oracle /Oracle.so' for module DBD::Or +acle: ld.so.1: perl: fatal: /opt/oracle/product/10.2.0/client_1/lib/l +ibclntsh.so.10.1: wrong ELF class: ELFCLASS64 at /usr/local/lib/perl5 +/5.8.8/sun4-solaris/DynaLoader.pm line 230. at (eval 4) line 3 Compilation failed in require Perhaps a required shared library or dll isn't installed where expecte +d
I read that Wrong ELFCLASS error occurs cause of 64-32 bit compatibility.. But this cant be the reason here, as the script works fine on COmmand line..

Regards,
Blub:)

In reply to Re^4: Env Variables by LinuxUser2008
in thread Env Variables by LinuxUser2008

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.