清理 UniData 的输入
谁能提供一个函数来清理 UniData 查询的输入?或者提供要删除的内容的列表?
Can anyone provide a function to sanitize input for a UniData query? Or provide a list of things to remove?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用CONVERT一次性删除单个非法字符,然后使用SWAP删除非法多字符字符串。
根据其他答案,您会得到:
Use CONVERT to drop the single illegal characters all at once, then SWAP to delete the illegal multi-character strings.
Building on the other answers, you get this:
以下是 UniQuery 保留的字符列表:
您可以编写一个快速函数,它接受一个字符串,对每个字符执行
SWAP
- 您可以与 ISO 8859-1 十进制代码进行交换(例如,]
for]
) - 并返回清理后的字符串。Here's a list of characters reserved by UniQuery:
You can write a quick function that takes a string, does a
SWAP
for each of these characters--you can swap with the ISO 8859-1 decimal code (e.g.,]
for]
)--and returns the sanatized string.除了 Rob Sobers 的答案之外,还可以查找三重
.
's/ 这些可以用作通配符,具体取决于您运行的模式,与 [ 和 ] 非常相似。编辑评论:
我面前没有实例来测试这一点,但我相信您可以通过在 VOC 文件的“UOLOGIN”段落中将 ECLTYPE 显式设置为“P”来更改它。
UOLOGIN 就像登录一样。首次创建会话时会调用它。区别在于 UniObjects 会话调用 UOLOGIN
In addition to Rob Sobers answer also look for triple
.
's/ These can be used as wildcards depending on the mode you are running in, much the same as [ and ].EDIT for the comment:
I haven't got an instance in front of me to test this in, but I believe you can change it by explicitly setting the ECLTYPE to 'P' in the 'UOLOGIN' paragraph in the VOC file.
UOLOGIN is like LOGIN. It is called when a session is first created. The difference being that UOLOGIN is called for UniObjects sessions