我遇到了调用SQL查询的问题 在我调用SQL查询后,结果为空。
SQLAdapter-impl.js
//Create SQL query
var getAccountsTransactionsStatement = WL.Server.createSQLStatement(
"SELECT transactionId, fromAccount, toAccount, transactionDate, transactionAmount, transactionType " +
"FROM accounttransactions " +
"WHERE accounttransactions.fromAccount = ? OR accounttransactions.toAccount = ? " +
"ORDER BY transactionDate DESC " +
"LIMIT 20;"
);
//Invoke prepared SQL query and return invocation result
function getAccountTransactions1(accountId){
return WL.Server.invokeSQLStatement({
preparedStatement : getAccountsTransactionsStatement,
parameters : [accountId, accountId]
});
}
//Invoke stored SQL procedure and return invocation result
function getAccountTransactions2(accountId){
return WL.Server.invokeSQLStoredProcedure({
procedure : "getAccountTransactions",
parameters : [accountId]
});
}
调用结果:
{
isSuccessful: true,
resultSet: [ ]
}
答案 0 :(得分:0)
var getAccountsTransactionsStatement = WL.Server.createSQLStatement("SELECT transactionId, fromAccount, toAccount, transactionDate, transactionAmount, transactionType FROM accounttransactions WHERE accounttransactions.fromAccount = ? OR accounttransactions.toAccount = ? ORDER BY transactionDate DESC LIMIT 20");
- 执行上面的行不要使用
+""
作为java中的行连接符 脚本。- 尝试按上述单行给出命令并说出我的意思 结果。
- 为安全起见,请删除SQL查询末尾的
醇>;
。