Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql plus prompt for different date and time

Uday_NJan 31 2022

Hi All,
I am writing a script in sqlplus which should have a header displayed with day yesterday's date and 28 days before with timestamp . I have written the script but i am not able to get it. My script
My script :
SET echo OFF ver OFF pages 0 trimspool ON feed OFF und OFF;
SET term OFF;
SET linesize 30000;
SET sqlblanklines ON;
SET WRAP OFF;
spool &3
prompt "Header" , &(Date -2) , &(timestamp -28)
prompt "Value"
select * from dual ;
spool off ;
exit ;
I should get output as

'Header' ,29-01-2022 , 03-01-2022 09:30:20
Value
X
Sysdate:31- Jan-2022 .

Please kind your advice.

Regards,
Uday

This post has been answered by Frank Kulash on Jan 31 2022
Jump to Answer

Comments

Post Details

Added on Jan 31 2022
6 comments
1,903 views