Page 1 of 1

Timestamp with time zone error

PostPosted: Thu Dec 29, 2022 10:25 pm
by derUhu
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

Re: Timestamp with time zone error

PostPosted: Thu Jan 05, 2023 8:40 pm
by engh
Hi

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

Re: Timestamp with time zone error

PostPosted: Mon Jan 09, 2023 12:08 pm
by derUhu
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.

Re: Timestamp with time zone error

PostPosted: Mon Jan 09, 2023 2:23 pm
by engh
OK, we are on a Mainframe forum, I couldnt expect that answer ;)