Tema: script
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/03/2012, 15:37
Avatar de matanga
matanga
 
Fecha de Ingreso: octubre-2007
Ubicación: España
Mensajes: 1.091
Antigüedad: 16 años, 6 meses
Puntos: 85
Respuesta: script

Este ejemplo sirve para crear el nombre del fichero spool en función de la fecha.

Código:
set termout off
set markup html on spool on
alter session set nls_date_format='mm-dd-yyyy';
column spool_file new_val spool_file
select to_char(sysdate,'dd-mm-yyyy')||'.xls' spool_file from dual;
spool &spool_file
aqui va la query normal select * from xxxxxxxxx xxx xxx x x xx x x x x 
spool off
set markup html off spool off
exit;
Saludos