I search all post...and no soluation about..if i would like to run a sql statement and output the result to txt file.
for example,
i usually run "sql" to logon the database and run select statement. Then I need to copy the output into the result.txt. Can I run the script to do this easiler?
I am not sure how can we check which database is installed in the machine.Might be can find it from the bin directory...Guys , any idea?
Below is another approch to run an sql from unix prompt besides the above method..where new.sql is a text file containing the sql command.This approch will be useful if you have more than one query to run...
There could be many database's present on the machine but what's the use when you dont know which sql you are going to use and incase, if you might not have the user id and password you cant even login to it. So, first you need to ask your dba which database you have to access and its right credentials!!!!