开发者

Advantage Database Server (ADS) CIChar data type ISNULL

Unfortunately we are using the Advantage Database Server Torture Edition Versio开发者_Go百科n 8.1. After I had finished my project, I heard that the data base is configured to be case sensitive. So I changed the table structure, all Char data types to CIChar, which is a case insensitive char field. But I get this error while executing my program:

Advantage.Data.Provider.AdsException:

Error 7200: AQE Error: State = HY000; NativeError = 2214; [Extended Systems][Advantage SQL Engine]Invalid coercion: Result of expression is an ambiguous character type.

I found that the ISNULL(myciChar,'') is causing this problem, but I don't understand, WHY? How could I solve this problem? Is there other known issues with the cichar data type?

Any help will be appreciated. Thanks.

[update]

I found the reason for this error. There was two points to clarify.

  1. The data base has the version 8.1, but the data architect has the version 7.1 and in local mode it takes the architect engine version 7.1. That means it's a v7.1 issue.
  2. The 2nd parameter in the isnull function is in default case sensitive collation in version 7.1 while my column mytext is cichar and that's the ambiguous character type. So if someone has the same problem, it will work in v7.1 with the collate declaration:

works in v7.1:

select myid, isnull(mytext, '-' COLLATE ads_default_ci) as mytext from mytable

error in v7.1:

select myid, isnull(mytext, '-') as mytext from mytable


Probably need to see more of your expression to tell you why you are getting this error. It doesn't have as much to do with the ISNULL as it does the expression the ISNULL is being used in. The engine likely encountered a comparison and couldn't automatically determine if you wanted the comparison to be case sensitive or not. See the documentation which describes case insensitive precedence and coercion.

If not used in an expression, it might just be a bug (I just tried with 10.1 and it worked), verify you are using the latest version of 8.1, which is 8.10.0.38


I don't think that version 7 supports the cichar data type, version 6 certainly doesn't. I was using version 6 and went straight to 8 and found that everything worked with the version 6 client driver, until I used the cichar data type and then it was game-over for Advantage. I then had to update all the clients to the same version as the server. It is best to keep all the versions the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜