简体   繁体   English

清理UniData的输入

[英]Sanitize Input for UniData

Can anyone provide a function to sanitize input for a UniData query? 任何人都可以提供清理UniData查询输入的功能吗? Or provide a list of things to remove? 或提供要删除的物品清单?

Use CONVERT to drop the single illegal characters all at once, then SWAP to delete the illegal multi-character strings. 使用CONVERT一次删除所有非法字符,然后使用SWAP删除非法的多字符字符串。

Building on the other answers, you get this: 在其他答案的基础上,您会得到:

CONVERT ( '"' : "'/[\]^" ) TO "" IN USER.DATA
SWAP "..." WITH "" IN USER.DATA

Here's a list of characters reserved by UniQuery: 这是UniQuery保留的字符列表:

 " double quote
 ' apostrophe (single quote)
 / forward slash
 [ left square bracket
 \ back slash
 ] right square bracket
 ^ caret

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 (eg, ] for ] )--and returns the sanatized string. 您可以编写一个简单的函数,它接受一个字符串,做了SWAP每个这些字符的-你可以用ISO 8859-1十进制代码交换(比如, ]] -和返回sanatized字符串。

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 ]. 's /这些可以用作通配符,具体取决于您所运行的模式,与[和]大致相同。

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. 我还没有实例可以对其进行测试,但是我相信您可以通过在VOC文件的'UOLOGIN'段落中将ECLTYPE显式设置为'P'来更改它。

UOLOGIN is like LOGIN. UOLOGIN就像LOGIN。 It is called when a session is first created. 首次创建会话时调用它。 The difference being that UOLOGIN is called for UniObjects sessions 区别在于为UniObjects会话调用了UOLOGIN

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM