ibm mobilefirst - IBM Worklight - How to construct a JSON object in SQL adapter -


to construct json object in sql adapter have tried following:

{     'patientid':4,      'fname':'test',     'lname':'test',     'age':1,     'dob':1988-09-01,     'gender':'m',     'bg':'a+' } 

however error:

{    "errors": [       "runtime: method createsqlstatement called inside javascript function."    ],    "info": [    ],    "issuccessful": false,    "warnings": [    ] } 


full size image
how construct json oblect in sql adapter in ibm worklight

first, in "invoke procedure data" window adapter, don't wrap object in quotes. if do, think entire thing string.

if remove beginning , ending quotes have correct. window take valid json objects, if non integers strings. since 1988-09-01 not valid integer, must wrapped in quotes. should able copy/paste object wizard:

{     'patientid':4,      'fname':'test',     'lname':'test',     'age':1,     'dob':"1988-09-01",     'gender':'m',     'bg':'a+'  } 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -