0

I tried to get the countries beginning with L, however I get an error when I try to use the WHERE COUNTRY INTO 'L%' statement.

String sql = "SELECT COUNTRY, LER "  
 + "FROM CENSUS.WORLDIMR "    
 + "WHERE COUNTRY INTO 'L%'"; 

I recieve the following exception:

com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-199, SQLSTAT
E=42601, SQLERRMC=INTO;??( [ CONCAT || / MICROSECONDS MICROSECOND SECONDS SECOND
, DRIVER=4.18.74       

It's definitely something wrong with WHERE COUNTRY INTO 'L%'. I had the same problem with COBOL. Adding 29 times % fixed it but this time it's different.

0

1 Answer 1

3

I believe you need to use LIKE operator:

SELECT COUNTRY, LER FROM CENSUS.WORLDIMR WHERE COUNTRY LIKE 'L%';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.