ADSM-L

ksh here documents for sql cmds

2004-11-19 12:45:36
Subject: ksh here documents for sql cmds
From: Richard Rhodes <rrhodes AT FIRSTENERGYCORP DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 19 Nov 2004 12:30:20 -0500
Be kind . . . . don't laugh tooo hard . . . .

I thought I'd share this.

I got tired coding dsmadmc cmd line sql cmds like the following in ksh
scripts . . .

  dsmadmc -id=admin -password=admin -tab \
   select entity, count\(\*\) \
    from summary \
    where cast\(\(current_timestamp-start_time\)hours as decimal\(8,0\)\)
\< 25 \
    group by entity having count\(\*\)\>1 \
    order by 2 desc

The admin ref manual doesn't say anything about dsmadmc accepting input
from stdin, but I figured I'd try it anyway . . . it WORKED!!!!

dsmadmc -id=admin -password=admin -tab <<EOD
  select entity, count(*) \
  from summary \
  where cast((current_timestamp-start_time)hours as decimal(8,0)) < 25 \
  group by entity having count(*)>1 \
  order by 2 desc
EOD

Now, doesn't that look much better?

ok . . you can stop laughing at me now . . .

Rick


-----------------------------------------
The information contained in this message is intended only for the personal
and confidential use of the recipient(s) named above. If the reader of this
message is not the intended recipient or an agent responsible for
delivering it to the intended recipient, you are hereby notified that you
have received this document in error and that any review, dissemination,
distribution, or copying of this message is strictly prohibited. If you
have received this communication in error, please notify us immediately,
and delete the original message.

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