DELPHI通过ODAC执行存储过程传递包括ASCII=0的字符串参数好像有问题!!!

特兰 2010-07-21 04:48:33
我通过DELPHI单步跟踪可以确定DELPHI中的STRING没有丢失#0,执行存储过程前后Params中对应的Value也没有丢失字符,
但是Oracle存储过程中却只接收了#0前的部分数据。

大家遇到类似的问题吗?


心急如焚!
...全文
181 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wzwcn 2010-07-21
  • 打赏
  • 举报
回复
把你的#0改成字符串的0x0然后插入试试,我记得好象以十六进制插入数据库,它会自己处理的
特兰 2010-07-21
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 bdmh 的回复:]

#0被认为是结束符了
[/Quote]

前辈, 请问如何解决呢?!
感激赐教!
特兰 2010-07-21
  • 打赏
  • 举报
回复
原来如此,那我该如何解决这个问题〉?
A null or zero terminated string is an array of characers, indexed by an integer starting from zero. Since the array has no length indicator, Delphi uses the ASCII 0 (NULL; #0) character to mark the boundary of the string.
This means there is essentially no difference between a null-terminated string and an array[0..NumberOfChars] of type Char, where the end of the string is marked by #0.
特兰 2010-07-21
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 bdmh 的回复:]

#0被认为是结束符了
[/Quote]

应该不是的,我单步delphi的时候现实的是 'AAA'#0'AAA' 类似的
bdmh 2010-07-21
  • 打赏
  • 举报
回复
#0被认为是结束符了

2,507

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧