Sep 21

Log SQL results

Catégorie : SQL,Shell,Tips and tricksCharles Collier @ 12:40 pm

If you’d like to log the result from a sql script, just prepare your sql script like that:spool result.log
SET SERVEROUTPUT ON
select * from dual;
spool off
exit

Then from a command line or a script shell execute the following command:
# sqlplus user/pwd@db_name @script.sql

Laisser une réponse