Run oracle form bash
Hallo:
I'm trying to run oracle sql statement form bash.
It's possible to run a oracle sentence with:
sqlplus user/pass@sid <<End
sentence 1
sentence 2
sentence 3
commit
End
The problem is that it's a bit slow due to continues connections.
Is possible to open a oracle connection and redirect request with exec?
what I try is to open it with
exec 3<>/tmp/connection
sqplus user/pass@sid >&3
now I what to run my script and every time I want to do a request to Oracle, not to have to open the connection (it's already open), just redirect the input/output:
select * from dual; 0>&3
And receive the unanswered with
read result 1<&3
And finally do:
commit 0>&3
exec 3<&-
This is the idea, but don't know if is possible and the syntax I have to use with the redirectors of &3 (don't know how exec and &3 is used).
Thanks
|