on 07-26-2004 5:42 PM
Hi
I am try to implement the Java Persistence tutorial sample, but It's not working.
In the following code:
================================
EmployeeIter iter = null;
#sql [ctx] iter = {
select EMPID, FIRST_NAME, LAST_NAME, SALARY
from TMP_EMPLOYEE
};
================================
I got error messages in #sql line:
- SQLJ: Left hand side of assignment does not have a Java type.
- SQLJ: Return type incompatible with SELECT statement: com.sap.sql.sqlj.semantics.TypeProperties$Invalid is not an iterator type
Following the code of iterator:
================================
package tutoper.dao;
#sql iterator EmployeeIter(int EMPID, String FIRST_NAME, String LAST_NAME, java.math.BigDecimal SALARY);
================================
Any suggestion?
TIA
I moved the interator class to the DAO and the problem was solved...
That's quite interesting because if the class was not resolved, why there was no error in the line:
EmployeeIter iter = null;
It seems that the erros during processing of SQLJ make eclipse confuse (and me too and drops messages??
The best approach seems to put SQLJ in comments, and check the rest of the code for erros.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did some tests and I found that when I change the name of the variable 'iter' (for example: 'iterx') the error messages stay the same. So I suppose this is the point of error...But what is wrong?? It seems that SQLJ is not recognizing the variable name??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
looks fine to me.
I would rebuild the whole project, that helps sometimes with stranges errors in sqlj.
And if your iterator and the select-class are not in the same package you might need to import the iterator class.
Regards, Astrid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.