Wrathchild
Technical User
OK, I'm stumped. I have 18 SQL statements in my script and one option will be to run ALL of them. Instead of hardcoding each one to run, I'm trying to loop thru them. Below is what I have. How do I combine $SQL & $i so I end up being able to access the contents of $SQL1, $SQL2, $SQL3...
I'm now trying this with an array but having no luck with the syntax of putting an SQL command in an array...I'll focus more on arrays if the above isn't possbile.
Code:
SQL1="Select blah blah"
SQL2="Select blah blah"
i=1
while [ "$i" -le 18 ]
do
SQL=[b]$SQL$i[/b]
run_sql
i=$((i+1))
done
I'm now trying this with an array but having no luck with the syntax of putting an SQL command in an array...I'll focus more on arrays if the above isn't possbile.