Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hi Team,
I have a requirement where in I am calling a javascript service from a mashup, this service will inturn call a sql query service passing the json parameter. Once the sql service is executed, result of the query execution is retrieved in the javascript service.
Below are my services
Javascript service
var params = {
username: username /* STRING */,
password: password /* STRING */
};
logger.warn("username in params = " +params.username);
logger.warn("password in params = " +params.password);
var queryparams = {};
queryparams['name'] = params.username;
queryparams['password'] = params.password;
// result: INFOTABLE dataShape: "undefined"
var result = me.queryUser(queryparams);
SQL Query service
select * from DPD_USERS where NAME=[[params.name]] and password=[[params.password]] //where params is the json parameter sent in from JS service
When I execute the JS service its gets data properly and tries to execute the query service. However, in query service execution, I get the following error
Wrapped org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SELECT * FROM <MY_TABLE> WHERE NAME=[
I believe I am making a mistake in extracting parameters from json object. I could not get find any post which could lead me to correct syntax. Please help.
Thanks,
Pawan
Your SQL Servrice queryUser, should have two input parameters name and password
select * from DPD_USERS where NAME='<<name>>' and password='<<password>>'