0

I am working with AS400 system. I need to create tables with different encoding for validation task. I tested with

CREATE TABLE TESTSCH.EBCDIC_TBL (
COLUMN1 VARCHAR(100),
COLUMN2 INTEGER
) CCSID ebcdic;

However this is not working and throwing below error.

QL Error [42601]: [SQL0199] Keyword CCSID not expected

How to create a table with different encoding EBCDIC/ Unicode ASCII etc.

I am using Dbeaver to connect to AS400 system.

asked Oct 20, 2022 at 6:18
4
  • What version of Db2 i? Did you have a chance to look at the CREATE TABLE syntax in documentation? Commented Oct 20, 2022 at 12:32
  • Version 11. I followed this link ibm.com/docs/en/db2-for-zos/… Commented Oct 20, 2022 at 13:24
  • There's no IBM i version 11, and your link is for z/OS. Commented Oct 20, 2022 at 13:27
  • z/OS is not the same as IBM i (aka iSeries)... Commented Oct 20, 2022 at 13:28

1 Answer 1

0

The doc's you linked to in your comment are for Db2 for z/OS, which is not the same as IBM i (aka iSeries).

Here's the Db2 for IBM i docs for the CREATE TABLE statement.

And here's what your statement should look like assuming you want CCSID 37 US English

CREATE TABLE TESTSCH.EBCDIC_TBL (
COLUMN1 VARCHAR(100) ccsid 37,
COLUMN2 INTEGER
);

Other CCSID's can be found here

Also note that assuming a supported version of the OS, for Unicode UTF-16 you can use NVARCHAR instead of VARCHAR(xxx) ccsid 1200

CREATE TABLE TESTSCH.UTF16_TBL (
COLUMN1 NVARCHAR(100),
COLUMN2 INTEGER
);
answered Oct 20, 2022 at 13:33
1
  • Thanks for clarification. Appreciate it. Commented Oct 20, 2022 at 14:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.