Guidance Forums / Reginald Rexx / Special characters in SQL string

Search 搜索
Home Home

Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Special characters in SQL string
Posted by: misi01 2006-01-27 21:07:26 Last edited by: Jeff Glatt 2007-06-18 16:32:15 (Total edited 1 time)
I'm trying to send the following 2 SQL command strings to my database:
sql.1 = "update d12a01aa set produktbeteckn_bg = translate(produktbeteckn_bg,'??????','}{|$#@')"
sql.2 = "update d12a01aa set produktben?mn = translate(produktben?mn,'??????','}{|$#@')"
The first command succeeds, but the second fails.
Posted by: Jeff Glatt 2006-02-01 17:53:49 Last edited by: Jeff Glatt 2007-06-18 16:32:32 (Total edited 1 time)
Your REXX script is not UNICODE. It is ANSI. That means that REXX doesn't support non-ANSI (typically non-English) characters embedded in the script. This may or may not be your problem. You should probably try to express the characters using hex strings rather than normal strings. For example if the character ? is the hexadecimal value E3 (i don't know if it is), then you can use 'E3'X to replace it.
sql.2 = "update d12a01aa set produktben" || 'E3'x || "mn = translate(produktben?mn,'??????','}{|$#@')"
Posted by: misi01 2006-02-01 23:01:36 Last edited by: Jeff Glatt 2007-06-18 16:32:42 (Total edited 1 time)
The solution was along your lines, but even easier. I'll include it for anyone else who uses special characters in SQL commands.
sql.2 = "update d12a01aa set 'produktben?mn' = translate('produktben?mn','??????','}{|$#@')"
This takes advantage of the fact that you can put SQL column names in quotes, but I think the special characters have to be uppercased (not sure about that).
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
© Sun 2024-6-23  Guidance Laboratory Inc. Hits:0