Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date fields
Message
De
23/02/2001 00:24:53
 
 
À
20/02/2001 17:36:40
Information générale
Forum:
Oracle
Catégorie:
Autre
Titre:
Divers
Thread ID:
00477826
Message ID:
00478705
Vues:
24
Hope this would be of help, and sorry for my English(^^).

Prompt the SQLPLUS and connect to a Oracle Server. Make new script file by typing like this at prompt 'EDIT filename',for example EDIT DATE_TEST without file extension,
And copy the script below and paste into the empty script window, finally close and save the file.

Run the scriptfile by issuing this command at prompt,'@filename', here we set DATE_TEST so @DATE_TEST or 'START DATE_TEST' works the same. Check the text file spooled and you will see a couple of oracle date formats available.

otherwise, you can issue each SQL command one by one.

-- script to copy ---
set echo on
spool dateformat.txt

select sysdate from dual;

select to_char(sysdate,'YYYYMMDD') from dual;

select to_char(sysdate,'DD-MON-YY') from dual;

select to_char(sysdate,'DD-MONTH-YY') from dual;

select to_char(sysdate,'YEAR') from dual;

select to_char(sysdate,'WW') from dual;

alter session set NLS_DATE_FORMAT = 'DD-MON-YY';

select sysdate from dual;

alter session set NLS_DATE_FORMAT = 'YY/MM/DD';

select sysdate from dual;

spool off
OCP8 DBA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform