How to get and change encoding schema for a DB2 z/OS database using dynamic SQL statement

萝らか妹 提交于 2019-12-24 22:40:52

问题


A DB2 for z/OS database has been setup for me. Now I want to know the encoding scheme of the database and change it to Unicode if the database is other type of encoding.

How can I do this? Can I do this using dynamic SQL statements in my Java application?

Thanks!


回答1:


You need to specify that the encoding scheme is UNICODE when you are creating your table (and database and tablepsace) by using the CCSID UNICODE clause.

According to the documentation:

By default, the encoding scheme of a table is the same as the encoding scheme of its table space. Also by default, the encoding scheme of the table space is the same as the encoding scheme of its database. You can override the encoding scheme with the CCSID clause in the CREATE TABLESPACE or CREATE TABLE statement. However, all tables within a table space must have the same CCSID.

For more, see Creating a Unicode Table in the DB2 for z/os documentation.

You are able to create tables via Java/JDBC, but I doubt that you will be able to create databases and tablespaces that way. I wouldn't recommend it anyway, I would find your closest z/os DBA and get that person to help you.



来源:https://stackoverflow.com/questions/4790679/how-to-get-and-change-encoding-schema-for-a-db2-z-os-database-using-dynamic-sql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!