简体   繁体   English

对于某些空字段,WSO2 DSS 返回零而不是空

[英]WSO2 DSS return zero instead of null for some of null fields

There is a service made on wso2 dss based on query on a mssql view, my problem is that the service returns 0 value for some of null fields in database. wso2 dss 上有一项基于 mssql 视图查询的服务,我的问题是该服务为数据库中的某些空字段返回 0 值。 It seams that 0 just returns for numeric values for example for below elements with same null value in db, GPANO returns as 0 and GPA return as a null tag:它接缝 0 只返回数值,例如对于以下在 db 中具有相同空值的元素,GPANO 返回为 0,GPA 作为空标记返回:

<element column="GPANO" name="GPANO" xsdType="xs:string"/>
<element column="GPA" name="GPA" xsdType="xs:string"/>

This issue occurs when you have nullable numeric data types such as tinyInt , Int , ... in your database.当您的数据库中有可空的数值数据类型(例如tinyIntInt等)时,会出现此问题。 So you should change your data service query like this:因此,您应该像这样更改数据服务查询:

select case when GPA is null then '' else GPA end as GPA, ...

This will solve your problem and you will not see 0 in your output.这将解决您的问题,并且您不会在输出中看到 0。

This issue has been fixed in WSO2 DSS 3.5.0 .此问题已在WSO2 DSS 3.5.0中修复。 you can use that distribution for your use case.您可以将该发行版用于您的用例。

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

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