Link to home
Start Free TrialLog in
Avatar of mrong
mrong

asked on

How to execute sql file in Oracle

Greeting,

I need to execute select.sql from Oracle SQL plus worksheet and put output into C:\output.txt.

Pls suggest.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Alex [***Alex140181***]
Alex [***Alex140181***]
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
don't forget to run

SQL>spool off

at the ened
SQL> spool C:\output.txt
SQL> @select.sql
SQL> spool off;  => just need to add this (no points, please)
Sorry, YZlat, didn't see your post before I submitted.
Avatar of mrong
mrong

ASKER

where should I put select.sql?
thanks.
Avatar of mrong

ASKER

Is there anyway to show the sql stmt in the output file? now it only show the output and I won't be able to tell which for which.
Thanks.
where should I put select.sql?
That is up to you/your app ;-)

Is there anyway to show the sql stmt in the output file?
Try "set echo on" and/or "set serveroutput on" (in sqlplus) before executing your .sql file
(or put it right at the beginning of your select.sql)