Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to verify if an SQLJ iterator returns zero rows?

 
sharath kv
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I want to know how to verify if an SQLJ iterator is returning zero rows as a result of an SQL query.
Example:
#sql iter = { SQL-statement };
I want to verify if the iterator iter is containing zero or more rows(or values) before further processing.
I tried using this method,but was not successful
if(iter.cloumn-name()== null)
{
break;
}
I also tried converting the iterator to a JDBC resultset as follows:
ResultSet b = iter.getResultSet();
if(b == null)
{
break;
}
This approach also was not successful.
 
Irene Loos
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can check if it has next element, like this:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic