IBM / node-odbc

ODBC bindings for node
MIT License
144 stars 75 forks source link

[BUG] imb db2 as400 Token <END-OF-STATEMENT> was not valid. #262

Closed thealexbaron closed 2 years ago

thealexbaron commented 2 years ago

Describe your system

Describe the bug While connecting I receive

[IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0104 - Token <END-OF-STATEMENT> was not valid. Valid tokens: + - AS <IDENTIFIER>.

Expected behavior I'm expecting the query SELECT 1 to return data "1"

To Reproduce Steps to reproduce the behavior:

  1. Connect to the db
  2. try to run a query "select 1"

SQL64.LOG

markdirish commented 2 years ago

SELECT 1 isn't a valid query for Db2 for i (the database in IBM i, formerly known as "AS/400"). You need to select from something. Try" SELECT 1 FROM SYSIBM.SYSDUMMY1 or SELECT 1 AS "fieldName" FROM SYSIBM.SYSDUMMY1

thealexbaron commented 2 years ago

This was precisely the issue. Thank you.