Example:
SQL> select * from dual; D - Xruns fine, while this:
SQL> select * from dual; -- some commentsstops at second line waiting for input:
SQL> select * from dual; -- some comment 2It was really unpleasant experience.
Cheers, Paweł
My thoughts about developing software. Problems descriptions and solutions, tips, tricks, links to useful resources. Mostly on Oracle, but also PHP, Delphi and other languages & tools.
SQL> select * from dual; D - Xruns fine, while this:
SQL> select * from dual; -- some commentsstops at second line waiting for input:
SQL> select * from dual; -- some comment 2It was really unpleasant experience.
set NLS_LANG=.UTF8
sqlplus user/pwd@db
SQL> set linesize 4000
SQL> set pagesize 0
SQL> set markup html on spool on
SQL> spool a.html
SQL> spool off
define logname=date column clogname new_value logname select 'prefix_'||to_char(sysdate, 'yyyymmdd') clogname from dual; spool '&logname'If there is a need to have also name of database included into filename then it can be read from global_name view:
define logname=date column clogname new_value logname select 'prefix_'||substr(global_name,1, decode(dot,0,length(global_name),dot-1))|| to_char(sysdate, 'yyyymmdd') clogname from (select global_name, instr(global_name, '.') dot from global_name); spool '&logname'Hope you find it useful.

|
Copyright © Paweł Barut
Printing from DOS to USB Printer |
|