Timestamp with time zone error



IBM's flagship relational database management system

Timestamp with time zone error

Postby derUhu » Thu Dec 29, 2022 10:25 pm

Greetings,
Documentation about CREATE TABLE claims that "TIMESTAMP WITH TIME ZONE" can be used as a type for table column. But when I try to create a table with such type I'm getting the following error:

db2 => create table test (n int, t timestamp with time zone, c varchar(24));
DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "time" was found following "nt, t timestamp
with"
.  Expected tokens may include:  "REFERENCES".  SQLSTATE=42601

I'm using Command Line Processor for DB2 Client 11.5.8.0

What I'm doing wrong?

Best regards,
Michael
derUhu
 
Posts: 2
Joined: Thu Dec 29, 2022 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Timestamp with time zone error

Postby engh » Thu Jan 05, 2023 8:40 pm

Hi

it seems that the abbreviation "int" is not understood as a valid type
try again replacing it with "integer"
engh
 
Posts: 9
Joined: Fri Jul 08, 2022 7:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Timestamp with time zone error

Postby derUhu » Mon Jan 09, 2023 12:08 pm

it seems that the abbreviation "int" is not understood as a valid type
try again replacing it with "integer"

No. If I remove 'WITH TIME ZONE' options the table is created successfully.
I searched a bit more, it seems that TIMESTAMP WITH TIME ZONE is supported by zOS version only.
derUhu
 
Posts: 2
Joined: Thu Dec 29, 2022 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Timestamp with time zone error

Postby engh » Mon Jan 09, 2023 2:23 pm

OK, we are on a Mainframe forum, I couldnt expect that answer ;)
engh
 
Posts: 9
Joined: Fri Jul 08, 2022 7:29 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post