Search code examples
ibm-cloudnode-reddashdb

How to pass two parameters to dashDB query element of Node-Red from IBM Bluemix


I'm trying to pass two parameters into sql query from dashDB object in Node-Red flow editor on Bluemix. My parameters are stored in msg.fromDate and msg.toDate and I want to enter them into "Parameter Marker" of dashDB node. When I only use one parameter, I simply type "msg.fromDate" in Parameter Markers and it works fine. In log I see this:

2015-12-10T12:22:12.856+0100 [App/0] out Input node: pathToArray: msg,toDate 2015-12-10T12:22:12.856+0100 [App/0] out Input node: parameterValues: 2015-12-01

Now, when I try to use two input parameters I type "msg.toDate, msg.fromDate" in "Parameter Marker" I'm getting this error in log:

2015-12-10T12:26:01.271+0100 [App/0] out 10 Dec 11:26:01 - [error] [dashDB in:popular words] TypeError: Cannot read property 'fromDate' of undefined

2015-12-10T12:26:01.270+0100 [App/0] out Input node: pathToArray: msg,toDate, msg,fromDate

How to pass two parameters?


Solution

  • I found the reason for this issue. It looks that when I enter "Parameter Marker" like this:

    msg.toDate, msg.fromDate
    

    it does not work. And like this it works:

    msg.toDate,msg.fromDate
    

    In other words space between parameters breaks it!