Developer
Developer

Reputation: 329

Query from QSYS2.SysTables returns error "Token; void"

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).

Upvotes: 0

Views: 886

Answers (2)

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.

Upvotes: -1

James Allman
James Allman

Reputation: 41208

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

Upvotes: 3

Related Questions