Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello ,
I am getting error "org.json.JSONObject cannot be cast to java.lang.String" when i run the service.
input given = {"formulaexp":"(2*3)","outputtag":"test","displayunit":"testunit","attributearray":"{abc,efg,hij}"}
but the same input works when i execute in query analyser
Thanks
Sunay
Sunay, have you tried replacing the [[...]] with <<...>>> ?
sushant,
Yes but get the below error
Error executing service
Unable to Invoke Service TestInsertExpression on AlgorithmConfigratorDB : ERROR: syntax error at or near "{" Position: 185
Script
insert into Formula_Template(FormulaExp,OutputTag,DisplayUnit,AttributeArray)
select FormulaExp,OutputTag,DisplayUnit,AttributeArray from json_populate_record(null::Formula_Template, <<inputJSON>>)
Thanks
Sunay
Against which database are you running this query? Just want to recheck the syntax of SQL you have there, from the screenshot above it looks like PostgerSQL, but could you please confirm.
Its PostgreSQL.
Sushanth,
any suggestion on what i am missing in the syntax..?
Thanks
Sunay
one more question have you tested with INPUT parameter of type String instead of JSON?