Question: I need to save datetime in this columns in this format and then it will be seen in this format if i write select TIME from GAMES. But this is wrong. Can you help me ?

```
create table GAMES  (
      CIS_HRY              INTEGER                     not null,
      NAZEV                VARCHAR2(30)                not null,
      Date DATE NOT NULL   FORMAT 'YYYY-MM-DD',
      TIME DATE NOT NULL   FORMAT 'HH24: MI: SS',
      POPIS                  CLOB,
   constraint PK_GAMES primary key (CIS_HRY)
);

```

Answer: 
Dates do not have a "format" in Oracle - they always contain the fields YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND. You format dates using the `TO_CHAR` function when extracting them for use in a particular situation. I suggest that you re-work your table design as

```
create table GAMES  (
      CIS_HRY              INTEGER not null,
      NAZEV                VARCHAR2(30) not null,
      CREATED_DATE_TIME    DATE NOT NULL,
      POPIS                CLOB,
   constraint PK_GAMES primary key (CIS_HRY)
);

```

When fetching data from this table you might use TO\_CHAR to format the date:

```
SELECT CIS_HRY,
       NAZEV,
       TO_CHAR(CREATED_DATE_TIME, 'DD-MON-YYYY HH24:MI:SS') AS CREATE_DT,
  FROM GAMES
  WHERE NAZEV = 'XYZ';

```

Share and enjoy.
There are a couple of things you might do in this case. If you're using Oracle 11g or 12c, you could use virtual columns to "store" the date as a `VARCHAR2` in `YYYY-MM-DD` format, and time in your specified format; or you might use a trigger on `INSERT` or `UPDATE` to do the same with real columns; or you might (and this is probably the best option), create a view:

```
CREATE VIEW games_v AS
SELECT cis_hry, nazev, TO_CHAR(create_dt, 'YYYY-MM-DD') AS chardate
     , TO_CHAR(create_dt, 'HH24: MI: SS') AS chartime, popis
  FROM games;

```

If you need to update the "date" and/or "time" in the `GAMES_V` view, you can do so via an `INSTEAD OF` trigger on `GAMES_V`. That might be overkill for your purposes.

By the way, I would avoid using `date` as a column name in Oracle - it's a reserved word. And you should probably avoid `time` as well - I don't think it is a reserved word, but it is generic and not very descriptive.