0
votes

I am trying to read data from AS400 DB using Excel, VBA and ODBC driver. Connection is successful but none of the queries are retrieving data from DB. For ex: The select query is not working:

select * from QSYS2.SysTables;

The Client gets the following error message:

[IBM] [System i Access ODBC Driver] [DB2 for i5/OS] SQL0104 - Token; void. Valid tokens: <END Instruction>.

What is wrong with my query?

Edit: I am trying to read data from AS400 only not from DB2. I want to read the table names from SysTables(system table).

2
Are you talking about a DB2 database or an "AS400 Database"? Please post your actual query, plus the schema of the tables you're trying to query. Some sample data would be helpful as well. Remember: sscce.orgBryanH
@BryanH The AS/400 (now called IBM i on Power Systems) has DB2 integrated into the OS. The As/400 database is DB2.WarrenT

2 Answers

3
votes

Remove the statement termination character (;) for a single statement execution.

-1
votes

This is an example for retrieving queries:

"Select * from Tablename";

If it doesn't work, try checking the manual for query in Microsoft. It's different from standard SQL queries.