Can anyone provide a function to sanitize input for a UniData query? Or provide a list of things to remove?
A:
Here's a list of characters reserved by 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 (e.g., ]
for ]
)--and returns the sanatized string.
Rob Sobers
2009-10-30 20:30:45
A:
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 he sames as [ and ].
Dan McGrath
2009-11-14 02:00:32
A:
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:
CONVERT ( '"' : "'/[\]^" ) TO "" IN USER.DATA
SWAP "..." WITH "" IN USER.DATA
JeffK
2009-12-04 19:24:11