Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Sv: getting a count of arguments
Hello Sarah,
The scripts Im used to write are typically writen to be run on a unix user and the parameter check are therefore made in UNIX. If you have access to unix shell, this sample script migth help othewise it wont!
######################################### # Sample script
#########################################unset sqlscipt
case $foo in
Sarah) name="Sarah" ;;
*) echo "\10*>"
echo 'The name is wrong!'
echo 'The name are Sarah'
exit ;;
esac
echo ' The list is underway'
sqlscript
# this invokes the procedure sqlscript ()
lp -d$2 -s -c -off /tmp/fname.lst
rm /tmp/fname.lst
#this cleans up
With this script I can call the scipt bye entering: script Sarah Printername
This can even be called bye the cron in unix to be executed at none workhours.
wiht regards Allan
Sarah Officer <officers_at_aries.tucson.saic.com> skrev i en
nyhedsmeddelelse:378623AA.23EF2D09_at_aries.tucson.saic.com...
> I have created a sql script that can be invoked by START. It
> requires a couple arguments, which I reference in the script by
> using &1, &2, ... I would like to put a statement at the top of my
> sql script which exits with a message if the exact number of
> arguments is not given; something like
>
> if(#* != 3)
> prompt "This script requires three arguments:"
> prompt " foo - the first arg"
> prompt " bar - the second arg"
> prompt " baz - the third arg"
> exit
> endif;
> >
> create ....
> insert ....where '&1'...and '&2'... and '3' ....
>
> exit
> >
>
>
![]() |
![]() |