将HexaDecimal值更新到图像字段 [英] Updating HexaDecimal value into image field

查看:71
本文介绍了将HexaDecimal值更新到图像字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个带有图像数据类型"列的表.我正在尝试将一个十六进制值从一个数据库图像数据类型列更新为另一数据库图像类型列,而当我尝试这样做时,它正在更改十六进制值.

从第一个表复制的原始值是
"0x47494638396151002900F7000000000080000000800080800000008080008000808080808080C0C0C0FF000000FF00FFFF000000FFFF00FF00FFFFFFFFFFFF"

但是当我更新它时,它正在更改为

"0x424D464401000000000036000000280000004501000055000000010018000000000010440100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000
请帮帮我.

Hello All,

I have a Table with a column of Image Datatype. I am trying to update an hexadecimal value from one database Image datatype column to another database image type column and when I am trying to do that, It is changing the hex value.

The original value copied from first table is
"0x47494638396151002900F70000000000800000008000808000000080800080008080808080C0C0C0FF000000FF00FFFF000000FFFF00FF00FFFFFFFFFF"

But when I am updating it, It is changing to

"0x424D464401000000000036000000280000004501000055000000010018000000000010440100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000010000010000010000010"

Please help me out.

推荐答案

UPDATE provider SET signature = '0x47494638396151002900F70000000000800000008000808000000080800080008080808080C0C0C0FF000000FF00FFFF000000FFFF00FF00FFFFFFFFFF' where ProviderID=1

,我要做的第一件事就是取消引号:

Firsth thing I would do is loose the quotes:

UPDATE provider SET signature = 0x47494638396151002900F70000000000800000008000808000000080800080008080808080C0C0C0FF000000FF00FFFF000000FFFF00FF00FFFFFFFFFF where ProviderID=1

(因为这是一个Image字段),它将带引号的数据作为字符串而不是二进制流.

但是,当我尝试使用它时,无论哪种方法都使用您的字符串,我会得到我期望的结果:从您的ASCI字符串中得出"0","x","4","7" ...
没有引号,我得到正确的数据.确定要正确读取数据吗?

Since this is an Image field it will take quoted data as a character string rather than a binary stream.

But when I try it, using your string in either method abovce I get what I would expect: from yours the ASCI string for ''0'' ''x'' ''4'' ''7'' ...
Without the quotes I get the right data. Are you sure you are reading the data correctly?


这篇关于将HexaDecimal值更新到图像字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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