Solved

Strange IBM DB2 error

Posted on 2013-06-09
4
2,475 Views
Last Modified: 2013-06-09
I tried to execute this sql command

SELECT * from db2inst1.users where username = 'esmith'

However, I got the following message:
1) [Error Code: -206, SQL State: 42703]  DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=USERNAME, DRIVER=4.13.127. 2) [Error Code: -727, SQL State: 56098]  DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-206;42703;USERNAME, DRIVER=4.13.127

I have verified the column 'username' exist in the table and if I executed:

SELECT * from db2inst1.users

It executes successfully

Attach is the screen shot of the result

Any help is greatly appreciated
2013-06-09-06-25-13.png
0
Comment
Question by:widj91942
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
ID: 39232988
it is weird
have you tried

SELECT * from db2inst1.users where "UserName" = 'esmith'
0
 

Author Closing Comment

by:widj91942
ID: 39233006
I believed I have tried that, however, I think the capitalization is different. This is weird, normally the column name is not case-sensitive.

Anyhow, thanks a lot.
0
 
LVL 45

Expert Comment

by:Kdo
ID: 39233103
Hi widj91942,

Just elaborating...

Column names, just like ALL names in the database, are case sensitive.  The name in the query is converted to upper case unless it is enclosed in quotes.  The four statements below are equivalent.  They all create the table XX (upper case) with one column, USERNAME (upper case).

CREATE TABLE xx (USERNAME varchar (100));
CREATE TABLE xx (UserName varchar (100));
CREATE TABLE xx (username varchar (100));
CREATE TABLE xx ("USERNAME" varchar (100));

The statements below create a table identical to the table created above, except that the table and column name are create with the exact upper/lower case as is in the quotes.

CREATE TABLE "xx" ("username" varchar (100));
CREATE TABLE "Xx" ("Username" varchar (100));
CREATE TABLE "xX" ("UserName" varchar (100));

Good Luck,
Kent
0
 

Author Comment

by:widj91942
ID: 39233118
Thanks a lot for the elaboration.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
noX challenge 17 76
word0 challenge 3 56
word0 challenge 4 52
github account with ecipse 1 15
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now