Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Special characters in SQL string

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Special characters in SQL string
#7824
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.
Michael
Message2.
#7836
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,'??????','}{|$#@')"
Message3.
#7838
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).
Michael
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥410.00 ·
 
 
¥288.00 ·
 
 
¥918.00 ·
 
 
¥288.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0