0

Full code:

call connect on clearsql;
sqlcommand = "select sum(distinct gedimai.gedimo_salinimo_vidkaina) as suma, count(distinct gedimai.gedimo_salinimo_vidkaina) as kiekis from atveju_simptomai left join gedimai_simptomai on gedimai_simptomai.simptomo_id = atveju_simptomai.simptomo_id left join gedimai on gedimai.id = gedimai_simptomai.gedimo_id where atveju_simptomai.atvejo_id = '8'";
set results to the outcome of executeQuery on clearsql using sqlcommand.
set resultAvailable to the outcome of next on results.
print(String.valueOf(results.getInt("suma")));
print(results.getString("suma"));
objectResults.kaina_viso = results.getString("suma");
set resultAvailable to false.
call disconnect on clearsql;

print(results.getString("suma")) is ok - prints to screen '185.0', but objectResults.kaina_viso = results.getString("suma") gives an error.

objectResults.kaina_viso is string type. results is DebResultSet

com.blazesoft.engines.rules.NdEvaluationException: Call to 'getString' failed [Microsoft][ODBC Driver 11 for SQL Server]Invalid Descriptor Index while evaluating "results.getString("suma")" in function getPriceQty

Aer
  • 49
  • 1
  • 12
  • If you want to increase the odds of getting a useful answer you should really post more code and info. Is `results` a `ResultSet` ? After you create it what do you do to make sure it's not empty ? Is Eclipse related with this problem at all ? And so on. – SantiBailors Nov 24 '15 at 10:12
  • 2
    Try storing `results.getString("suma")` in a local variable instead of calling it twice. – Manu Nov 24 '15 at 10:13
  • Also, see if you are dealing with [this bug](http://stackoverflow.com/questions/6361340/java-sql-sqlexceptionmicrosoftodbc-driver-manager-invalid-descriptor-in); that post mentions solutions. – SantiBailors Nov 24 '15 at 10:19

1 Answers1

0

Solved! It is Blaze Advisor / Eclipse or Java bug. 1. Commented all the code and saved. 2. Uncommented code. 3. It is working without any changes

Aer
  • 49
  • 1
  • 12