简体   繁体   English

AS400 - 令牌“!” 无效

[英]AS400 - Token “!” not valid

I'm running a SQL query using RUNSQL into a CL program.我正在使用RUNSQL将 SQL 查询运行到 CL 程序中。 This query is a basic SELECT statement and uses the exclamation mark to concatenate strings.此查询是基本的 SELECT 语句,并使用感叹号连接字符串。

For years until yesterday, it worked fine.多年来,直到昨天,它运行良好。 Now, out of nowhere, I've got a SQL0104 message displaying Token '!'现在,不知从何而来,我收到一条SQL0104消息,显示Token '!' not valid every time I run the program.每次运行程序时都无效

If I run the query manually using STRSQL, it works.如果我使用 STRSQL 手动运行查询,它可以工作。

Did this occur to someone?这发生在某人身上吗?

Best regards.此致。

DB2's operator for string concatenation is actually the double pipe || DB2 的字符串连接运算符实际上是双 pipe || . .

The documentation says : 文档说

Use the concatenation operator ( || ) to join two values of an expression into a single string.使用连接运算符 ( || ) 将表达式的两个值连接成单个字符串。 In some non-English, single-byte character sets, the ||在一些非英语的单字节字符集中, || can display as !!可以显示为!! (exclamation marks) or other special characters. (感叹号)或其他特殊字符。

So your issue may be caused by a change in the character set of your client.因此,您的问题可能是由客户端字符集的更改引起的。 Just use the standard operator, and your code will work regardless.只需使用标准运算符,您的代码就可以正常工作。

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

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