How to use spool to generate file names with dates in sqlplus
Xiaobian to share with you how to use spool in sqlplus to generate file names with dates, I hope you have something to gain after reading this article, let's discuss it together!
sqlplus uses spool to generate file names with dates
col spf new_value spf noprint
select 'd:'||to_char(sysdate,'yyyymmdd')||'.txt' spf from dual;
spo &spf
select * from dual;
spo off;[@more@]
--sqlplus uses spool to generate file names with dates
accept un prompt 'User name: '
accept pw prompt 'secret code: ' hide
accept db prompt 'database: '
connect &un/&pw@&db;
pause continue?
set feedback off
set pages 0
set lines 30000
set trims on
set trim on
set ver off
set heading off
set time off
set timing off
set autot off
set echo off
set show off
set term off
col spf new_value spf noprint
select 'd:'||to_char(sysdate,'yyyymmdd')||'.txt' spf from dual;
spo &spf
select * from dual;
spo off;
exit
After reading this article, I believe you have a certain understanding of "how to use spool to generate file names with dates" in sqlplus. If you want to know more about it, welcome to pay attention to the industry information channel. Thank you for reading!