I am going to suggest that you probably are taking the wrong approach
to solving the problem in the first place.
There isnt really any reason (and it is the wtong thing to do ) to
break what you are trying to do into two complete scripts. You might
want to read the section in the PL/SQL users guide on subprograms
(functions and procedures) because that is what you REALLY want to be
doing ...
I would actually kind of surprised that the following fragment would
run ....
For i in 1..6 Loop -- i will be the leading species value
@ prog2.sql &species i
END Loop;
Don't get SQLPLUS and PL/SQL confused. They are very different and I
think that you are conflating the syntaxes of the two.
You mention that you are not a CS person. I would suggest that if that
is the case you stay as far away from using SQLPLUS and PL/SQL as you
can. You would probably be far better off, if you need to learn a
scripting language, to learn Ruby or Python. You can easily access
Oracle (or any other data source) data from them and they are far more
flexible and friendly.
RTFM .. means "Read The F'ing Manual". If you arent a programmer to
start with ... I would say that you should change the manual you were
going to read :-)
On Feb 6, 4:41 pm, jhchan <
jhcha...@gmail.com> wrote:
> Thanks. I'll do some reading. But I'm not sure that's answering
> exactly what I need my programs to do.
>
> Program 1 will do a loop that will call program 2.
>
> Prog1:
>
> DECLARE species = "'H','HM','HW'"
>
> For i in 1..6 Loop -- i will be the leading species value
> @ prog2.sql &species i
> END Loop;
>
> Prog 2:
>
> DEFINE &1 -- take input from prog 1 for species value
> DEFINE &2 -- take input from prog 2 for primary, secondary, tertiary,
> etc to 6 species
>
> UPDATE table
> -- do stuff in here
> blah blah blah
> ;
>
> I'm definitely a newbie in CompSci stuff and I'm not an acronym person
> so RTFM might as well be martian to me. But any help
> that anyone can provide is much appreciated. I didn't find much in
> terms of examples on the web other than the most simple
> where they count from 1 to 6 and spit out a line using
> dbms_output.put_line and I need much more than that.
>
> On Feb 6, 11:46 am, Rob Wolfe <
wolfe....@gmail.com> wrote:
>
>
>
> > for "define" and substitution variable information in general
>
> >
http://download.oracle.com/docs/cd/B14117_01/server.101/b12170/ch13.h......
> > - Show quoted text -- Hide quoted text -