IBM / nodejs-idb-connector

A JavaScript (Node.js) library for communicating with Db2 for IBM i, with support for queries, procedures, and much more. Uses traditional callback-style syntax
MIT License
37 stars 23 forks source link

[dbstmt] retrieve data when SQLFetch return SQL_SUCCESS_WITH_INFO #71

Closed dmabupt closed 5 years ago

dmabupt commented 5 years ago

Signed-off-by: mengxumx mengxumx@cn.ibm.com

Related issue: #68 @jasonclake

Test result seems OK --

-bash-4.4$ node idb-fetch-withinfo.js
This works---------------------------------------------
sql: select name
    , sum(case hasSpecAttr when '1' then 1 else 0 end) cnt
    from xumeng.article
    group by name
result: [
  {
    "NAME": "Article1            ",
    "CNT": "1"
  }
]
error: null
This does NOT work---------------------------------------------
sql: select name
    , count(case hasSpecAttr when '1' then 1 else null end) cnt
    from xumeng.article
    group by name
result: [
  {
    "NAME": "Article1            ",
    "CNT": "1"
  }
]
error: null