on 07-30-2010 9:27 AM
Hello,
I am using SAPJCo3 to get data from SAP into my java application. I have one problem with SQL Where statement. Hear is a piece of code.
u2026
JCoFunction function = this.createFunction(repository, "RFC_READ_TABLE");
function.getImportParameterList().setValue("QUERY_TABLE", "DD02L");
function.getImportParameterList().setValue("DELIMITER", "\t");
JCoTable options = function.getTableParameterList().getTable("OPTIONS");
options.appendRow();
options.setValue("TEXT", "TABCLASS = 'TRANSP' or TABCLASS = 'POOL' or TABCLASS = 'CLUSTER' or TABCLASS = 'VIEW'");
try {
function.execute(destination);
} catch (JCoException e) {
e.printStackTrace();
}
u2026
I get an SAPSQL_INVALID_FIELDNAME exception.
If I set just 3 fields
options.setValue("TEXT", " TABCLASS = 'POOL' or TABCLASS = 'CLUSTER' or TABCLASS = 'VIEW'");
or
options.setValue("TEXT", "TABCLASS = 'TRANSP' or TABCLASS = 'POOL' or TABCLASS = u2018CLUSTERu2019");
everything works fine.
I would understand if the problem lies in the length of the value that I set. I could append more rows and split the where clause into several. But stupid example is working fine:
options.setValue("TEXT", "VIEWCLASS = 'D' or VIEWCLASS = 'P' or VIEWCLASS = 'D' or VIEWCLASS = 'P' or VIEWCLASS = 'D' or VIEWCLASS = 'P'");
So I believe that the problem is somewhere else. Do you have any idea where it could be?
Best regards
Evgenia
OK, resolved the problem. The string should be splitted into substrings, length <=70 chars. The stupid example was working because by chance it was splitted in the "right" place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.