procmail
[Top] [All Lists]

Re: Executing select statement with sqlplus

2007-05-30 00:10:33
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.
-- 
Please do not CC me on replies, I read the list and don't need the dupes.


____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>