Re: Unix to Oracle / Back

From: joel garry <joel-garry_at_home.com>
Date: Thu, 16 Jul 2009 15:10:06 -0700 (PDT)
Message-ID: <82ee3c68-9ffe-4103-955e-2cb6ea57520d_at_k13g2000prh.googlegroups.com>



On Jul 16, 2:03 pm, The Magnet <a..._at_unsu.com> wrote:
> I'm trying to accomplish this:
>
> estimates=`sqlplus -s $user/${password} << "  EOF"
>   set heading off feedback off verify off timing off
>   SELECT count(*)
>   FROM daily_estimates
>   WHERE TO_CHAR(date_appended,'YYYYMMDD') = '$yyyymmdd';
>   exit
>   EOF`
>
> I get nothing.  If I hard code an actual date in there, it works
> fine.  Why is Oracle not resolving the variable?  I've seen this on
> many pages and it works fine there.......
>
> Oracle 10g R2.  Using ksh......
>
> Many thanks!

Something bizarro with the eof quoting. Try removing the double quotes and moving the ending EOF to the beginning of the line. There's some other trick to do what you want but I can't quite remember what it is, something to do with the backquotes making things different, I think. I don't do it enough to remember all the nesting rules.

jg

--
_at_home.com is bogus.
http://www.sun.com/aboutsun/pr/2009-07/sunflash.20090716.1.xml
Received on Thu Jul 16 2009 - 17:10:06 CDT

Original text of this message