Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / SQL PLUS Session Environment
 

Accept x prompt Enter date[yyyy-mm-dd]

SQL> SQL> accept x prompt "Enter date[yyyy-mm-dd]: " Enter date[yyyy-mm-dd]: SQL> select date '&x' as input_date   2  ,      to_char(date '&x', 'ww') as ww   3  ,      to_char(date '&x', 'iw') as iw   4  from   dual; old   1: select date '&x' as input_date new   1: select date '' as input_date old   2: ,      to_char(date '&x', 'ww') as ww new   2: ,      to_char(date '', 'ww') as ww old   3: ,      to_char(date '&x', 'iw') as iw new   3: ,      to_char(date '', 'iw') as iw select date '' as input_date             * ERROR at line 1: ORA-01841: (full) year must be between -4713 and +9999, and not be 0 SQL> SQL> undefine x SQL>