loops with SQL (oracle)
Hey folks,
I need some guidance on loops with SQL (in Oracle more specifically). In bash, this works: Code:
while read a Code:
while read a For troubleshooting, I tried "echo" as follows and it looks correct. So, trying to do something similar with SQL: Code:
while read a What am I missing? |
Nevermind, figured things out; here's what worked for me if someone else come along looking for similar solution (or can point me to a better solution)
Code:
while read a |
To answer your original question, the "show pdbs;" is being read by bash as it is not being passed to sqlplus.
If you are doing a simple short one liner, you could also use a herestring instead of a heredoc: Code:
sqlplus user@"$a" <<<"show pdbs;" |
Quote:
|
All times are GMT -5. The time now is 11:55 AM. |