On 2007-05-30 14:28, Alex Kosach wrote:
Yes, my statement seems to be correct. I got almost the same error
message when I tried to execute this select without providing correct
credentials.
However, everything worked perfectly after I specified user
name/password and the system
When working with dinosaurs like Oracle, you need to set up the
correct environment (LD_LIBRARY_PATH in this case), better
do ". oraenv" to get that (among other stuff) correct.
And to be able to ". oraenv" you must be executing in a shell,
so better make that ". oraenv" + sqplus some shell script
executed by procmail.
-----Original Message-----
From: procmail-bounces(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
[mailto:procmail-bounces(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE] On Behalf Of
N.J. Mann
Sent: Wednesday, May 30, 2007 2:03 AM
To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: Executing select statement with sqlplus
On Tuesday, 29 May, 2007 at 16:47:59 -0400, Alex Kosach wrote:
I am trying to execute a simple select from inside a procmail script
by
using sqlplus.
:0
* $ ? fgrep -is -f somelist.lst
{
:0 fwh
| formail -I"Subject: SOME SUBJECT ${SUBJ_}"
:0
* CUST_NO ?? .
{ SQLPLUS = `/oracle/..../sqlplus name/password(_at_)server "SELECT
ea.address FROM email_address ea
WHERE ea.cust_num = $CUST_NO and ea.primary_ind = 'Y'"`
:0
* SQLPLUS ?? .
EMAILADDRESS=$SQLPLUS
}
However, the log file shows the following error
Executing "/oracle/...../sqlplus, name/password(_at_)server,SELECT
ea.address
FROM email_address ea
WHERE ea.cust_num = XXXXXXXX and ea.primary_ind = 'Y'"
/oracle/........./sqlplus: error while loading shared libraries:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
libsqlplus.so: cannot open shared object file: No such file or
directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
procmail: Assigning "SQLPLUS="
If understand this message correctly, the script cannot be executed
because I don't provide any user name and password. Does anybody know
how to provide this user name and password to execute this select?
Are you sure? Is the log message you included in your message the
correct one? I ask, because I don't think you are right. I know
nothing about SQL and don't claim to be a procmail expert. But, looking
at the log message you posted - specifically the bits I have underlined
- it looks to me like sqlplus cannot find the library libsqlplus.so and
so aborts before even attempting to run your query.
Cheers,
Nick.
--
Paul Bijnens, xplanation Technology Services Tel +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM Fax +32 16 397.512
http://www.xplanation.com/ email:
Paul(_dot_)Bijnens(_at_)xplanation(_dot_)com
***********************************************************************
* I think I've got the hang of it now: exit, ^D, ^C, ^\, ^Z, ^Q, ^^, *
* F6, quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt, abort, hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e, kill -1 $$, shutdown, *
* init 0, kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ... *
* ... "Are you sure?" ... YES ... Phew ... I'm out *
***********************************************************************
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail