I regularly need to run a single query on some table in one of my DBs and I would rather not have to create a file and call it as a script and everything if I don't have to.
I would like to be able to send the query directly to sqlplus as a string like this perhaps
sqlplus user/pass@hostname:port/service "select * from table"
instead of having to create a file that holds only that one query and call it with
sqlplus user/pass@hostname:port/service @filename
does anyone know if this is possible?
In addition to mathguy answer, with linux shells,
you can use the operator here-string like this:
sqlplus user/pass@hostname:port/service <<< 'select * from table;'
Don't forget the semi-colon at the end of your query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With