将\0插入CHAR / VARCHAR字段 [英] inserting \0 into a CHAR/VARCHAR field

查看:91
本文介绍了将\0插入CHAR / VARCHAR字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




是否可以在DB2 CHAR中插入''\0''值或任何控件

字符/ VARCHAR字段?因此,如果我从表''中选择

hex(列),我应该在输出中看到0。我该如何从命令提示符下来?



谢谢,

Vivek

Hi,

Is it possible to insert a ''\0'' value or for that matter any control
character into a DB2 CHAR/VARCHAR field ? So if i do a ''select
hex(column) from table'' i should see a 0 in the output. How can i do it
from the command prompt ?

Thanks,
Vivek

推荐答案



Vivek写道:

Vivek wrote:




是否可以在DB2 CHAR / VARCHAR字段中插入''\0''值或者任何控件

字符?因此,如果我从表''中选择

hex(列),我应该在输出中看到0。我如何从命令提示符下来?



谢谢,

Vivek
Hi,

Is it possible to insert a ''\0'' value or for that matter any control
character into a DB2 CHAR/VARCHAR field ? So if i do a ''select
hex(column) from table'' i should see a 0 in the output. How can i do it
from the command prompt ?

Thanks,
Vivek



例如:

''ABC''|| CHR(0)|| CHR(10)|| CHR(13)|| ''XYZ''

For example:
''ABC'' || CHR(0) || CHR(10) || CHR(13) || ''XYZ''


Tonkuma写道:
Tonkuma wrote:

>

Vivek写道:
>
Vivek wrote:

>

是否可以插入''\ 0''值或在DB2 CHAR / VARCHAR字段中有任何控制角色吗?因此,如果我从表中选择'/ hex(列)'',我应该在输出中看到0。我怎么能从命令提示符呢?

谢谢,
Vivek
>Hi,

Is it possible to insert a ''\0'' value or for that matter any control
character into a DB2 CHAR/VARCHAR field ? So if i do a ''select
hex(column) from table'' i should see a 0 in the output. How can i do it
from the command prompt ?

Thanks,
Vivek



例如:

''ABC''|| CHR(0)|| CHR(10)|| CHR(13)|| ''XYZ''

For example:
''ABC'' || CHR(0) || CHR(10) || CHR(13) || ''XYZ''



不幸的是,这不会起作用,因为CHR(0)= 0x20 =''''=空格。
http://publib.boulder.ibm.com/infoce...n/r0000778.htm


但是0x00 =''\'''可以是由应用程序插入。


-

Knut Stolze

DB2信息集成开发

IBM德国

Unfortunately, this won''t work because CHR(0) = 0x20 = '' '' = space.
http://publib.boulder.ibm.com/infoce...n/r0000778.htm

But an 0x00 = ''\0'' can be inserted by an application.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


Knut,


你说的是对的,但是chr(0)如何映射到0x20?

i认为chr()取了ascii值,0是''\0''

字符的ascii。


Knut Stolze写道:
Knut,

What you said is right, but how is chr(0) mapped to 0x20 ?
i thought chr() took ascii values and 0 is the ascii for ''\0''
character.

Knut Stolze wrote:

Tonkuma写道:
Tonkuma wrote:


Vivek写道:

Vivek wrote:




我是否可以在DB2 CHAR / VARCHAR字段中插入一个''\0''值或者任何控制

字符?因此,如果我从表''中选择

hex(列),我应该在输出中看到0。我如何从命令提示符下来?



谢谢,

Vivek
Hi,

Is it possible to insert a ''\0'' value or for that matter any control
character into a DB2 CHAR/VARCHAR field ? So if i do a ''select
hex(column) from table'' i should see a 0 in the output. How can i do it
from the command prompt ?

Thanks,
Vivek



例如:

''ABC''|| CHR(0)|| CHR(10)|| CHR(13)|| ''XYZ''

For example:
''ABC'' || CHR(0) || CHR(10) || CHR(13) || ''XYZ''



不幸的是,这不会起作用,因为CHR(0)= 0x20 =''''=空格。
http://publib.boulder.ibm.com/infoce...n/r0000778.htm


但是0x00 =''\'''可以是由应用程序插入。


-

Knut Stolze

DB2信息集成开发

IBM德国


Unfortunately, this won''t work because CHR(0) = 0x20 = '' '' = space.
http://publib.boulder.ibm.com/infoce...n/r0000778.htm

But an 0x00 = ''\0'' can be inserted by an application.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany


这篇关于将\0插入CHAR / VARCHAR字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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