I'm having problem with the invocation an SQL query After I invoke the SQL query, the result is empty.
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]
});
}
Invocation Result:
{
isSuccessful: true,
resultSet: [ ]
}
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");
- Execute the above line don't use
+""
as a line joiners in the java script.- Try to give the command in the single line as above and say me the result.
- And to be safe remove the
;
at the end of the sql query.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.