SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Pastimes : Silicon Investor, under the hood

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: SI Bob who wrote (52)9/16/2005 11:23:50 PM
From: Green Receipt   of 81
 
i recently found out about this trick in sql and had an opportunity to try it out. I was faced with having to query a db value for a key and there were about 500 rows that were going to be returned. Then with the results I needed to run a general purpose bash script one value at a time at a time...

so I put my sql to work and came up with something like this

select 'runmyscript.sh -k ' || mycolumnvalue || ' -update' from mytable where to_char(createdate,'YYYYMMDD') = '20050831'

(I'm working with oracle)

to make a long story short that one line of sql generated my whole script except for the first line:
#!/bin/bash
and the last line:
echo "All done processing "
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext