十六进制格式的 DB2 查询结果——需要字符/字符串 [英] DB2 query results in Hex format -- Need Character/String

查看:30
本文介绍了十六进制格式的 DB2 查询结果——需要字符/字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以使用我的 python SQL 测试器在 DB2 表上运行的查询,它返回我正在寻找的字符串值.
但是,当我直接在我的数据库上运行它时,它会返回一个十六进制值.将不胜感激以字符串形式获取结果的任何帮助!
这是字段定义:

I have a query that I can run on a DB2 table using my python SQL tester, and it returns the string values I'm looking for.
However, when I run it directly on my database it returns a hex value. Any help in getting the results as a character string would be greatly appreciated!
Here is the field definition:

ORCTL      CCDATA         243      A   14  256 Order Control File Data 

我对 iSeries 的查询是:

My query on the iSeries is:

select ccdata from ORCTL where ccctlk = 'BUYRAK'

推荐答案

使用您的查询,您可以使用另一个 CCSID 转换字符串,例如:

Using your query, you can cast a string with another CCSID, eg :

select cast(ccdata as char(14) CCSID 37) from ORCTL where ccctlk = 'BUYRAK'

这篇关于十六进制格式的 DB2 查询结果——需要字符/字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆