A very simple piece of SQLJ:
try
{
#sql [sqlj4context] sqlj4_iterator = {SELECT PHONENO FROM
DB2ADM.EMPLOYEE WHERE WORKDEPT = 'D11'};
while(sqlj4_iterator.next())
{
System.out.println(sqlj4_iterator.phoneno());
if (sqlj4_iterator.phoneno() == "2890")
{
System.out.println("YES!!");
}
}
sqlj4_iterator.close();
#sql [sqlj4context] {COMMIT};
sqlj4context.close();
} catch (SQLException sqlexcp)
The output generated is:
6423
4510
3782
2890
1682
2986
4501
0942
0672
Why is "YES" not produced in the output when phone no. 2890 appears in
the output? PHONENO is defined as CHAR(4) in the table.
TIA
Raquel.