Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle, Echo, and Maestro Error

Status
Not open for further replies.

gsdcrazy

Programmer
Sep 2, 2002
31
0
0
US
Gurus,

I have the code below that reads a row from an Oracle database and then sets a variable with the results. It works great when I run it from the $ prompt, but, when we schedule it through the Maestro scheduler, I get the following errors:

/beta/nwdw/salesmi/bin/NDWY9017.sh: [[: not found
/beta/nwdw/salesmi/bin/NDWY9017.sh: syntax error at line 101: 'process_year=$' unexpected

The code looks like:

if [ $# -eq 0 ]
then
process_year=`${ORACLE_HOME}/bin/sqlplus -s /nolog << !EOS 2>/dev/null
connect ${UID}
set heading off
set feedback off
set pagesize 0
select /*+ parallel (a) */ to_char(max(process_date), 'YYYY') process_date
from agency_commissions a
where commission_status = 'A';
!EOS
`
process_year=$( echo $process_year | cut -c12-15 );
distribution_list=&quot;agency_mail&quot;;
prod_line=&quot;All&quot;;
fi

Any ideas what needs to be different to run this under Maestro? Is there another group that I should be asking?

Your help is greatly appreciated.

Thanks,
gsdcrazy
 
It's the indents between <<!EOS and !EOS
Either remove the whitespace or do <<-!EOS


Dickie Bird (:)-)))
 
Looks more like a shell problem to me - do you specify the shell to use on the first line?

i.e.

#!/usr/bin/ksh


do a 'echo $SHELL' from the command line to find out which one you use for your account.

Scotty
 
Scotty and Dickie Bird,

Thanks for the help. I am not sure what the &quot;-&quot; in front of the &quot;!EOS&quot; does, but it works either way (with or without). It was as Scotty surmised. Somehow I introduced a space between the &quot;#&quot; and &quot;!&quot; in my &quot;#!/bin/ksh&quot; command. When I corrected that, it works with or without the &quot;-&quot;.

Thanks so much for your help and quick response.

gsdcrazy
 
The <<- means white space before the ending tag &quot;EOS!&quot; will be ignored. Any white space in the lines in between is always acceptable.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top