Title: Running DBI, ODBC in the crontab

Hi,

I am running a perl script, using DBI and ODBC (from DataDirect), on a linux box to connect to SQL server.   It works fine if I run it from a shell command line.

However, if I put it into a crontab (the same user), I got the following error:

install_driver(ODBC) failed: Can't load '/QRT/ODBC/perlModule/myInstall/lib/auto/DBD/ODBC/ODBC.so' for module DBD::ODBC: libstdc++.so.5: cannot open shared object file: No such file or directory at /sbcimp/run/pd/perl/5.8.3/lib/DynaLoader.pm line 229.

 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected

The failure is at the line

$dbh = DBI->connect

Here is what I tried to diagnosis.

0. if I do "ldd /QRT/ODBC/perlModule/myInstall/lib/auto/DBD/ODBC/ODBC.so" from a shell command, there is a clear path associated with libstdc++.so.5

1. I checked (by printing out the environment variable's LD_LIBRARY_PATH within my perl script) the LD_LIBRARY_PATH, the path for item 0 is there.

2. if I repeat the item 0 within the perl script (when running in the crontab), the output indicates the library (ODBC.so) is fine with correct linkage.

Every debugging output looks normal, and I just could not find the problem…

It will be greatly appreciated if some expert can share his experience with me.

Many thanks.

Best,


Stephen Chung



This communication is issued by UBS AG or an affiliate ("UBS") by the
Sales or Trading Department to institutional investors only and is
not research. It is for informational purposes and is not an official
confirmation of terms. It is not guaranteed as to accuracy, nor is it
a complete statement of the financial products or markets referred
to. Opinions expressed are subject to change without notice and may
differ or be contrary to the opinions or recommendations of UBS
Investment Research or the opinions expressed by other business areas
or groups of UBS as a result of using different assumptions and 
criteria. UBS may, as principal or agent, have position in, 
underwrite, buy or sell, make a market in, or enter into derivatives
transactions in relation to any financial instrument or asset 
referred to in this email. Unless stated specifically otherwise, this
is not a recommendation, offer or solicitation to buy or sell and any
prices or quotations contained herein are indicative only. UBS has
policies and procedures designed to minimise the risk that that
officers and employees are influenced by any conflicting interest or
duty and that confidential information is improperly disclosed or 
made available. To the extent permitted by law, UBS does not accept
any liability arising from the use of this communication. 
For additional information, please contact your local sales or 
trading contact. © 2005 UBS.  All rights reserved.
Intended for recipient only and not for further distribution 
without the consent of UBS.

Reply via email to