简体   繁体   中英

No Result Set for SQL query

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");
  1. Execute the above line don't use +"" as a line joiners in the java script.
  2. Try to give the command in the single line as above and say me the result.
  3. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM