RE: is there an easy way to test for an SPL?
Posted in 2003
The idea is
a good one. In fact, it could be sufficiently useful to
consider something a bit more generic. Here is my suggestion:
#!/usr/bin/sh
SCRIPTNAME=`basename $0`
[[ $# -le 1 ]] && {
echo "Usage: ${SCRIPTNAME} dbname procname1 [procname2 ...]"
exit
}
DBName=$1 ; shift
ProcList="$@"
for proc in ${ProcList}; do
dbschema -d ${DBName} -f ${proc} 2>&1 | grep "No procedure"
if [ $? -eq 0 ]then
echo "Reload ${proc}"
else
echo "${proc} exists"
fi
done
--- "Konikoff, R...." <konikoffr@BRAGG.ARMY.MIL> wrote:
> Ladies and Gentlemen:
>
> Thanks for the quick response. When I finally got around to
> plugging it in,
> here is the final form. Any comments on better ways? (HPUX 11.0
> with IDS
> 7.2x) This example searches a "testdb" for two procedures, p_aging
> (which
> exists) and nadda (which doesn't exist). I piped it to a grep for
> "No
> procedure" since the dbschema command has successful execution even
> if it
> returns no procedure.
>
> #!/usr/bin/sh
> dbschema -d testdb -f p_aging | grep "No procedure"
> if [ $? -eq 0 ]> then
> echo "Reload p_aging"
> else
> echo "p_aging exists"
> fi
>
> dbschema -d testdb -f nadda | grep "No procedure"
> if [ $? -eq 0 ]> then
> echo "Reload nadda"
> else
> echo "nadda exists"
> fi
>
> Thanks.
> Rob
>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/