Commit 78f29b7
authored
Use %ZEN.Auxiliary.altJSONSQLProvider for the processing of MDX Drillthrough queries
Consider this code:
```
set SQL="SELECT '5125.72','1714.50'"
do ##class(%ZEN.Auxiliary.jsonSQLProvider).%WriteJSONFromSQL(,SQL)
```
It produces the following output:
```
{
"children":[
{
"HostVar_1":5125.72,
"HostVar_2":"1714.50"
}
]
}
```
Instead of:
```
{
"children":[
{
"HostVar_1":5125.72,
"HostVar_2":1714.50
}
]
}
```
This is because `ZENJSISNUM` macro in `%ZEN.Utils.inc` is used to check if a string is a number.
Macro definition is:
```
#define ZENJSISNUM(%val) ($IsValidNum(%val)&&(%val=+(%val))&&(%val <= 9007199254740991)&&(%val >= -9007199254740991))
```
Note the second condition there: %val=+(%val)
It won't evaluate as true for numbers with `0` at the end, such as `1714.50`, which causes it to be interpreted as a string.
This commit changes to `%ZEN.Auxiliary.altJSONSQLProvider` which does not have this issue.
Fixes #791 parent 0f8dd1b commit 78f29b7
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments