Sybase isql equivalent plsql utility?
I am a Sybase DBA. In Sybase you can access the database by using shell script through "isql" utility. I am giving an example below to show the way in Sybase:
#!/bin/sh
#This shell script is used to connect Sybase database and
#executing a select statement on a table. The output is keeping
#in file called "out.dat". Then invoking a nawk script to format
#according to the user requirements.
isql -Uuser_name -Ppassword -o out.dat << END_OF_SQL
use mydb
go
select * from my_tab
go
END_OF_SQL
#The below nawk script just formatting the output data from
#previous SQL statement at certain desired format. This I
#included because of you can continue the shell command after
#terminating the session from Sybase database. Sybase session is
#terminating at END_OF_SQL line.
nawk -f my_form out.dat > result.dat
#This is the end of shell script.
Now my question is that, is there any way in Oracle to perform the same function by using plsql or any other utility?
Through PLSQL we can run a command file and can save the result. But in shell script itself would it be possible the SQL statement as like Sybase?. If anybody can provide this answer it will be a great help.
Thanking you