0

I created a new table in the Bluemix SQL Database service by uploading a csv (baseball.csv) and took the default table name of "baseball".

I created a simple app in Node.js which is just trying to select data from the table with select * from baseball, but I keep getting the following error:

[IBM][CLI Driver][DB2/NT] SQL0204N "USERxxxx.BASEBALL" in an undefined name

Why can't it find my database table?

3
  • 3
    "baseball" is not the same as baseball when we're talking table names. Try the uppercase BASEBALL when creating the table. Alternatively, try select * from "baseball". Commented May 13, 2015 at 0:49
  • This might be relevant: dba.stackexchange.com/questions/65818/… Commented May 13, 2015 at 6:06
  • @mustaccio that was it! I thought it was case insensitive, but wrote the query in lowercase just in case. Now I realize that the client will auto-capitalize it unless its quoted. Please convert your comment to an answer and claim your prize :-) Commented May 13, 2015 at 14:05

2 Answers 2

1

This issue seems independent of bluemix, rather it is usage error.

This error is possibly caused by following:

The object identified by name is not defined in the database.

User response

Ensure that the object name (including any required qualifiers) is correctly specified in the SQL statement and it exists.

try running "list tables" from command prompt to check if your table spelling is correct or not.

http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.messages.sql.doc/doc/msql00204n.html?cp=SSEPGG_9.7.0%2F2-6-27-0-130

Sign up to request clarification or add additional context in comments.

Comments

0

I created the table from SQL Database web UI in bluemix and took the default name of baseball. It looks like this creates a case-sensitive table name.

Unfortunately for me, the sql_db libary (and all db2 clients I believe) auto-capitalizes the SQL query into "SELECT * FROM BASEBALL"

The solution was to either

A. Explicitly name my table BASEBALL in the web UI; or

B. Modify my sql query by quoting the table name:

select * from "baseball"

More info at http://www.ibm.com/developerworks/data/library/techarticle/0203adamache/0203adamache.html#N10121

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.